Protocol message transmission method and apparatus, storage medium and electronic device

By creating a compressed data set on the server, using a log collector to filter high-frequency data to generate an index, and replacing the data in the protocol messages, the problem of low protocol message transmission efficiency is solved, and more efficient transmission is achieved.

WO2026067113A1PCT designated stage Publication Date: 2026-04-02INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Filing Date
2025-09-15
Publication Date
2026-04-02

AI Technical Summary

Technical Problem

The transmission efficiency of protocol messages in the existing technology is low, especially when there is similar data between different protocol messages, the compression efficiency is not high.

Method used

The server stores a set of compressed data for the target transmission protocol. A log collector filters data with a frequency greater than or equal to a frequency threshold from the protocol logs as reference data, generates an index and a correspondence, and replaces the data in the protocol messages to form compressed messages.

Benefits of technology

It improves the transmission efficiency of protocol messages, reduces the amount of data transmitted between the server and terminal devices, and enhances transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2025121422_02042026_PF_FP_ABST
    Figure CN2025121422_02042026_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the embodiments of the present application are a protocol message transmission method and apparatus, a storage medium and an electronic device. The method comprises: acquiring an initial message to be transmitted to a terminal device by means of a target transmission protocol; searching a compressed data set for data in the initial message; when target data in the initial message is found in the compressed data set, replacing the target data in the initial message with a corresponding target index in the compressed data set, so as to obtain a compressed message; and transmitting the compressed message to the terminal device. The present application solves the problem of low efficiency of protocol message transmission, thus achieving the effect of improving the efficiency of protocol message transmission.
Need to check novelty before this filing date? Find Prior Art

Description

Method and device for transmitting protocol message, storage medium and electronic device

[0001] Cross-reference to Related Applications

[0002] The present application claims priority to the Chinese patent application No. 202411374623.5, filed on September 29, 2024, and entitled "Method and device for transmitting protocol message, storage medium and electronic device", the content of which is incorporated herein by reference in its entirety. TECHNICAL FIELD

[0003] Embodiments of the present application relate to the field of computers, in particular, to a method and device for transmitting protocol message, storage medium and electronic device. BACKGROUND

[0004] In related technologies, in the case of compressing a protocol message that needs to be transmitted, only the repeated content in a single protocol message is compressed. It can be understood that, in related technologies, the protocol message is compressed only according to the self-repetition of the protocol message.

[0005] However, in actual situations, the more recently accessed data is more likely to be accessed again, that is, similar data may exist between the data of different protocol messages. In related technologies, the compression efficiency is low due to the small amount of repeated content in a single protocol message. SUMMARY

[0006] Embodiments of the present application provide a method and device for transmitting protocol message, storage medium and electronic device to at least solve the problem of low transmission efficiency of protocol message in related technologies.

[0007] According to an embodiment of the present application, a method for transmitting a protocol message is provided. A server stores a compression data set corresponding to a target transmission protocol. The compression data set records an index and reference data having a corresponding relationship. The reference data is data with a frequency greater than or equal to a frequency threshold, which is filtered from a protocol log of the target transmission protocol recorded by the server. The method is applied to the server and includes: obtaining an initial message to be transmitted to a terminal device through the target transmission protocol; searching for data in the initial message from the compression data set; in the case where target data in the initial message is found from the compression data set, replacing the target data in the initial message with a corresponding target index in the compression data set to obtain a compressed message; and transmitting the compressed message to the terminal device.

[0008] In an example embodiment, before the initial message to be transmitted to the terminal device through the target transmission protocol is acquired, the method further comprises: collecting, by the log collector, protocol logs of the target transmission protocol recorded by the server to obtain an initial log set, and parsing, by the log collector, each protocol log in the initial log set to obtain an initial log data set; filtering, from the initial log data set, data with a frequency greater than or equal to a frequency threshold to obtain reference data; and generating an index corresponding to the reference data in a descending order of frequency, and recording the index and the reference data with a corresponding relationship in a descending order of frequency.

[0009] In an example embodiment, filtering, from the initial log data set, data with a frequency greater than or equal to a frequency threshold to obtain reference data comprises: extracting candidate data carried in log data corresponding to each protocol log in the initial log data set, wherein the log data corresponding to at least two protocol logs in the initial log data set each includes the candidate data; determining a first frequency of the candidate data according to the candidate data and the initial log data set, and determining a second frequency of the candidate data according to the candidate data and the initial log set; performing a product operation on the first frequency and the second frequency to obtain a target frequency of the candidate data; and filtering, from the candidate data, data with a target frequency greater than or equal to the frequency threshold to obtain the reference data.

[0010] In an example embodiment, determining a first frequency of the candidate data according to the candidate data and the initial log data set comprises: in a case where the initial log data set includes N data and the candidate data includes M data, determining an i1th frequency of an i-th data in the M data by performing the following steps, wherein N is a positive integer, M is a positive integer, and i is a positive integer less than or equal to M: in a case where the i-th data appears K times in the N data, determining the i1th frequency as a value obtained by dividing K by S, wherein S is a number of times that a data with a maximum number of appearances in the N data appears in the N data, and S is a positive integer; and determining a second frequency of the candidate data according to the candidate data and the initial log set comprises: in a case where the candidate data includes M data, the initial log set includes Q protocol logs, and P protocol logs in the Q protocol logs include the i-th data in the M data, determining an i2th frequency of the i-th data by performing the following steps, wherein M is a positive integer, Q is a positive integer, P is a positive integer less than or equal to Q, and i is a positive integer less than or equal to M: performing a sum operation on P and a reference value to obtain a target sum value; dividing Q by the target sum value to obtain a target quotient value; and performing a logarithm operation on the target quotient value to obtain the i2th frequency.

[0011] In an example embodiment, after generating the indexes corresponding to the reference data in the order of the frequency of occurrence from high to low and recording the indexes and the reference data having the corresponding relationship in the order of the frequency of occurrence from high to low, the method further comprises: setting a validity period of the compressed data set as a target time length, wherein the target time length is equal to a time difference between a target time and a generation time of the compressed data set, the generation time is earlier than the target time, and the target time is the latest time allowing the server and the terminal device to use the compressed data set to transmit the protocol message through the target transmission protocol; recording the generation time, the validity period and the version identifier of the compressed data set.

[0012] In an example embodiment, after recording the generation time, the validity period and the version identifier of the compressed data set, the method further comprises: in the case that it is detected that the compressed data set is not within the validity period, collecting, by a log collector, an updated protocol log of the target transmission protocol recorded by the server to obtain an updated log set, and analyzing, by the log collector, each protocol log in the updated log set to obtain an updated log data set; screening, from the updated log data set, data having a frequency of occurrence greater than or equal to a frequency threshold to obtain updated data; generating updated indexes corresponding to the updated data, and recording the updated indexes and the updated data having the corresponding relationship in the order of the frequency of occurrence from high to low, wherein the updated data set comprises the updated indexes and the updated data having the corresponding relationship.

[0013] In an example embodiment, the server is deployed with a first transmission device, and the first transmission device is deployed with a first decoder connected with the terminal device to obtain an initial message to be transmitted to the terminal device through the target transmission protocol, comprising: receiving a compression request message initiated by the terminal device; extracting, by the first decoder, an initial version identifier carried in the compression request message, and searching, by the first decoder, a reference index in the compression request message in a compressed data set corresponding to the initial version identifier; in the case that the reference index in the compression request message is searched in the compressed data set by the first decoder, replacing, by the first decoder, the reference index with corresponding compressed data in the compressed data set to obtain an initial request message; and obtaining the initial message in response to the initial request message.

[0014] In an example embodiment, finding data in an initial message from a compressed data set comprises: in a case that the initial message comprises R data, the compressed data set comprises T indexes and T data with a corresponding relationship, R is a positive integer, T is a positive integer, and s is a positive integer less than or equal to R, finding the s-th data in the R data from the compressed data set by performing the following steps: extracting the s-th data set from the R data, wherein the s-th data set comprises the s-th data and L data adjacent to the s-th data, and L is a positive integer; finding the s-th data set from the T data; in a case that each data in the s-th data set is found from the T data, marking the s-th data set as index data, and continuing to find the s+L+1-th data in the R data from the T data; in a case that each data in the s-th data set is not found from the T data, marking the s-th data set as non-index data, and continuing to find the s+L+1-th data in the R data from the T data.

[0015] In an example embodiment, a first transmission device is deployed in a server, a first encoder is deployed in the first transmission device, the first encoder is connected with a terminal device, and the first transmission device transmits a compressed message to the terminal device, comprising: performing a corresponding first encoding operation on a target index in the compressed message by the first encoder to obtain a first compressed and encoded message, and performing a corresponding second encoding operation on other data in the compressed message by the first encoder to obtain a second compressed and encoded message, wherein the other data comprises data in the compressed message except the target data, the first compressed and encoded message comprises data obtained by encoding the target index or data obtained by encoding the number of bytes occupied by the target index, and the second compressed and encoded message comprises data obtained by encoding the data amount of the other data and data obtained by encoding the other data, or the second compressed and encoded message comprises data obtained by encoding the number of bytes occupied by the data amount of the other data and data obtained by encoding the other data; carrying an initial version identifier of the compressed data set in the target compressed message, and transmitting the target compressed message to the terminal device, wherein the target compressed message comprises the first compressed and encoded message and the second compressed and encoded message.

[0016] In an example embodiment, before obtaining the initial message to be transmitted to the terminal device by the target transmission protocol, the method further comprises: receiving a target data request initiated by the terminal device, wherein the target data request is used to request to obtain the compressed data set; in response to the target data request, extracting the compressed data set, and transmitting the compressed data set, the generation time of the compressed data set, the validity period of the compressed data set, and the initial version identifier of the compressed data set to the terminal device; or receiving an update data request initiated by the terminal device, wherein the update data request is used to request to obtain the update data set; in response to the update data request, extracting the update data set, and transmitting the update data set, the generation time of the update data set, the validity period of the update data set, and the update version identifier of the update data set to the terminal device.

[0017] According to another embodiment of the present application, a transmission method of a protocol message is provided. A compressed data set corresponding to a target transmission protocol is stored in a terminal device. The compressed data set records indexes and reference data having a corresponding relationship. The reference data is data with an occurrence frequency greater than or equal to a frequency threshold value, which is filtered from a protocol log of the target transmission protocol recorded by a server. The method is applied to the terminal device, and the method comprises: receiving a compressed message transmitted by the server, and extracting an initial version identifier carried in the compressed message; searching for data in the compressed message from the compressed data set corresponding to the initial version identifier; and in the case that the target compressed data in the compressed message is found from the compressed data set, replacing the target compressed data in the compressed message with the corresponding target data in the compressed data set to obtain a target message.

[0018] In an example embodiment, before receiving the compressed message transmitted by the server, the method further comprises: detecting whether the terminal device stores the compressed data set; in the case that it is detected that the terminal device does not store the compressed data set, initiating a target data request to the server, wherein the target data request is used to request to obtain the compressed data set, receiving the compressed data set, the generation time of the compressed data set, the validity period of the compressed data set, and the initial version identifier of the compressed data set returned by the server in response to the target data request; in the case that it is detected that the terminal device stores the compressed data set, detecting whether the compressed data set is within the validity period, and in the case that it is detected that the compressed data set is not within the validity period, initiating an update data request to the server, wherein the update data request is used to request to obtain the update data set, and receiving the update compressed data set, the generation time of the update data set, the validity period of the update data set, and the update version identifier of the update data set returned by the server in response to the update data request.

[0019] In an example embodiment, detecting whether the compressed data set is within the valid period comprises: detecting whether a target time length difference between a current time and a target time is less than or equal to a difference threshold, wherein the current time is a time at which it is detected whether the compressed data set is within the valid period, and the current time is earlier than the target time; and determining that the compressed data set is not within the valid period if it is detected that the target time length difference is less than or equal to the difference threshold.

[0020] In an example embodiment, the second transmission device is deployed in the terminal device, and the second decoder is deployed in the second transmission device and connected to the server. The second decoder is configured to: perform a first decoding operation corresponding to a first encoding operation on the first compressed and encoded message to obtain a target index, and perform a second decoding operation corresponding to a second encoding operation on the second compressed and encoded message to obtain other data in the initial message except for the target data; and find the target data corresponding to the target index from the compressed data set corresponding to the initial version identifier, wherein the target message includes the target data and the other data.

[0021] In an example embodiment, finding the target data corresponding to the target index from the compressed data set corresponding to the initial version identifier comprises: in a case where the target index includes W indexes, and the compressed data set includes T indexes and T data having a corresponding relationship, finding the tth data corresponding to the tth index in the W indexes from the T indexes and the T data having the corresponding relationship by performing the following steps, wherein the target data includes K data, the K data includes the tth data, W is a positive integer, T is a positive integer, and t is a positive integer that is equal to or less than T: finding the tth index from the T indexes; and in a case where the tth index is found from the T indexes, determining the data corresponding to the tth index in the T indexes and the T data having the corresponding relationship as the tth data.

[0022] In one example embodiment, the terminal device is deployed with a second transmission device, the second transmission device is deployed with a second encoder, the second encoder is connected with the server, and before receiving the compressed message transmitted by the server, the method further comprises: generating an initial request message, wherein the initial request message is used to request to obtain an initial message; searching for data in the initial request message in the compressed data set by the second encoder; in the case that the to-be-compressed data in the initial request message is found in the compressed data set by the second encoder, replacing the to-be-compressed data in the initial request message with the corresponding reference index in the compressed data set by the second encoder to obtain a compressed request message; and initiating the compressed request message to the server, wherein the compressed request message carries an initial version identifier of the compressed data set, the server is configured to obtain the initial message in response to the received initial request message, and replace target data in the initial message with the target index in the compressed data set to obtain a compressed message transmitted to the terminal device.

[0023] According to another embodiment of the present application, a transmission device of a protocol message is provided, comprising: a compressed data set corresponding to a target transmission protocol is stored in a server, the compressed data set records indexes and reference data having a corresponding relationship, the reference data is data whose occurrence frequency is greater than or equal to a frequency threshold value and is filtered from a protocol log of the target transmission protocol recorded by the server, the device is applied to the server, and the device comprises: an obtaining module configured to obtain an initial message to be transmitted to a terminal device by the target transmission protocol; a first searching module configured to search for data in the initial message from the compressed data set; a first replacing module configured to replace target data in the initial message with a corresponding target index in the compressed data set to obtain a compressed message in the case that the target data in the initial message is found in the compressed data set; and a transmission module configured to transmit the compressed message to the terminal device.

[0024] According to another embodiment of the present application, another transmission device of a protocol message is provided, comprising: a compressed data set corresponding to a target transmission protocol is stored in a terminal device, the compressed data set records indexes and reference data having a corresponding relationship, the reference data is data whose occurrence frequency is greater than or equal to a frequency threshold value and is filtered from a protocol log of the target transmission protocol recorded by a server, the device is applied to the terminal device, and the device comprises: a third receiving module configured to receive a compressed message transmitted by the server and extract an initial version identifier carried in the compressed message; a second searching module configured to search for data in the compressed message from a compressed data set corresponding to the initial version identifier; and a second replacing module configured to replace target compressed data in the compressed message with corresponding target data in the compressed data set to obtain a target message in the case that the target compressed data in the compressed message is found in the compressed data set.

[0025] According to a further embodiment of the present application, a server system is also provided, the server system comprising a connected server and a terminal device, wherein the server and the terminal device are configured to perform the steps of any of the above method embodiments when executed.

[0026] According to a further embodiment of the present application, a non-transitory computer readable storage medium is also provided, the non-transitory computer readable storage medium having stored therein a computer program, wherein the computer program is configured to perform the steps of any of the above method embodiments when executed.

[0027] According to a further embodiment of the present application, an electronic device is also provided, the electronic device comprising a memory and a processor, the memory having stored therein a computer program, and the processor being configured to execute the computer program to perform the steps of any of the above method embodiments.

[0028] According to a further embodiment of the present application, a computer program product is also provided, the computer program product comprising a computer program, the computer program being executable by a processor to perform the steps of any of the above method embodiments.

[0029] According to the present application, the server creates a corresponding compressed data set for different transmission protocols, and the compressed data set records data with a higher frequency of occurrence in the protocol log of the transmission protocol. When the server transmits a protocol message to the terminal device through the transmission protocol, the data in the protocol message is replaced with the data in the compressed data set. In this way, the data with a higher frequency of occurrence in the protocol message transmitted between the server and the terminal device through the transmission protocol is replaced with the corresponding index, thereby reducing the amount of data of the protocol message transmitted between the server and the terminal device. Therefore, the problem of low transmission efficiency of the protocol message can be solved, and the transmission efficiency of the protocol message can be improved. BRIEF DESCRIPTION OF DRAWINGS

[0030] FIG. 1 is a hardware structure block diagram of a server device of a protocol message transmission method according to an embodiment of the present application;

[0031] FIG. 2 is a flowchart of a protocol message transmission method according to an embodiment of the present application;

[0032] FIG. 3 is a schematic diagram of an optional network architecture according to an embodiment of the present application;

[0033] FIG. 4 is a schematic diagram of an optional compressed data set according to an embodiment of the present application;

[0034] FIG. 5 is a schematic diagram of an optional compressed bytecode according to an embodiment of the present application;

[0035] FIG. 6 is a flowchart of a protocol message transmission method according to an embodiment of the present application;

[0036] FIG. 7 is a schematic diagram of transmission of a protocol packet according to an embodiment of the present application;

[0037] FIG. 8 is a schematic diagram of an index dictionary table according to an embodiment of the present application;

[0038] FIG. 9 is a structural block diagram of a transmission device of a protocol packet according to an embodiment of the present application;

[0039] FIG. 10 is a structural block diagram of another transmission device of a protocol packet according to an embodiment of the present application. DETAILED DESCRIPTION

[0040] Hereinafter, the embodiments of the present application will be described in detail with reference to the accompanying drawings and in conjunction with embodiments.

[0041] It should be noted that the terms "first", "second" and the like in the description and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or sequence.

[0042] The method embodiments provided in the embodiments of the present application can be executed in a server device or similar computing device. Taking an example of running on a server device, FIG. 1 is a hardware structural block diagram of a server device of a protocol packet transmission method according to an embodiment of the present application. As shown in FIG. 1, the server device can include one or more (only one is shown in FIG. 1) processors 102 (the processor 102 can include but is not limited to a processing device such as a microcontroller unit MCU or a field programmable gate array FPGA) and a memory 104 configured to store data, wherein the server device can further include a transmission device 106 configured to implement a communication function and an input and output device 108. Those skilled in the art can understand that the structure shown in FIG. 1 is only schematic, which does not limit the structure of the server device. For example, the server device can further include more or less components than those shown in FIG. 1, or have a different configuration from that shown in FIG. 1.

[0043] The memory 104 can be configured to store computer programs, such as software programs of application software and modules, such as a computer program corresponding to the protocol message transmission method in the embodiments of the present application. The processor 102 performs various functional applications and data processing, i.e., implements the above method, by running the computer programs stored in the memory 104. The memory 104 can include a high-speed random access memory, and can further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some examples, the memory 104 can further include memories remotely arranged with respect to the processor 102, which can be connected to a server device through a network. Examples of the above network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0044] The transmission device 106 is configured to receive or send data via a network. A specific example of the above network can include a wireless network provided by a communication provider of a server device. In one example, the transmission device 106 includes a network adapter (NIC), which can be connected to other network devices through a base station so as to be able to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is configured to communicate with the Internet in a wireless manner.

[0045] First, the terms involved in the embodiments of the present application are explained as follows:

[0046] Szip: Statistical HTTP Compression, a method of constructing a dynamic index dictionary for communication data compression based on statistical analysis of HTTP messages.

[0047] Sdict: System Dictionary, a dynamic index dictionary obtained based on statistical analysis of application system dimension message logs.

[0048] Self-repetition: the higher the frequency and the more the number of the same characters or character strings in the text content, the higher the self-repetition.

[0049] In the embodiments, a protocol message transmission method is provided. A server stores a compressed data set corresponding to a target transmission protocol. The compressed data set records indexes and reference data having a corresponding relationship. The reference data is data with a frequency greater than or equal to a frequency threshold, which is filtered from protocol logs of the target transmission protocol recorded by the server. The method is applied to the server. FIG. 2 is a flowchart of the protocol message transmission method according to the embodiments of the present application. As shown in FIG. 2, the flowchart includes the following steps:

[0050] Step S202, obtaining an initial message to be transmitted to a terminal device through a target transmission protocol;

[0051] Step S204, searching for data in the initial message from the compressed data set;

[0052] Step S206, in the case of finding the target data in the initial message from the compressed data set, replacing the target data in the initial message with the corresponding target index in the compressed data set to obtain a compressed message;

[0053] Step S208, transmitting the compressed message to the terminal device.

[0054] Through the above steps, the server creates a corresponding compressed data set for different transmission protocols, and the compressed data set records data with a higher frequency of occurrence in the protocol log of the transmission protocol. In the case of transmitting a protocol message through a transmission protocol to a terminal device, the server replaces the data in the protocol message with the data in the compressed data set, in this way, the data with a higher frequency of occurrence in the protocol message transmitted between the server and the terminal device through the transmission protocol is replaced with the corresponding index, reducing the amount of data of the protocol message transmitted between the server and the terminal device, thus, the problem of low transmission efficiency of the protocol message can be solved, and the effect of improving the transmission efficiency of the protocol message is achieved.

[0055] In the technical solution provided in the above step S202, the target transmission protocol can be but is not limited to used for communication between the server and the terminal device, for example, the target transmission protocol can be but is not limited to including the http (Hypertext Transfer Protocol, HyperText Transfer Protocol) protocol, and the server can be but is not limited to storing a corresponding compressed data set for different transmission protocols, it can be understood that the compressed data sets corresponding to different transmission protocols can be but are not limited to different, it should be noted that the reference data recorded in the compressed data set can change with the data communicated between the server and the terminal device through the target transmission protocol, it can be understood that the reference data is dynamically changed.

[0056] Optionally, in the embodiment, the protocol log of the target transmission protocol can be but is not limited to generated in the following way: the protocol log can be but is not limited to generated by the protocol message transmitted between the server and the terminal device through the target transmission protocol. In this way, all the contents related to the target transmission protocol on the server can generate the protocol log, and the matching degree between the generated compressed data set and the content to be transmitted through the target transmission protocol is improved.

[0057] In an exemplary embodiment, the log collector can be deployed in the server in the following manner, but is not limited thereto, before obtaining the initial message to be transmitted to the terminal device through the target transmission protocol: the log collector collects the protocol logs of the target transmission protocol recorded by the server to obtain an initial log set, and parses each protocol log in the initial log set through the log collector to obtain an initial log data set; the data with a frequency greater than or equal to a frequency threshold is filtered from the initial log data set to obtain reference data; and the index corresponding to the reference data is generated in the order of frequency from high to low, and the index and the reference data with the corresponding relationship are recorded in the order of frequency from high to low.

[0058] Optionally, in the embodiment, the arrangement order of the index in the compressed data set can be positively correlated with the frequency of the reference data, for example, in the case where the index includes 01 to 10, the frequency of the data corresponding to the index value 01 is higher than the frequency of the data corresponding to the index value 8.

[0059] Optionally, in the embodiment, the higher the frequency of the data, the higher the frequency of the data in the protocol message transmitted between the server and the terminal device through the target transmission protocol in the current time period, and it can be understood that the data is frequently accessed by the terminal device and the server.

[0060] In an exemplary embodiment, the data with a frequency greater than or equal to a frequency threshold can be filtered from the initial log data set to obtain reference data in the following manner, but is not limited thereto: the candidate data carried in the log data corresponding to each protocol log in the initial log data set is extracted, wherein the candidate data is included in the log data corresponding to at least two protocol logs in the initial log data set; the first frequency of the candidate data is determined according to the candidate data and the initial log data set, and the second frequency of the candidate data is determined according to the candidate data and the initial log set; the product operation is performed on the first frequency and the second frequency to obtain the target frequency of the candidate data; and the data with a target frequency greater than or equal to the frequency threshold is filtered from the candidate data to obtain the reference data.

[0061] Optionally, in the embodiment, the protocol log can include log data, and the candidate data can include words in the log data, such as word groups or words, and the like. For example, the protocol log can include A year B month C day, the usage rate of the host storage pool exceeds the secondary alarm threshold, and the candidate data can include host, storage pool, usage rate, exceeds, and secondary alarm threshold.

[0062] In an exemplary embodiment, the first occurrence frequency of the candidate data can be determined according to the candidate data and the initial log data set, but not limited to, by the following manner: in the case that the initial log data set comprises N data, the candidate data comprises M data, the first occurrence frequency of the i th data in the M data is determined by performing the following steps, wherein N is a positive integer, M is a positive integer, and i is a positive integer less than or equal to M: in the case that the i th data appears K times in the N data, the i th occurrence frequency is determined as the value obtained by dividing K by S, wherein S is the number of times that the data with the highest occurrence frequency in the N data appears in the N data, and S is a positive integer; the second occurrence frequency of the candidate data is determined according to the candidate data and the initial log set, comprising: in the case that the candidate data comprises M data, the initial log set comprises Q protocol logs, and P protocol logs in the Q protocol logs comprise the i th data in the M data, the i th occurrence frequency of the i th data is determined by performing the following steps, wherein M is a positive integer, Q is a positive integer, P is a positive integer less than or equal to Q, and i is a positive integer less than or equal to M: performing sum operation on P and a reference value to obtain a target sum value; dividing Q by the target sum value to obtain a target quotient value; performing logarithm operation on the target quotient value to obtain the i th occurrence frequency.

[0063] Optionally, in the embodiment, the reference value can include, but is not limited to, a value set according to experience or a value selected through multiple experiments. As an optional example, the reference value can include, but is not limited to, 1.

[0064] Optionally, in the embodiment, the i th occurrence frequency of the i th data can be determined by, but not limited to, the following manner: performing product operation on the i th occurrence frequency and the i th occurrence frequency to obtain the i th occurrence frequency of the i th data.

[0065] In an exemplary embodiment, the index corresponding to the reference data can be generated in descending order of occurrence frequency, and the index and the reference data with the corresponding relationship can be recorded in descending order of occurrence frequency, but not limited to, by the following manner: setting the validity period of the compressed data set as a target time length, wherein the target time length is equal to the time difference between the target time and the generation time of the compressed data set, the generation time is earlier than the target time, and the target time is the latest time that allows the server and the terminal device to use the compressed data set to transmit the protocol message through the target transmission protocol; recording the generation time, the validity period and the version identifier of the compressed data set.

[0066] Optionally, in this embodiment, within the validity period of the compressed data set, the server and the terminal device are configured to allow the use of the compressed data set to transmit protocol messages through the target transmission protocol, and when the compressed data set exceeds the validity period, the server and the terminal device are configured to disallow the use of the compressed data set to transmit protocol messages through the target transmission protocol.

[0067] Optionally, in this embodiment, the version identifiers of the compressed data sets generated by the protocol logs of the target transmission protocol recorded by the server in different time periods can be but are not limited to different, for example, the version identifiers can be but are not limited to including version numbers.

[0068] FIG. 3 is a schematic diagram of an optional network architecture according to an embodiment of the present application. As shown in FIG. 3, the terminal and the server are both deployed with message compression devices, and the message compression devices are deployed with encoders and decoders. The message compression device of the terminal can be but is not limited to connected with the message compression device of the server through a WAN (Wide Area Network). The server is provided with a message log collector (equivalent to the log collector), which is used to acquire and analyze original HTTP request and response messages. The message log collector intercepts the request messages received by the server and the response messages returned by the server, and acquires the original content in natural language format.

[0069] The message content can be but is not limited to divided into two parts. The original first part of the content is the message line and the message header of the HTTP message, which can be but is not limited to compressed using the HPACK (Header Compression for HTTP / 2) algorithm in the HTTP / 2 protocol. Generally, the variable data in the message line and the message header accounts for a small proportion, and the content and format of the variable data change at a relatively low rate, and the variable data is not strongly associated with the business data in the message body, and the matching degree of the variable data with the compressed data set (for example, the Sdict dictionary) created by the embodiment of the present application is generally low. Therefore, the embodiment of the present application does not perform additional processing on the message header. The original second part of the content is the message body of the HTTP message, and the content is written into the cache database as a time sequence log. Unless otherwise specified, the subsequent message log refers to the time sequence log of the message body of the HTTP message.

[0070] The message storage device can be but is not limited to being arranged to store log original data collected by the collector. It should be noted that the embodiments of the present application do not limit the collection and storage manner of the message log. Currently, the common solution for message log related type log data storage in the industry is the ELK (Elasticsearch, Logstash (a tool for collecting, parsing and transmitting log data) and Kibana (a tool for visualizing and exploring data stored in Elasticsearch)) architecture. For the first transmission device, the only log that needs to be collected is the message log, and there is no need for aggregation search, near real-time search and the like. Therefore, for the first transmission device, the custom lightweight log collector can directly interact with the message parser, and the storage can be selected from HBase (Hadoop Database) or Elasticsearch and the like.

[0071] All log documents in a recent period of time are extracted from the massive time sequence logs as a corpus. The TF-IDF (Term Frequency-Inverse Document Frequency) algorithm can be but is not limited to being used to extract keywords (equivalent to candidate data) for each log, and the results are stored in a hash table, the key is the keyword, and the value is the TF-IDF value (the value obtained each time is accumulated). The final hash table key-value pair is sorted in descending order of the value, and a software dynamic index dictionary table Sdict (equivalent to a compressed data set) is obtained. FIG. 4 is a schematic diagram of an optional compressed data set according to an embodiment of the present application. As shown in FIG. 4, Index represents the index, and Name represents the name of the candidate data. The index can include but is not limited to 0 to 10. For example, index 0 corresponds to data 1, and index 1 corresponds to data 2. It should be noted that the range and quantity of the extracted logs are not fixed, and need to be based on the actual application scenario and log level. Considering many periodic application scenarios, it is recommended to take a date range of one day, one week, one month and the like.

[0072] After the compressed data set is generated, the software dynamic index dictionary table Sdict (equivalent to the compressed data set) can be set, but is not limited to, a validity period, which can be set to one day, one week, etc. since the dynamic index dictionary table Sdict is generated (equivalent to the generation time). The present embodiment does not limit the size of the validity period, but it should be noted that the larger the validity period, the slower the iteration speed of the dynamic index dictionary table Sdict, and the lower the adaptability of the old version to the latest communication data, thereby affecting the compression effect. In addition, a version identifier (for example, a version number) can be set for each dynamic index dictionary table Sdict, and the generation date, validity period, and version number of the dynamic index dictionary table Sdict are combined to be regarded as the signature of the dynamic index dictionary table Sdict.

[0073] In this way, the dynamic index dictionary is managed in terms of version and life cycle due to the periodic update mechanism of the dynamic index dictionary. The communication parties align the used compression dictionary version by specifying the message header key-value pair, and ensure the validity and high matching degree of the used dictionary by setting the validity period and version number of the dictionary, thereby ensuring the stability and security of the compression process.

[0074] In an exemplary embodiment, after the generation time, validity period, and version identifier of the compressed data set are recorded, the following can be performed, but is not limited to: in a case where it is detected that the compressed data set is not within the validity period, collecting, by a log collector, an updated protocol log of the target transmission protocol recorded by the server to obtain an updated log set, and parsing, by the log collector, each protocol log in the updated log set to obtain an updated log data set; screening, from the updated log data set, data with a frequency greater than or equal to a frequency threshold to obtain updated data; generating an updated index corresponding to the updated data, and recording the updated index and the updated data having a corresponding relationship in order from high to low according to the frequency, wherein the updated data set includes the updated index and the updated data having a corresponding relationship.

[0075] Optionally, in the present embodiment, after the generation time, validity period, and version identifier of the compressed data set are recorded, the above method further includes: in a case where it is detected that the compressed data set is within the validity period and reaches the set update period, collecting, by a log collector, an updated protocol log of the target transmission protocol recorded by the server to obtain an updated log set, and parsing, by the log collector, each protocol log in the updated log set to obtain an updated log data set; screening, from the updated log data set, data with a frequency greater than or equal to a frequency threshold to obtain updated data; generating an updated index corresponding to the updated data, and recording the updated index and the updated data having a corresponding relationship in order from high to low according to the frequency, wherein the updated data set includes the updated index and the updated data having a corresponding relationship.

[0076] Optionally, in the embodiment, the update data can be, but is not limited to, completely different from the reference data, or partially different, etc., and the index corresponding to the update data can be, but is not limited to, generated in the order from high to low according to the occurrence frequency.

[0077] In one exemplary embodiment, the first transmission device can be deployed in the server, the first decoder can be deployed in the first transmission device, the first decoder is connected with the terminal device, and the initial message to be transmitted to the terminal device through the target transmission protocol is obtained in the following manner: receiving the compression request message initiated by the terminal device; extracting the initial version identifier carried in the compression request message by the first decoder, and searching for the reference index in the compression request message in the compression data set corresponding to the initial version identifier by the first decoder; in the case where the reference index in the compression request message is found in the compression data set by the first decoder, replacing the reference index with the corresponding to-be-compressed data in the compression data set by the first decoder to obtain the initial request message; and obtaining the initial message in response to the initial request message.

[0078] Optionally, in the embodiment, in the case where the compression request message initiated by the terminal device uses the compression data set, the first decoder can carry the initial version identifier of the compression data set used for compressing the request message in the message header of the request message.

[0079] Optionally, in the embodiment, in the case where the compression request message initiated by the terminal device is received, the above method further includes: extracting the initial version identifier carried in the compression request message by the first decoder, and in the case where the initial version identifier is extracted from the compression request message by the first decoder, decompressing the received compression request message by the first decoder using the compression data set corresponding to the initial version identifier to obtain the initial request message before compression.

[0080] In the technical solution provided in the above step S204, the data in the initial message can be searched from the compression data set in the following manner: searching the data in the initial message from the reference data recorded in the compression data set, or comparing the data in the initial message with the reference data.

[0081] In an exemplary embodiment, the data in the initial message can be searched from the compressed data set in the following manner, but not limited thereto: in the case that the initial message includes R data, the compressed data set includes T indexes and T data with corresponding relationship, and R is a positive integer, T is a positive integer, and s is a positive integer less than or equal to R, the s-th data in the R data is searched from the compressed data set by performing the following steps: the s-th data set is extracted from the R data, wherein the s-th data set includes the s-th data and L data adjacent to the s-th data, and L is a positive integer; the s-th data set is searched from the T data; in the case that each data in the s-th data set is searched from the T data, the s-th data set is marked as index data, and the search for the s+L+1-th data in the R data from the T data is continued; in the case that each data in the s-th data set is not searched from the T data, the s-th data set is marked as non-index data, and the search for the s+L+1-th data in the R data from the T data is continued.

[0082] Optionally, in the embodiment, the s-th data set can include, but is not limited to, L data starting from the s-th data, or the s-th data and the s-L-th data, or the s-th data and the s+L-th data, or the s-a-th data, the s-th data and the s+(L-a)-th data, and the like.

[0083] For example, the first character of the message content of the initial message can be compared with the index word in the index dictionary Sdict (equivalent to the compressed data set), but not limited thereto. If the string of N adjacent characters starting from the character can match the corresponding index word, the string of N characters is marked as an index word, and the next matching starts from the N+1-th character. If the string of N adjacent characters starting from the character cannot match the index word, the next matching starts from the next character adjacent to the character. If the unmatched characters are adjacent, they are combined as a string. In this way, the original content is sequentially marked as a non-index word string and an index word string, which are processed according to the first processing method and the second processing method, respectively.

[0084] As an optional example, the matching can be performed by the forward maximum matching method (or other algorithms, which are not limited in the present application), and from the efficiency of the algorithm, the time complexity of the forward maximum matching method in the present example is ○(n), and the space complexity is ○(0), which has very high compression and decompression efficiency.

[0085] In the technical solution provided in step S206, in the case that the candidate data in the initial message is not found from the compressed data set, the candidate data in the initial message can be kept, but is not limited thereto. It can be understood that the compressed message can include the target index and the candidate data, but is not limited thereto.

[0086] Optionally, in the embodiment, the initial message can include A year B month C day, the usage of the host storage pool exceeds the secondary alarm threshold, the reference data can include host, storage pool, usage, exceeds, and secondary alarm threshold, and the indexes corresponding to the host, storage pool, usage, exceeds, and secondary alarm threshold are 01, 02, 03, 04, and 05, respectively. In this case, the compressed message can include A year B month C day, 030405 of 0102. In this way, the data frequently appearing in the multiple protocol logs is replaced by the corresponding index, the initial message is compressed, and the amount of data transmitted between the terminal device and the server is greatly reduced.

[0087] As an optional example, the sender and the receiver are both provided with a message compression device (equivalent to the first transmission device and the second transmission device) responsible for compressing and decompressing the message body content. The server and the terminal device can be the sender and the receiver, but are not limited thereto.

[0088] When the sender sends data, the message body of the request message is compressed using the system dictionary (equivalent to the compressed data set). For example, a key-value pair Szip={index dictionary version number} is added in the message header, and the client and the server determine whether the received communication data is Szip compressed according to this attribute. If the received communication data is Szip compressed, corresponding decompression needs to be performed according to the compression logic, otherwise no processing is performed.

[0089] In some embodiments, the method of Szip compression of the message body is: based on the index dictionary table Sdict, a forward maximum matching method can be used to scan the message body content, a first processing method is used for the unmatched string, and a second processing method is used for the matched keyword string, and finally a compressed binary byte array is obtained.

[0090] In the technical solution provided in step S208, the compressed message can carry the version identifier of the compressed data set, but is not limited thereto. It can be understood that the terminal device can decompress the compressed message by using the compressed data set corresponding to the version identifier in the case of receiving the compressed message. In this way, the consistency of the compressed data set used for data transmission between the terminal device and the server through the target transmission protocol is ensured.

[0091] In an exemplary embodiment, the first transmission device can be deployed in the server, the first encoder can be deployed in the first transmission device, the first encoder can be connected to the terminal device, and the compressed message can be transmitted to the terminal device by the following manner: the first encoder performs a corresponding first encoding operation on the target index in the compressed message to obtain a first compressed and encoded message, and the first encoder performs a corresponding second encoding operation on other data in the compressed message to obtain a second compressed and encoded message, wherein the other data includes data in the compressed message except the target data, the first compressed and encoded message includes data obtained by encoding the target index or data obtained by encoding the number of bytes occupied by the target index, and the second compressed and encoded message includes data obtained by encoding the data amount of the other data and data obtained by encoding the other data, or the second compressed and encoded message includes data obtained by encoding the number of bytes occupied by the data amount of the other data and data obtained by encoding the other data; the initial version identifier of the compressed data set is carried in the target compressed message, and the target compressed message is transmitted to the terminal device, wherein the target compressed message includes the first compressed and encoded message and the second compressed and encoded message.

[0092] Optionally, in the embodiment, the index data and the non-index data can have corresponding encoding operations, the encoding operations can be performed on the index data and the non-index data, and the initial version identifier can be carried in at least one of the first compressed message and the second compressed message.

[0093] For example, the non-index word string (equivalent to the non-index data) can be processed by the first processing method (equivalent to the second encoding operation), and the encoded byte array includes two parts. The first part can include two cases: starting with 00, followed by 6 bits of the length value of the byte array of the word, occupying 1 byte; starting with 01, followed by 6 bits of the number of bytes occupied by the length value, occupying N bytes. The second part is the original byte array of the word, and the array length is indicated according to the length value in the first part. FIG. 5 is a schematic diagram of an optional compressed byte code according to an embodiment of the present application. As shown in FIG. 5, in the case where the length of the String Data is 6, starting with 00, followed by 6 bits (for example, 000110) of the length value 6 of the byte array of the word, or in the case where the length of the String Data is 64, starting with 01, followed by the length value 64 of the byte array of the word.

[0094] The index word string (equivalent to index data) can be processed by the second processing method (equivalent to the first encoding operation) but not limited thereto, and the encoded byte array represents the index value of the index word in the Sdict dictionary table. There are two cases: starting with 10, the last 6 bits are the index value of the index word in the Sdict dictionary table, occupying 1 byte; starting with 11, the last 14 bits are the number of bytes occupied by the index value, occupying 2 bytes (the index dictionary can support 16384 index words but not limited thereto).

[0095] It should be noted that in the embodiments of the present application, the number of index words of the index dictionary Sdict can be limited to not more than 16384. The larger the number of index words, the higher the compression ratio, but the corresponding retrieval efficiency of the index dictionary decreases, resulting in a decrease in compression efficiency. The index words in the index dictionary Sdict are sorted in descending order of scores. For index values of 64 and later, the index value occupies 2 bytes, and the compression ratio is reduced by half compared to index values before 64. In actual applications, different compression levels can also be designed by limiting the number of words in the index dictionary. The more index words are used, the higher the compression ratio and the slightly increased compression time, and vice versa.

[0096] In an exemplary embodiment, before obtaining the initial message to be transmitted to the terminal device through the target transmission protocol, the following can be performed but not limited thereto: receiving a target data request initiated by the terminal device, wherein the target data request is used to request to obtain a compressed data set; in response to the target data request, extracting the compressed data set, and transmitting the compressed data set, the generation time of the compressed data set, the validity period of the compressed data set, and the initial version identifier of the compressed data set to the terminal device; or receiving an update data request initiated by the terminal device, wherein the update data request is used to request to obtain an update data set; in response to the update data request, extracting the update data set, and transmitting the update data set, the generation time of the update data set, the validity period of the update data set, and the update version identifier of the update data set to the terminal device.

[0097] Optionally, in the present embodiment, the terminal device can not store the compressed data set. In this case, the terminal device can initiate a target data request to the server, and the server can transmit the compressed data set and the generation time, validity period, and initial version identifier of the compressed data set to the terminal device in response to the target data request.

[0098] Optionally, in the present embodiment, the compressed data set stored in the terminal device can have expired, in which case the terminal device can but is not limited to initiate an update data request to the server, and the server can but is not limited to respond to the update data request by transmitting an updated data set and the generation time of the updated data set, the validity period of the updated data set and the version identification of the updated data set to the terminal device.

[0099] As an optional example, the interaction mechanism between the client and the server of Sdict can be but is not limited to designed to trigger a request by default on the software Index page, or can be designed as a manual option for the client to select to trigger a request.

[0100] When the server receives the Sdict acquisition request, the latest dynamic index dictionary table is transmitted to the client, and the transmitted data herein includes the dynamic encoding dictionary table (equivalent to the compressed data set) and the signature thereof.

[0101] The server will periodically update the index dictionary table (equivalent to the compressed data set), and the update and use of the index dictionary table by the client and the server are based on the following principles:

[0102] 1) If there is no index dictionary (equivalent to the compressed data set), the client will request the index dictionary from the server (the request will be triggered only once within a certain time period), and the server will attempt to generate the index dictionary. The client detects the validity period of the held index dictionary, and if it is about to expire, requests the server to update the dictionary, and if the latest version of the dictionary is successfully acquired, the new version of the dictionary is used for the next request;

[0103] 2) The version of the encoded index dictionary in the response message of the server must be consistent with the requested encoding version of the client;

[0104] 3) The expired dictionary is not allowed to be used.

[0105] It should be noted that for the version switching of the dictionary, the adjacent versions of the dictionary are allowed to exist at the same time, the new version of the dictionary is generated a period of time before the old version of the dictionary is invalid, and when the new and old dictionaries exist and are valid at the same time, the server determines the version of the dictionary used for the communication according to the version number (equivalent to the initial version identification) transmitted in the message header.

[0106] In the embodiment, another protocol message transmission method is provided. A terminal device stores a compressed data set corresponding to a target transmission protocol. The compressed data set records indexes and reference data having a corresponding relationship. The reference data is data with a frequency greater than or equal to a frequency threshold, which is filtered from a protocol log of the target transmission protocol recorded by a server. The method is applied to the terminal device. FIG. 6 is a flowchart of the protocol message transmission method according to the embodiment of the present application. As shown in FIG. 6, the flowchart includes the following steps.

[0107] In step S602, a compressed message transmitted by a server is received, and an initial version identifier carried in the compressed message is extracted.

[0108] In step S604, data in the compressed message is searched from a compressed data set corresponding to the initial version identifier.

[0109] In step S606, in a case where target compressed data in the compressed message is searched from the compressed data set, the target compressed data in the compressed message is replaced with target data corresponding to the target compressed data in the compressed data set, to obtain a target message.

[0110] Through the above steps, in a case where the terminal device receives the compressed message transmitted by the server, the terminal device can but is not limited to perform a decompression operation on the compressed message by using the compressed data set corresponding to the initial version identifier, to obtain the target message before compression. In this way, transmission between the terminal device and the server is performed on the compressed protocol message, thereby reducing the data amount of the transmitted protocol message. Therefore, the problem of low transmission efficiency of the protocol message can be solved, and the transmission efficiency of the protocol message is improved.

[0111] In the technical solution provided in step S302, the initial version identifier can be but is not limited to carried in the message header of the compressed message. The terminal device is deployed with a second transmission device. The second transmission device is deployed with a second decoder. The second decoder is connected to the server. The initial version identifier carried in the compressed message can be but is not limited to extracted by the second decoder from the compressed message.

[0112] In an exemplary embodiment, before compressing the protocol message transmitted by the server, the terminal device can but not limited to detect whether the compressed data set is stored in the terminal device, and if the compressed data set is not stored in the terminal device, initiate a target data request to the server, wherein the target data request is used to request the compressed data set, and receive the compressed data set, the generation time of the compressed data set, the validity period of the compressed data set and the initial version identifier of the compressed data set returned by the server in response to the target data request; if the compressed data set is stored in the terminal device, detect whether the compressed data set is within the validity period, and if the compressed data set is not within the validity period, initiate an update data request to the server, wherein the update data request is used to request an update data set, and receive the updated compressed data set, the generation time of the update data set, the validity period of the update data set and the update version identifier of the update data set returned by the server in response to the update data request.

[0113] Optionally, in the embodiment, if the compressed data set is within the validity period but will expire soon, the terminal device initiates an update data request to the server, and the terminal device and the server are configured to use the update data set to compress the protocol message to be transmitted by the target transmission protocol in the next transmission.

[0114] In an exemplary embodiment, the terminal device can but not limited to detect whether the compressed data set is within the validity period by detecting whether the target time length difference between the current time and the target time is less than or equal to the difference threshold, wherein the current time is the time when the terminal device detects whether the compressed data set is within the validity period, and the current time is earlier than the target time; and if the target time length difference is less than or equal to the difference threshold, it is determined that the compressed data set is not within the validity period.

[0115] Optionally, in the embodiment, the terminal device can but not limited to detect whether the compressed data set is within the validity period by detecting whether the current time is later than the target time, and if the current time is later than the target time, it is determined that the compressed data set is not within the validity period.

[0116] In the technical solution provided in step S304, the terminal device can but not limited to store a plurality of compressed data sets corresponding to a plurality of version identifiers, for example, compressed data sets corresponding to different transmission protocols, or compressed data sets of different versions corresponding to the same transmission protocol.

[0117] In an exemplary embodiment, the second transmission device can be deployed in the terminal device, the second decoder can be deployed in the second transmission device, the second decoder can be connected to the server, and the data in the compressed message can be searched from the compressed data set corresponding to the initial version identifier by: performing a first decoding operation corresponding to the first encoding operation on the first compressed and encoded message by the second decoder to obtain a target index, and performing a second decoding operation corresponding to the second encoding operation on the second compressed and encoded message by the second decoder to obtain other data in the initial message except the target data; and searching the target data corresponding to the target index from the compressed data set corresponding to the initial version identifier, wherein the target message includes the target data and the other data.

[0118] Optionally, in the embodiment, the first compressed and encoded message can include data obtained after performing a corresponding encoding operation on index data, the second compressed and encoded message can include data obtained after performing a corresponding encoding operation on non-index data, the target index can be obtained by performing a corresponding decoding operation on the first compressed and encoded message by the second decoder, and the other data can be obtained by performing a corresponding decoding operation on the second compressed and encoded message by the second decoder.

[0119] Optionally, in the embodiment, the target data corresponding to the target index can be searched from the compressed data set corresponding to the initial version identifier by: searching the target data corresponding to the target index from reference data included in the compressed data set, or comparing the target index with indexes included in the compressed data set.

[0120] In an exemplary embodiment, the target data corresponding to the target index can be searched from the compressed data set corresponding to the initial version identifier by: in a case where the target index includes W indexes, the compressed data set includes T indexes and T data having a corresponding relationship, and the target data includes K data including the tth data, W is a positive integer, T is a positive integer, and t is a positive integer or equal to T, the tth data can be searched from the T indexes and the T data having the corresponding relationship by: searching the tth index from the T indexes; in a case where the tth index is searched from the T indexes, determining the data corresponding to the tth index in the T indexes and the T data having the corresponding relationship as the tth data.

[0121] Optionally, in the embodiment, in a case where the tth index is not searched from the T indexes, it is determined that the tth data is not searched, and the tth index is searched from the T indexes for a target number of times, and in a case where the tth data is still not searched, the compressed data set is reacquired from the server.

[0122] In an exemplary embodiment, the second transmission device can be deployed in the terminal device, the second encoder can be deployed in the second transmission device, the second encoder is connected with the server, and before receiving the compressed message transmitted by the server, the following operations can be performed: generating an initial request message, wherein the initial request message is used to request to obtain an initial message; searching for data in the initial request message in the compressed data set by the second encoder; in the case that the to-be-compressed data in the initial request message is found in the compressed data set by the second encoder, replacing the to-be-compressed data in the initial request message with the corresponding reference index in the compressed data set by the second encoder to obtain a compressed request message; and initiating the compressed request message to the server, wherein the compressed request message carries an initial version identifier of the compressed data set, the server is configured to obtain the initial message in response to the received initial request message, and transmit the compressed message obtained by replacing the target data in the initial message with the corresponding target index in the compressed data set to the terminal device.

[0123] Optionally, in the embodiment, the sender of the data can include the terminal device or the server, and in the case that the terminal device stores the compressed data set, the terminal device can compress the initial request message to be initiated to the server by using the compressed data set, so as to reduce the data amount of the initial request message initiated by the terminal device to the server and improve the communication efficiency between the terminal device and the server.

[0124] In the technical solution provided in the step S306, in the case that the target compressed data in the compressed message is not found in the compressed data set, the reference times can be repeated to search for the target compressed data in the compressed data set, and in the case that the target compressed data is still not found, it can be indicated that the compressed data set stored by the terminal device is inconsistent with the compressed data set used when the server transmits the message, and in this case, the terminal device can reacquire the compressed data set from the server.

[0125] In order to better understand the transmission process of the protocol message in the embodiment of the application, the transmission process of the protocol message in the embodiment of the application will be explained and described below in combination with optional embodiments, which can be applicable to the embodiment of the application.

[0126] The sender transmits the compressed byte array to the receiver through the network, the receiver decompresses according to the same logic to obtain the original message body content, and completes a complete communication process. FIG. 7 is a transmission schematic diagram of a protocol message according to an optional embodiment of the application, as shown in FIG. 7, a complete request and response process can include the following steps:

[0127] Step S701: the client sends service request data.

[0128] Step S702: the client compression device judges whether it is compressible; if it is compressible, step S703 is executed; if it is not compressible, step S704 is executed.

[0129] Step S703: the message body content is compressed using a dynamic index dictionary, and a message header compression flag is set, and then step S704 is executed.

[0130] Step S704: the content is sent through a network.

[0131] Step S705: the server-side compression device judges whether it needs to be decompressed; if it needs to be decompressed, step S706 is executed; if it does not need to be decompressed, step S707 is executed.

[0132] Step S706: the message body content is decompressed using a dynamic index dictionary, and the original message is obtained.

[0133] For example, in an application scenario of a data center server status monitoring system, the server status monitoring system constantly obtains the running status logs and error information logs of all devices in the data center server cluster, and can obtain a large amount of logs every day and report them to a data platform. Through the embodiment of the application, the data platform collects request logs and extracts an index dictionary table. FIG. 8 is a schematic diagram of an optional index dictionary table according to an embodiment of the application. As shown in FIG. 8, Index represents an index, and Name represents the name of a candidate data. The index dictionary table records indexes 0 to 13 and corresponding data, for example, indexes 0 to 13 correspond to servers, disks, usage rates, alarms, hard disks, memories, servers, hosts, storage pools, storages, coarse waists, main, thresholds, and exceedances, respectively.

[0134] In this case, for a certain server status log, for example, “host storage pool usage rate exceeds secondary alarm threshold”, the compression rate of the existing compression algorithm in the related art is far less than 50%. Using the compression algorithm to which the embodiment of the application belongs, “host”, “storage pool”, “usage rate”, “exceeds”, “secondary”, “alarm”, and “threshold” all belong to high-frequency words and appear in the index dictionary table, can be replaced with index values for encoding, and the compression rate can exceed 80%, and the length of the text content is greatly shortened.

[0135] Through the embodiments of the present application, in view of the low compression efficiency of HTTP protocol message body, the embodiments of the present application propose a scheme of efficient compression according to mass message log analysis and extraction of index dictionary combined with a certain compression algorithm. The index dictionary proposed in the embodiments of the present application can fully discover the similarity between different HTTP connection messages in a period of time, can fully compress the similar message body, and has great improvement in compression ratio and compression efficiency compared with the existing compression algorithm, thereby effectively reducing the length of the HTTP message body and improving the network transmission efficiency.

[0136] Step S707: performing service processing and sending response data, and recording message log.

[0137] Step S708: the server end judges whether compression is needed, in the case of judging that compression is needed, step S709 is executed, and in the case of judging that compression is not needed, step S710 is executed.

[0138] Step S709: using a dynamic index dictionary to compress the message body content and setting a message header compression flag.

[0139] Step S710: sending the content through the network.

[0140] Step S711: the client compression device judges whether decompression is needed, in the case of judging that decompression is needed, step S712 is executed, and in the case of judging that decompression is not needed, step S713 is executed.

[0141] Step S712: using a dynamic index dictionary to decompress the message body content to obtain the original message.

[0142] Step S713: the client uses the response data to perform service processing, and the communication ends.

[0143] Through the embodiments of the present application, in the related art, the data compression in the transmission protocol (for example, HTTP communication protocol) is stateless compression, the compression algorithm is for single communication data content, and the similarity of system dimension data cannot be utilized. When the single communication data content string is very scattered and has very low self-repetition, the compression efficiency is very poor. The present application proposes a scheme of constructing a dynamic index dictionary according to HTTP message statistical analysis, which can fully discover the similarity between multiple communication data, extract hot string units to construct a system index dictionary, and the communication data of the client and the server can be compressed and decompressed by using the dictionary according to a certain compression algorithm, so as to realize higher compression ratio and compression efficiency, improve network performance, reduce bandwidth consumption, and improve response speed.

[0144] Those skilled in the art can clearly understand, through the description of the above embodiments, that the method according to the above embodiments can be realized by means of software on a general hardware platform as necessary, and of course can also be realized by hardware, but in many cases the former is a better embodiment. Based on such understanding, the technical solutions of the present application or the parts that make contributions to the related art can be embodied in the form of a software product, which is stored in a storage medium (such as a ROM / RAM, a magnetic disk, or an optical disk) and includes a number of instructions for causing an end device (which can be a mobile phone, a computer, a server, or a network device) to perform the methods of the various embodiments of the present application.

[0145] In the present embodiment, a protocol message transmission device is also provided, which is used to implement the above embodiments and optional implementation manners, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware or a combination of software and hardware is also possible and contemplated.

[0146] FIG. 9 is a structural block diagram of an optional protocol message transmission device according to an embodiment of the present application. As shown in FIG. 9, the device includes a compressed data set corresponding to a target transmission protocol stored in a server, the compressed data set records indexes and reference data having a corresponding relationship, and the reference data is data with a frequency greater than or equal to a frequency threshold value filtered from a protocol log of the target transmission protocol recorded by the server. The device is applied to the server, and includes: an acquisition module 902 configured to acquire an initial message to be transmitted to a terminal device through the target transmission protocol; a first searching module 904 configured to search for data in the initial message from the compressed data set; a first replacing module 906 configured to replace target data in the initial message with a target index corresponding in the compressed data set in a case where the target data in the initial message is found from the compressed data set, to obtain a compressed message; and a transmission module 908 configured to transmit the compressed message to the terminal device.

[0147] Through the above device, the server creates a corresponding compressed data set for different transmission protocols, and the compressed data set records data with a higher frequency in the protocol log of the transmission protocol. In a case where the server transmits a protocol message to the terminal device through the transmission protocol, the server replaces data in the protocol message with data in the compressed data set. In this way, data with a higher frequency in the protocol message transmitted between the server and the terminal device through the transmission protocol is replaced with a corresponding index, thereby reducing the amount of data of the protocol message transmitted between the server and the terminal device, and thus the problem of low transmission efficiency of the protocol message can be solved, and the effect of improving the transmission efficiency of the protocol message is achieved.

[0148] In an exemplary embodiment, the apparatus further comprises: a first collection and analysis module, configured to be deployed with a log collector in a server, before obtaining an initial message to be transmitted to a terminal device through a target transmission protocol, collecting protocol logs of the target transmission protocol recorded by the server through the log collector to obtain an initial log set, and analyzing each protocol log in the initial log set through the log collector to obtain an initial log data set; a first screening module, configured to screen data with a frequency greater than or equal to a frequency threshold from the initial log data set to obtain reference data; and a first generation record module, configured to generate indexes corresponding to the reference data in a descending order of frequency, and record the indexes and the reference data with a corresponding relationship in a descending order of frequency.

[0149] In an exemplary embodiment, the first screening module comprises: an extraction unit, configured to extract candidate data carried in log data corresponding to each protocol log in the initial log data set, wherein the log data corresponding to at least two protocol logs in the initial log data set each includes the candidate data; a first determination unit, configured to determine a first frequency of the candidate data according to the candidate data and the initial log data set, and determine a second frequency of the candidate data according to the candidate data and the initial log set; a product unit, configured to perform a product operation on the first frequency and the second frequency to obtain a target frequency of the candidate data; and a screening unit, configured to screen data with a target frequency greater than or equal to the frequency threshold from the candidate data to obtain the reference data.

[0150] In an exemplary embodiment, the first determining unit is configured to determine the ith1 occurrence frequency of the ith data in the M data by performing the following steps, in the case that the initial log data set comprises N data and the candidate data comprises M data, wherein N is a positive integer, M is a positive integer, and i is a positive integer less than or equal to M: in the case that the ith data occurs K times in the N data, the ith1 occurrence frequency is determined as a value obtained by dividing K by S, wherein S is the number of times that the data with the highest occurrence frequency in the N data occurs in the N data, and S is a positive integer; and the second occurrence frequency of the candidate data is determined according to the candidate data and the initial log set, comprising: in the case that the candidate data comprises M data, the initial log set comprises Q protocol logs, and P protocol logs in the Q protocol logs comprise the ith data in the M data, wherein M is a positive integer, Q is a positive integer, P is a positive integer less than or equal to Q, and i is a positive integer less than or equal to M, the ith2 occurrence frequency of the ith data is determined by performing the following steps: performing a sum operation on P and a reference value to obtain a target sum value; dividing Q by the target sum value to obtain a target quotient value; and performing a logarithm operation on the target quotient value to obtain the ith2 occurrence frequency.

[0151] In an exemplary embodiment, the apparatus further comprises a setting module configured to set the validity period of the compressed data set to a target time length after generating the index corresponding to the reference data in the order of the occurrence frequency from high to low and recording the index and the reference data having the corresponding relationship in the order of the occurrence frequency from high to low, wherein the target time length is equal to a time difference between the target time and the generation time of the compressed data set, the generation time is earlier than the target time, and the target time is the latest time allowing the server and the terminal device to use the compressed data set to transmit the protocol message through the target transmission protocol; and the recording module is configured to record the generation time, the validity period, and the version identifier of the compressed data set.

[0152] In an exemplary embodiment, the apparatus further comprises a second collection and analysis module configured to, after recording the generation time, the validity period, and the version identifier of the compressed data set, collect, in the case that it is detected that the compressed data set is not within the validity period, an updated protocol log of the target transmission protocol recorded by the server through the log collector to obtain an updated log set, and analyze each protocol log in the updated log set through the log collector to obtain an updated log data set; a second screening module configured to screen, from the updated log data set, data with an occurrence frequency greater than or equal to a frequency threshold to obtain updated data; and a second generation and recording module configured to generate an updated index corresponding to the updated data, and record the updated index and the updated data having the corresponding relationship in the order of the occurrence frequency from high to low, wherein the updated data set comprises the updated index and the updated data having the corresponding relationship.

[0153] In an exemplary embodiment, the obtaining module comprises: a receiving unit configured to receive a compression request message initiated by a terminal device; a first searching unit configured to extract an initial version identifier carried in the compression request message by using a first decoder, and search for a reference index in the compression request message in the compression data set corresponding to the initial version identifier by using the first decoder; a replacing unit configured to replace the reference index with the corresponding to-be-compressed data in the compression data set by using the first decoder in the case that the reference index in the compression request message is searched in the compression data set by using the first decoder, to obtain an initial request message; and a responding unit configured to obtain an initial message in response to the initial request message.

[0154] In an exemplary embodiment, the second searching unit is configured to search for the s-th data in the R data from the compression data set by performing the following steps in the case that the initial message comprises R data and the compression data set comprises T indexes and T data having a corresponding relationship, wherein R is a positive integer, T is a positive integer, and s is a positive integer less than or equal to R: extracting an s-th data set from the R data, wherein the s-th data set comprises the s-th data and L data adjacent to the s-th data, and L is a positive integer; searching for the s-th data set from the T data; in the case that each data in the s-th data set is searched from the T data, marking the s-th data set as index data, and continuing to search for the s+L+1-th data in the R data from the T data; in the case that each data in the s-th data set is not searched from the T data, marking the s-th data set as non-index data, and continuing to search for the s+L+1-th data in the R data from the T data.

[0155] In an exemplary embodiment, the transmission module comprises: a first executing unit configured to perform a corresponding first encoding operation on a target index in a compression message by using a first encoder to obtain a first compression encoding message, and perform a corresponding second encoding operation on other data in the compression message by using the first encoder to obtain a second compression encoding message, wherein the other data comprises data other than the target data in the compression message, the first compression encoding message comprises data obtained by encoding the target index or data obtained by encoding the number of bytes occupied by the target index, and the second compression encoding message comprises data obtained by encoding the data amount of the other data and data obtained by encoding the other data, or the second compression encoding message comprises data obtained by encoding the number of bytes occupied by the data amount of the other data and data obtained by encoding the other data; and a transmission unit configured to carry an initial version identifier of the compression data set in a target compression message, and transmit the target compression message to the terminal device, wherein the target compression message comprises the first compression encoding message and the second compression encoding message.

[0156] In an exemplary embodiment, the apparatus further comprises: a first receiving module configured to receive a target data request initiated by the terminal device before obtaining the initial message to be transmitted to the terminal device by the target transmission protocol, wherein the target data request is used to request to obtain the compressed data set; in response to the target data request, the compressed data set is extracted, and the compressed data set, the generation time of the compressed data set, the validity period of the compressed data set, and the initial version identifier of the compressed data set are transmitted to the terminal device; or a second receiving module configured to receive an update data request initiated by the terminal device, wherein the update data request is used to request to obtain the update data set; in response to the update data request, the update data set is extracted, and the update data set, the generation time of the update data set, the validity period of the update data set, and the update version identifier of the update data set are transmitted to the terminal device.

[0157] FIG. 10 is a structural block diagram of another optional protocol message transmission apparatus according to an embodiment of the present application. As shown in FIG. 10, the apparatus comprises a compressed data set corresponding to the target transmission protocol stored in the terminal device, and the compressed data set records the index and the reference data having a corresponding relationship, wherein the reference data is the data with a frequency greater than or equal to the frequency threshold value filtered from the protocol log of the target transmission protocol recorded by the server. The apparatus is applied to the terminal device, and the apparatus comprises: a third receiving module 1002 configured to receive the compressed message transmitted by the server, and extract the initial version identifier carried in the compressed message; a second searching module 1004 configured to search for the data in the compressed message from the compressed data set corresponding to the initial version identifier; and a second replacing module 1006 configured to replace the target compressed data in the compressed message with the corresponding target data in the compressed data set in the case that the target compressed data in the compressed message is searched from the compressed data set, to obtain the target message.

[0158] Through the above apparatus, in the case that the terminal device receives the compressed message sent by the server, the initial version identifier corresponding to the compressed data set can be used to perform the decompression operation on the compressed message to obtain the target message before compression, so that the transmission between the terminal device and the server is the compressed protocol message, thereby reducing the data amount of the transmitted protocol message, and thus the problem of low transmission efficiency of the protocol message can be solved, and the transmission efficiency of the protocol message is improved.

[0159] In an exemplary embodiment, the apparatus further comprises: a first detection module configured to detect whether the terminal device stores the compressed data set before receiving the compressed packet transmitted by the server; a first initiation module configured to initiate a target data request to the server in a case where it is detected that the terminal device does not store the compressed data set, wherein the target data request is used to request the compressed data set, and the compressed data set, the generation time of the compressed data set, the validity period of the compressed data set and the initial version identifier of the compressed data set returned by the server in response to the target data request; a second detection module configured to detect whether the compressed data set is within the validity period in a case where it is detected that the terminal device stores the compressed data set, and initiate an update data request to the server in a case where it is detected that the compressed data set is not within the validity period, wherein the update data request is used to request an update data set, and the updated compressed data set, the generation time of the update data set, the validity period of the update data set and the update version identifier of the update data set returned by the server in response to the update data request.

[0160] In an exemplary embodiment, the second detection module comprises: a detection unit configured to detect whether a target time length difference between a current time and a target time is less than or equal to a difference threshold, wherein the current time is the time when the detection of whether the compressed data set is within the validity period is performed, and the current time is earlier than the target time; and a second determination unit configured to determine that the compressed data set is not within the validity period in a case where it is detected that the target time length difference is less than or equal to the difference threshold.

[0161] In an exemplary embodiment, the second detection module comprises: a detection unit configured to detect whether a target time length difference between a current time and a target time is less than or equal to a difference threshold, wherein the current time is the time when the detection of whether the compressed data set is within the validity period is performed, and the current time is earlier than the target time; and a second determination unit configured to determine that the compressed data set is not within the validity period in a case where it is detected that the target time length difference is less than or equal to the difference threshold.

[0162] In an exemplary embodiment, the third searching unit is configured to: in a case where the target index comprises W indexes, the compressed data set comprises T indexes and T data having a corresponding relationship, and the target data comprises K data including the tth data, where W is a positive integer, T is a positive integer, and t is a positive integer equal to T, the tth data is searched from the T indexes and the T data having the corresponding relationship by performing the following steps: searching the tth index from the T indexes; and in a case where the tth index is searched from the T indexes, determining the data corresponding to the tth index from the T indexes and the T data having the corresponding relationship as the tth data.

[0163] In an exemplary embodiment, the apparatus further comprises: a generating module configured to deploy a second transmission device in the terminal device, deploy a second encoder in the second transmission device, and connect the second encoder with the server, and generate an initial request packet before receiving the compressed packet transmitted by the server, where the initial request packet is used to request to obtain an initial packet; a third searching module configured to search the data in the initial request packet from the compressed data set by using the second encoder; a third replacing module configured to replace the to-be-compressed data in the initial request packet with the corresponding reference index in the compressed data set by using the second encoder to obtain a compressed request packet in a case where the to-be-compressed data in the initial request packet is searched from the compressed data set by using the second encoder; and a second initiating module configured to initiate the compressed request packet to the server, where the compressed request packet carries an initial version identifier of the compressed data set, the server is configured to obtain the initial packet in response to the received initial request packet, and transmit the compressed packet obtained by replacing the target data in the initial packet with the corresponding target index in the compressed data set to the terminal device.

[0164] It should be noted that the above modules can be implemented by software or hardware, and for the latter, the following implementation manners can be used, but are not limited thereto: the above modules are located in the same processor; or the above modules are located in different processors in any combination.

[0165] According to another embodiment of the present application, a server system is further provided, which comprises a server and a terminal device connected with each other, and the server and the terminal device are configured to execute the steps in any of the above method embodiments.

[0166] Embodiments of the present application further provide a non-volatile computer readable storage medium, which stores a computer program, and the computer program is configured to execute the steps in any of the above method embodiments when running.

[0167] In an example embodiment, the non-volatile computer readable storage medium described above can include, but is not limited to, a U disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and various media that can store computer programs.

[0168] Embodiments of the present application also provide an electronic device including a memory and a processor, the memory storing a computer program, and the processor being configured to execute the computer program to perform the steps in any of the method embodiments described above.

[0169] In an example embodiment, the electronic device described above can further include a transmission device connected to the processor and an input / output device connected to the processor.

[0170] Embodiments of the present application also provide a computer program product including a computer program, the computer program being executed by a processor to implement the steps in any of the method embodiments described above.

[0171] Embodiments of the present application also provide another computer program product including a non-volatile computer readable storage medium, the non-volatile computer readable storage medium storing a computer program, the computer program being executed by a processor to implement the steps in any of the method embodiments described above.

[0172] Embodiments of the present application also provide a computer program including computer instructions stored in a computer readable storage medium; a processor of a computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions to make the computer device perform the steps in any of the method embodiments described above.

[0173] The specific examples in the present embodiment can refer to the examples described in the above embodiments and example embodiments, which will not be described herein again.

[0174] It is apparent that those skilled in the art can modify and / or adapt the above-described modules or steps of the present application, which can be implemented by general computing devices, and can be centralized on a single computing device or distributed on a network composed of multiple computing devices, and can be implemented by program codes executable by computing devices, so that they can be stored in storage devices and executed by computing devices, and in some cases, the steps shown or described can be executed in different orders, or can be made into individual integrated circuit modules, or multiple modules or steps can be made into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.

[0175] The above is only optional embodiments of the present application, and is not intended to limit the present application. Various modifications and changes can be made to the present application by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A protocol message transmission method, characterized in that, a server stores a compressed data set corresponding to a target transmission protocol, the compressed data set records indexes and reference data having a corresponding relationship, the reference data is data with an occurrence frequency greater than or equal to a frequency threshold value filtered from a protocol log of the target transmission protocol recorded by the server, the method is applied to the server, and the method comprises: obtaining an initial message to be transmitted to a terminal device through the target transmission protocol; finding data in the initial message from the compressed data set; in the case of finding target data in the initial message from the compressed data set, replacing the target data in the initial message with a target index corresponding in the compressed data set to obtain a compressed message; transmitting the compressed message to a terminal device.

2. The method of claim 1, characterized in that, a log collector is deployed in the server, and before obtaining the initial message to be transmitted to the terminal device through the target transmission protocol, the method further comprises: collecting the protocol log of the target transmission protocol recorded by the server through the log collector to obtain an initial log set, and analyzing each protocol log in the initial log set through the log collector to obtain an initial log data set; filtering data with an occurrence frequency greater than or equal to the frequency threshold value from the initial log data set to obtain the reference data; generating indexes corresponding to the reference data in the order from high to low of the occurrence frequency, and recording indexes and the reference data having a corresponding relationship in the order from high to low of the occurrence frequency.

3. The method of claim 2, characterized in that, the filtering of data with an occurrence frequency greater than or equal to the frequency threshold value from the initial log data set to obtain the reference data comprises: extracting candidate data carried in log data corresponding to each protocol log in the initial log data set, wherein the candidate data is included in log data corresponding to at least two protocol logs in the initial log data set; determining a first occurrence frequency of the candidate data according to the candidate data and the initial log data set, and determining a second occurrence frequency of the candidate data according to the candidate data and the initial log set; performing a product operation on the first occurrence frequency and the second occurrence frequency to obtain a target occurrence frequency of the candidate data; filtering data with a target occurrence frequency greater than or equal to the frequency threshold value from the candidate data to obtain the reference data.

4. The method of claim 3, characterized in that, The determining the first occurrence frequency of the candidate data according to the candidate data and the initial log data set comprises: in a case where the initial log data set comprises N data and the candidate data comprises M data, determining an ith1 occurrence frequency of an ith data in the M data by performing the following steps, wherein N is a positive integer, M is a positive integer, and i is a positive integer less than or equal to M: in a case where the ith data occurs K times in the N data, determining the ith1 occurrence frequency as a value obtained by dividing K by S, wherein S is a number of times that a data with a maximum occurrence frequency in the N data occurs in the N data, and S is a positive integer; The determining the second occurrence frequency of the candidate data according to the candidate data and the initial log set comprises: in a case where the candidate data comprises M data, the initial log set comprises Q protocol logs, and P protocol logs in the Q protocol logs comprise an ith data in the M data, determining an ith2 occurrence frequency of the ith data by performing the following steps, wherein M is a positive integer, Q is a positive integer, P is a positive integer less than or equal to Q, and i is a positive integer less than or equal to M: performing a sum operation on P and a reference value to obtain a target sum value; dividing Q by the target sum value to obtain a target quotient value; and performing a logarithm operation on the target quotient value to obtain the ith2 occurrence frequency.

5. The method of claim 2, wherein, after the generating the index corresponding to the reference data in the order from high to low of the occurrence frequencies and recording the index and the reference data having the corresponding relationship in the order from high to low of the occurrence frequencies, the method further comprises: setting a valid period of the compressed data set as a target time length, wherein the target time length is equal to a time difference between a target time and a generation time of the compressed data set, the generation time is earlier than the target time, and the target time is a latest time at which the server and the terminal device are allowed to use the compressed data set to transmit a protocol packet through the target transmission protocol; recording the generation time, the valid period and a version identifier of the compressed data set.

6. The method of claim 5, wherein, after the recording the generation time, the valid period and the version identifier of the compressed data set, the method further comprises: in a case where it is detected that the compressed data set is not within the valid period, collecting, by the log collector, an updated protocol log of the target transmission protocol recorded by the server to obtain an updated log set, and analyzing, by the log collector, each protocol log in the updated log set to obtain an updated log data set; screening, from the updated log data set, data with an occurrence frequency greater than or equal to the frequency threshold to obtain updated data. An update index corresponding to the update data is generated, and the update index and the update data with the corresponding relationship are recorded in descending order of the occurrence frequency.

7. The method of claim 1, wherein, The server is deployed with a first transmission device, and the first transmission device is deployed with a first decoder connected with the terminal device, and the initial message to be transmitted to the terminal device through the target transmission protocol is obtained by: receiving a compression request message initiated by the terminal device; extracting an initial version identifier carried in the compression request message by the first decoder, and searching for a reference index in the compression request message in the compression data set corresponding to the initial version identifier by the first decoder; in the case where the reference index in the compression request message is found in the compression data set by the first decoder, replacing the reference index with the corresponding compressed data in the compression data set by the first decoder to obtain an initial request message; obtaining the initial message in response to the initial request message.

8. The method of claim 1, wherein, The data in the initial message is searched from the compression data set by: in the case where the initial message includes R data and the compression data set includes T indexes and T data with corresponding relationship, searching for the s-th data in the R data from the compression data set by performing the following steps, wherein R is a positive integer, T is a positive integer, and s is a positive integer less than or equal to R: extracting an s-th data set from the R data, wherein the s-th data set includes the s-th data and L data adjacent to the s-th data, and L is a positive integer; searching for the s-th data set from the T data; in the case where each data in the s-th data set is found from the T data, marking the s-th data set as index data, and continuing to search for the s+L+1-th data in the R data from the T data; in the case where each data in the s-th data set is not found from the T data, marking the s-th data set as non-index data, and continuing to search for the s+L+1-th data in the R data from the T data.

9. The method of claim 1, wherein, The server is deployed with a first transmission device, and the first transmission device is deployed with a first encoder connected with the terminal device, and the compressed message is transmitted to the terminal device by: performing a corresponding first encoding operation on the target index in the compressed message by the first encoder to obtain a first compressed and encoded message, and performing a corresponding second encoding operation on other data in the compressed message by the first encoder to obtain a second compressed and encoded message, wherein the other data includes data in the compressed message other than the target data, the first compressed and encoded message includes data obtained by encoding the target index or data obtained by encoding the number of bytes occupied by the target index, and the second compressed and encoded message includes data obtained by encoding the data amount of the other data and data obtained by encoding the other data, or the second compressed and encoded message includes data obtained by encoding the number of bytes occupied by the data amount of the other data and data obtained by encoding the other data; carrying the initial version identifier of the compressed data set in a target compressed message, and transmitting the target compressed message to the terminal device, wherein the target compressed message includes the first compressed and encoded message and the second compressed and encoded message.

10. The method of claim 1, wherein, before the initial message to be transmitted to the terminal device by the target transmission protocol is obtained, the method further comprises: receiving a target data request initiated by the terminal device, wherein the target data request is used to request the compressed data set; in response to the target data request, extracting the compressed data set, and transmitting the compressed data set, the generation time of the compressed data set, the validity period of the compressed data set, and the initial version identifier of the compressed data set to the terminal device; or receiving an update data request initiated by the terminal device, wherein the update data request is used to request an update data set; in response to the update data request, extracting the update data set, and transmitting the update data set, the generation time of the update data set, the validity period of the update data set, and the update version identifier of the update data set to the terminal device.

11. A protocol message transmission method, comprising: a terminal device stores a compressed data set corresponding to a target transmission protocol, wherein the compressed data set records indexes and reference data having a corresponding relationship, and the reference data is data with an occurrence frequency greater than or equal to a frequency threshold value filtered from a protocol log of the target transmission protocol recorded by a server, the method is applied to the terminal device, and the method comprises: receiving a compressed message transmitted by the server, and extracting an initial version identifier carried in the compressed message; finding data in the compressed message from the compressed data set corresponding to the initial version identifier; in a case where target compressed data in the compressed message is found from the compressed data set, replacing the target compressed data in the compressed message with corresponding target data in the compressed data set to obtain a target message.

12. The method of claim 11, wherein, Before the receiving the compressed message transmitted by the server, the method further comprises: detecting whether the terminal device stores the compressed data set; in a case that it is detected that the terminal device does not store the compressed data set, initiating a target data request to the server, wherein the target data request is used to request to acquire the compressed data set, receiving the compressed data set, the generation time of the compressed data set, the validity period of the compressed data set and the initial version identifier of the compressed data set returned by the server in response to the target data request; in a case that it is detected that the terminal device stores the compressed data set, detecting whether the compressed data set is within the validity period, in a case that it is detected that the compressed data set is not within the validity period, initiating an update data request to the server, wherein the update data request is used to request to acquire an update data set, receiving the update compressed data set, the generation time of the update data set, the validity period of the update data set and the update version identifier of the update data set returned by the server in response to the update data request.

13. The method of claim 12, wherein the detecting whether the compressed data set is within the validity period comprises: detecting whether a target time length difference between a current time and a target time is less than or equal to a difference threshold, wherein the current time is a time at which the detecting whether the compressed data set is within the validity period is performed, and the current time is earlier than the target time; in a case that it is detected that the target time length difference is less than or equal to the difference threshold, determining that the compressed data set is not within the validity period.

14. The method of claim 11, wherein the terminal device is deployed with a second transmission device, the second transmission device is deployed with a second decoder, the second decoder is connected with the server, and the finding the data in the compressed message from the compressed data set corresponding to the initial version identifier comprises: performing, by the second decoder, a first decoding operation corresponding to a first encoding operation on a first compressed encoding message to obtain a target index, and performing, by the second decoder, a second decoding operation corresponding to a second encoding operation on a second compressed encoding message to obtain other data in an initial message except for target data; finding the target data corresponding to the target index from the compressed data set corresponding to the initial version identifier, wherein the target message comprises the target data and the other data.

15. The method of claim 14, wherein the finding the target data corresponding to the target index from the compressed data set corresponding to the initial version identifier comprises: ​ ​ ​ In a case where the target indexes include W indexes, the compressed data set includes T indexes and T data having a corresponding relationship, and the target data includes K data including the tth data, W is a positive integer, T is a positive integer, and t is a positive integer equal to T or not, the tth data corresponding to the tth index in the W indexes is searched from the T indexes and the T data having the corresponding relationship by performing the following steps: searching the tth index from the T indexes; in a case where the tth index is searched from the T indexes, determining the data corresponding to the tth index in the T indexes and the T data having the corresponding relationship as the tth data.

16. The method of claim 11, wherein the terminal device is deployed with a second transmission device, the second transmission device is deployed with a second encoder, the second encoder is connected with the server, and before the compressed message transmitted by the server is received, the method further comprises: generating an initial request message, wherein the initial request message is used to request to obtain an initial message; searching, by the second encoder, data in the initial request message in the compressed data set; in a case where the to-be-compressed data in the initial request message is searched from the compressed data set by the second encoder, replacing, by the second encoder, the to-be-compressed data in the initial request message with a corresponding reference index in the compressed data set to obtain a compressed request message; initiating the compressed request message to the server, wherein the initial version identifier of the compressed data set is carried in the compressed request message, the server is configured to obtain the initial message in response to the received initial request message, and replace the target data in the initial message with the compressed message obtained by replacing the target index in the compressed data set to transmit the compressed message to the terminal device.

17. A protocol message transmission device, comprising: a server storing a compressed data set corresponding to a target transmission protocol, the compressed data set recording indexes and reference data having a corresponding relationship, the reference data being data whose occurrence frequency is greater than or equal to a frequency threshold and being filtered from a protocol log of the target transmission protocol recorded by the server, the device being applied to the server, and the device comprising: an acquisition module configured to acquire an initial message to be transmitted to a terminal device by the target transmission protocol; a first searching module configured to search data in the initial message from the compressed data set; a first replacing module configured to replace target data in the initial message with a corresponding target index in the compressed data set to obtain a compressed message in a case where the target data in the initial message is searched from the compressed data set. The transmission module is configured to transmit the compressed packet to a terminal device, wherein the terminal device is configured to use the compressed data set to decompress the compressed packet to obtain a target packet corresponding to the initial packet.

18. A protocol packet transmission device, comprising: The terminal device stores a compressed data set corresponding to a target transmission protocol, wherein the compressed data set records indexes and reference data having a corresponding relationship, and the reference data is data with an occurrence frequency greater than or equal to a frequency threshold value filtered from a protocol log of the target transmission protocol recorded by a server. The third receiving module is configured to receive the compressed packet transmitted by the server and extract an initial version identifier carried in the compressed packet. The second finding module is configured to find data in the compressed packet from the compressed data set corresponding to the initial version identifier. The second replacing module is configured to replace target compressed data in the compressed packet with target data corresponding in the compressed data set to obtain a target packet when the target compressed data in the compressed packet is found from the compressed data set.

19. A server system, comprising: The server system includes a server and a terminal device connected to each other, wherein the server is configured to implement steps of the method in any one of claims 1 to 10, and the terminal device is configured to implement steps of the method in any one of claims 11 to 16.

20. A non-volatile computer readable storage medium, comprising: The non-volatile computer readable storage medium stores a computer program, wherein the computer program is executed by a processor to implement steps of the method in any one of claims 1 to 10 or steps of the method in any one of claims 11 to 16.

21. An electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: The processor executes the computer program to implement steps of the method in any one of claims 1 to 10 or steps of the method in any one of claims 11 to 16.

22. A computer program product, comprising a computer program, wherein: The computer program is executed by a processor to implement steps of the method in any one of claims 1 to 10 or steps of the method in any one of claims 11 to 16.

Citation Information

Patent Citations

  • Data compression method and device, electronic equipment and storage medium

    CN114449052A

  • Message processing method and device, medium and electronic equipment

    CN116962535A

  • Data transmission method and device, electronic equipment, storage medium and program product

    CN117714421A

  • Data compression method, device and system, electronic equipment and storage medium

    CN117785817A

  • Data monitoring method, device and equipment for HTTP2 (Hyper Text Transfer Protocol P2) and medium

    CN117880389A