Message sending method, message receiving method, computer device, chip and medium
Patent Information
- Application Number
- CN202611178175.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-04
- Publication Date
- 2026-10-13
AI Technical Summary
若当前传输资源无法提供大于或等于最小传输带宽Bmin的带宽资源,则无法满足该条消息传输的实时性要求,从而影响该条消息对应的后续控制业务
[0025]上述消息发送方法、消息接收方法、计算机设备、芯片和介质,发送端对第一消息进行分段,得到至少一个比特段,接着确定每一比特段对应的比特段长度,从而根据各比特段对应的比特段类型和比特段长度,对第一消息进行压缩处理,得到第二消息,从而使得第二消息的数据量小于第一消息的数据量,将第二消息发送至接收端所需的带宽资源相对于直接将第一消息发送至接收端所需的带宽资源,在带宽资源紧张场景中,本实施例提供的方法更易满足消息传输的实时性要求,以降低对该条消息对应后续控制业务的影响。
Smart Images

Figure CN122909228A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing technology, and in particular to a message sending method, a message receiving method, a computer device, a chip, and a medium. Background Technology
[0002] In scenarios where communication occurs between different CPUs (Central Processing Units), since the messages sent from one CPU to another are usually control messages with real-time requirements, the message transmission process has high requirements for transmission bandwidth.
[0003] For example, if the data size of a message is d, and based on the real-time requirements of this message, the maximum transmission time of this message is t. max Minimum required transmission bandwidth B min d / t max If the current transmission resources cannot provide a bandwidth greater than or equal to the minimum transmission bandwidth B. min If the bandwidth resources are insufficient, the real-time requirements of the message transmission cannot be met, thus affecting the subsequent control services corresponding to the message. Summary of the Invention
[0004] Therefore, it is necessary to provide a message sending method, message receiving method, computer equipment, chip, and medium that can easily meet the real-time requirements of message transmission and reduce the impact on subsequent control services corresponding to the message, in order to address the above-mentioned technical problems.
[0005] In a first aspect, this application provides a message sending method applied at a sending end. The method includes: segmenting a first message to obtain at least one bit segment; wherein the at least one bit segment includes a bit segment of a first bit segment type and / or a bit segment of a second bit segment type, wherein all bits in the bit segment of the first bit segment type are identical, and the bit segment of the second bit segment type contains different bits or bits that are identical but different from those in the bit segment of the first bit segment type; determining the bit segment length corresponding to each bit segment; compressing the first message according to the bit segment type and bit segment length corresponding to each bit segment to obtain a second message; and sending the second message to a receiving end.
[0006] In one embodiment, each bit in a bit segment of the first bit segment type is the first bit, and each bit in a bit segment of the second bit segment type is not the first bit. The first bit is determined based on the bit that accounts for the largest proportion in the first message.
[0007] In one embodiment, the first message is compressed according to the bit segment type and bit segment length corresponding to each bit segment, including: configuring a first control field corresponding to each bit segment of the first bit segment type; wherein the first control field is used to record the first bit segment type and the first bit segment length corresponding to the bit segment; and replacing each bit segment of the first bit segment type in the first message with the first control field corresponding to the bit segment.
[0008] In one embodiment, the first message is compressed according to the bit segment type and bit segment length corresponding to each bit segment, including: configuring a second control field corresponding to each bit segment of the second bit segment type; wherein the second control field is used to record the second bit segment type and the second bit segment length corresponding to the bit segment; and adding the second control field to the beginning or end of the bit segment in the first message.
[0009] Secondly, this application provides a message receiving method applied at a receiving end, the method comprising: receiving a second message sent by a sending end; and decompressing the second message according to the bit segment type and corresponding bit segment length in the second message.
[0010] In one embodiment, the second message is decompressed according to the bit segment type and corresponding bit segment length in the second message, including: identifying each first control field in the second message; wherein each first control field is used to record the first bit segment type and first bit segment length of the corresponding bit segment; each bit in the bit segment of the first bit segment type is a first bit; and replacing each first control field in the second message with a first bit of the corresponding first bit segment length.
[0011] In one embodiment, the second message is decompressed according to the bit segment type and corresponding bit segment length in the second message, including: identifying each second control field in the second message; wherein each second control field is used to record the second bit segment type and second bit segment length of the corresponding bit segment; each bit in the bit segment of the second bit segment type is not a first bit; for the second control field, the bit segment corresponding to the second control field is verified according to the second bit segment length in the second control field; after the verification is passed, the second control field is deleted.
[0012] Thirdly, this application also provides a message sending device, applied at a sending end, the device comprising:
[0013] The message segmentation module is used to segment the first message to obtain at least one bit segment; wherein, the at least one bit segment includes a bit segment of type first bit segment and / or a bit segment of type second bit segment, wherein all bits in the bit segment of type first bit segment are the same, and the bit segment of type second bit segment contains different bits or bits that are the same but different from those in the bit segment of type first bit segment;
[0014] The length determination module is used to determine the length of the bit segment corresponding to each bit segment;
[0015] The message compression module is used to compress the first message according to the bit segment type and bit segment length corresponding to each bit segment to obtain the second message;
[0016] The message sending module is used to send a second message to the receiving end.
[0017] Fourthly, this application also provides a message receiving device for use at a receiving end, the device comprising:
[0018] The message receiving module is used to receive the second message sent by the sending end;
[0019] The message decompression module is used to decompress the second message according to the type and length of each bit segment in the second message.
[0020] Fifthly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method provided in the first or second aspect.
[0021] Sixthly, this application also provides a chip, including a processor and a communication interface, wherein the processor is configured to cause the chip to perform the steps of the method provided in the first or second aspect.
[0022] In a seventh aspect, this application also provides a chip module, including a communication module, a power module, a storage module, and a chip, wherein: the power module is used to provide electrical energy to the chip module; the storage module is used to store data and instructions; the communication module is used to perform internal communication within the chip module, or to enable communication between the chip module and external devices; and the chip is used to perform the steps of the methods provided in the first or second aspect above.
[0023] Eighthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method provided in the first or second aspect.
[0024] Ninthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method provided in the first or second aspect.
[0025] The aforementioned message sending method, message receiving method, computer equipment, chip, and medium involve the sending end segmenting the first message to obtain at least one bit segment, then determining the bit segment length corresponding to each bit segment, and compressing the first message according to the bit segment type and bit segment length to obtain the second message. This results in the second message having a smaller data volume than the first message. The bandwidth resources required to send the second message to the receiving end are relatively less than those required to directly send the first message to the receiving end. In scenarios with limited bandwidth resources, the method provided in this embodiment is more likely to meet the real-time requirements of message transmission, thereby reducing the impact on subsequent control services corresponding to this message. Attached Figure Description
[0026] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0027] Figure 1 This is a flowchart illustrating a message sending method in one embodiment;
[0028] Figure 2 This is a flowchart illustrating the message compression steps in one embodiment;
[0029] Figure 3 This is a flowchart illustrating the message compression steps in one embodiment;
[0030] Figure 4 This is a flowchart illustrating a message receiving method in one embodiment;
[0031] Figure 5 This is a flowchart illustrating the decompression steps in one embodiment;
[0032] Figure 6 This is a flowchart illustrating the decompression steps in one embodiment;
[0033] Figure 7 This is a flowchart illustrating a data transmission method in one embodiment;
[0034] Figure 8 This is a structural block diagram of a message sending device in one embodiment;
[0035] Figure 9 This is a structural block diagram of a message receiving device in one embodiment;
[0036] Figure 10 This is an internal structural diagram of a computer device in one embodiment;
[0037] Figure 11 This is an internal structure diagram of a chip module in one embodiment. Detailed Implementation
[0038] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0039] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.
[0040] In one exemplary embodiment, a message sending method is provided, applied to a sending end, which includes a chip / chip module with data processing capabilities. (See also...) Figure 1 The method includes:
[0041] S110, segment the first message to obtain at least one bit segment.
[0042] The sending end can be a CPU or other modules, which are not limited here.
[0043] The first message is the message to be compressed.
[0044] The bit segment type includes the first bit segment type and the second bit segment type.
[0045] Each bit segment contains at least one bit.
[0046] Wherein, at least one bit segment includes a bit segment of type 1 bit segment and / or a bit segment of type 2 bit segment, wherein all bits in the bit segment of type 1 bit segment are the same, and the bit segment of type 2 bit segment contains different bits or bits that are the same but different from those in the bit segment of type 1 bit segment.
[0047] In the first bit segment type, each bit can be 0, 1, 2, or other bit values, which is not limited here.
[0048] The bit values in the first message can be of any type, for example, a 32-bit bit type, in which case the bit value range is [0, 2]. 32 -1], of course, can also be other types, which are not limited here.
[0049] For example, the first message is 1110000123456789. Without limiting the specific value of the bits in the bit segment of the first bit segment type, both "111" and "0000" can be regarded as the bit segment of the first bit segment type, referred to as the first bit segment, and "123456789" can be regarded as the bit segment of the second bit segment type, referred to as the second bit segment.
[0050] When the specific values of bits in a bit segment of the first bit segment type are specified, for example, if the specific value is specified as 0, then "0000" is used as the first bit segment, and bit segments "111" and "123456789" are used as the second bit segment, because the bits in bit segment "111" are the same, but different from the bits in the bit segment of the first bit segment type.
[0051] Among them, the second bit segment type contains different bits or bits that are the same but different from those in the first bit segment type. This includes two cases: the case where all bits are different, for example, "123456789"; and the case where some bits are the same and some bits are different. For example, if the first message is 00001123456789, then "0000" is used as the first bit segment and "1123456789" is used as the second bit segment.
[0052] Understandably, S110 actually segments the first message according to the bit segment type, thereby obtaining at least one bit segment.
[0053] S120, determine the length of the bit segment corresponding to each bit segment.
[0054] The bit segment length can be understood as the number of bits in the bit segment.
[0055] For example, the bit segment length of "111" is 3, the bit segment length of "0000" is 4, and the bit segment length of "123456789" is 9.
[0056] S130: Based on the bit segment type and bit segment length corresponding to each bit segment, the first message is compressed to obtain the second message.
[0057] The second message is obtained by compressing the first message.
[0058] Understandably, after compression, the second message has a smaller data size than the first message.
[0059] Different bit segment types may use the same or different compression methods, which is not limited here.
[0060] S140, send the second message to the receiving end.
[0061] In this embodiment, where the transmitting end is a CPU, the receiving end can be a different CPU than the transmitting end. The method provided in the embodiment enables data transmission between different CPUs. Of course, the receiving end can also be other modules, which are not limited here.
[0062] In the above message sending method, the sending end segments the first message to obtain at least one bit segment, then determines the bit segment length corresponding to each bit segment, and compresses the first message according to the bit segment type and bit segment length corresponding to each bit segment to obtain the second message. This makes the data volume of the second message smaller than that of the first message. The bandwidth resources required to send the second message to the receiving end are relatively less than those required to directly send the first message to the receiving end. In scenarios where bandwidth resources are scarce, the method provided in this embodiment is more likely to meet the real-time requirements of message transmission, thereby reducing the impact on subsequent control services corresponding to this message.
[0063] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided, in which each bit in the bit segment of the first bit segment type is the first bit, and each bit in the bit segment of the second bit segment type is not the first bit.
[0064] The first bit can be determined based on the bit that accounts for the largest proportion in the first message.
[0065] For example, the most frequent bit in the first message is 0, while the proportion of non-zero bits is very small. In order to compress the first message to the greatest extent, 0 can be chosen as the first bit.
[0066] As can be seen, this embodiment belongs to the case where the specific values of bits in the bit segment of the first bit segment type are limited.
[0067] It is understandable that each bit in the second bit segment type is not the first bit. This includes cases where there are different bits in the second bit segment type, as well as cases where each bit is the same but different from the bits in the first bit segment type.
[0068] In practical scenarios, when 0 is used as the first bit, if multiple consecutive 0s appear in the first message, these consecutive 0s are treated as a single bit segment; if a single 0 appears in the first message, meaning that all bits adjacent to the 0 are non-zero, then this single 0 can be treated as an independent bit segment. In reality, because 0 makes up a significant portion of the first message, the occurrence of multiple consecutive 0s is relatively common, while the occurrence of a single 0 is rare.
[0069] For example, the first message: 0000001230450000111 can be divided into bit segments “000000”, “123”, “0”, “45”, “0000” and “111”; among them, “000000”, “0” and “0000” are the first bit segments, and the remaining bit segments are the second bit segments.
[0070] In this embodiment, in order to compress the first message to the greatest extent and thus reduce the required bandwidth resources, the first bit is determined based on the bit with the largest proportion in the first message. Thus, each bit in the bit segment of the first bit segment type is limited to being the first bit, and each bit in the bit segment of the second bit segment type is limited to being a non-first bit. This reduces the required bandwidth resources to the greatest extent while simplifying the classification criteria and improving classification efficiency.
[0071] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided, in which the message compression step in S130 is refined.
[0072] See Figure 2 The detailed message compression steps include:
[0073] S210, for each bit segment of the first bit segment type, configure the first control field corresponding to the bit segment.
[0074] The first control field is used to record the type of the first bit segment and the length of the first bit segment corresponding to the bit segment.
[0075] That is, for each first bit segment, the type of the first bit segment and the length of the first bit segment corresponding to that first bit segment are recorded in the first control field.
[0076] The first bit segment type can be represented by the second bit, and the second bit segment type can be represented by the third bit, with the second bit being different from the third bit.
[0077] When the specific values of bits in a bit segment of the first bit segment type are not specified, the first control field, in addition to recording the first bit segment type and length, also needs to record bit value information to characterize the specific values of bits in the bit segment of the first bit segment type. When the specific values of bits in a bit segment of the first bit segment type are specified, the first control field does not need to record bit value information.
[0078] S220, replace each bit segment of the first bit segment type in the first message with the first control field corresponding to the bit segment.
[0079] That is, each first bit segment in the first message is replaced with the first control field corresponding to that first bit segment.
[0080] In this embodiment, for each bit segment of the first bit segment type, the first bit segment type and the corresponding first bit segment length are recorded through a first control field, and the first control field is used to replace the bit segment, thereby achieving compression of the bit segment. Since the length of the first control field is usually less than the length of the bit segment, compression can reduce the amount of data, thereby reducing the required bandwidth resources.
[0081] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided, in which the message compression step in S130 is refined.
[0082] See Figure 3 The detailed message compression steps include:
[0083] S310, for each bit segment of the second bit segment type, configure the second control field corresponding to the bit segment.
[0084] The second control field is used to record the type of the second bit segment and the length of the second bit segment corresponding to the bit segment.
[0085] S320, add the second control field to the beginning or end of the bit segment in the first message.
[0086] As can be seen, for each bit segment of the second bit segment type, a second control field and a content field are set. The second control field includes the second bit segment type and the second bit segment length corresponding to the bit segment, and the content field includes each bit in the field.
[0087] In this embodiment, for each bit segment of the second bit segment type, a second control field is added to the beginning or end of the bit segment. The second control field records the second bit segment type and the corresponding second bit segment length. Although the above process increases the length of the bit segments of the second bit segment type, since the proportion of bit segments of the second bit segment type is relatively small, and most bit segments are bit segments of the first bit segment type, the overall length of the second message is still less than the length of the first message, thus meeting the requirement of reducing the required bandwidth resources. Adding a second control field to the beginning or end of each bit segment of the second bit segment type in this embodiment facilitates correct decompression by the subsequent receiving end.
[0088] In one exemplary embodiment, a message receiving method is provided, applied to a receiving end, which includes a chip / chip module with data processing capabilities. (See also...) Figure 4 The method includes:
[0089] S410 receives the second message sent by the sending end.
[0090] That is, the receiving end receives the second message from the sending end.
[0091] S420: Decompress the second message according to the bit segment type and corresponding bit segment length in the second message.
[0092] Different decompression methods are used for different bit segment types.
[0093] Among these factors, the bit segment length is beneficial for the receiving end to achieve correct decompression.
[0094] In this embodiment, after receiving the second message sent by the sender, the receiving end decompresses the second message according to the bit segment type and corresponding bit segment length in the second message to obtain the first message, thereby realizing message transmission. Since the length of the second message is less than the length of the first message, the bandwidth resources required for data transmission are reduced, making it easier to meet the real-time requirements of data transmission.
[0095] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided, in which the decompression step in S420 is refined.
[0096] See Figure 5 The detailed decompression steps include:
[0097] S510 identifies each of the first control fields in the second message.
[0098] Each first control field is used to record the first bit segment type and the first bit segment length of the corresponding bit segment; each bit in the bit segment of the first bit segment type is the first bit.
[0099] That is, the control field in the second message that includes the first bit segment type is identified as the first control field.
[0100] Understandably, the receiving end knows the specific value of the first bit.
[0101] S520, replace each first control field in the second message with the first bit of the corresponding first bit segment length.
[0102] In this embodiment, based on the premise that each bit in the bit segment of the first bit segment type is the first bit, a control field of the first bit segment type is identified in the second message and used as the first control field. The first control field is then replaced with the first bit of the first bit segment length in the first control field, thereby restoring the bit segment of the first bit segment type. Since the above decompression process is simple and easy to implement, the decompression efficiency is high.
[0103] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided, in which the decompression step in S420 is refined.
[0104] See Figure 6 The detailed decompression steps include:
[0105] S610 identifies each of the second control fields in the second message.
[0106] Each second control field is used to record the second bit segment type and the second bit segment length of the corresponding bit segment; each bit in the bit segment of the second bit segment type is not the first bit.
[0107] Understandably, the receiving end knows the relative position of the second control field and the bit segment, for example, the header.
[0108] That is, the receiving end identifies the second message as containing a control field of the second bit segment type, and uses it as the second control field.
[0109] S620, for the second control field, verify the bit segment corresponding to the second control field according to the length of the second bit segment in the second control field.
[0110] That is, it is determined whether the length of the bit segment corresponding to the second control field is the same as the length of the second bit segment in the second control field. If they are the same, the verification passes; otherwise, the verification fails.
[0111] S630: After successful verification, delete the second control field.
[0112] In this embodiment, the receiving end identifies a control field of type second bit segment in the second message as the second control field. Then, it verifies whether the length of the bit segment corresponding to the second control field is the same as the length of the second bit segment in the second control field. If the verification passes, the second control field is deleted to restore the message. Since length verification is involved in the decompression process, the reliability of the second bit segment type bit segment obtained after decompression can be guaranteed.
[0113] Based on the technical solutions provided in the above embodiments, an optional embodiment is provided, which provides a data transmission method, see [link to optional embodiment]. Figure 7 The method includes:
[0114] S710, the sending end segments the first message to obtain at least one bit segment.
[0115] Among them, at least one bit segment includes a bit segment of type first bit segment and / or a bit segment of type second bit segment. In the bit segment of type first bit segment, each bit is the first bit. In the bit segment of type second bit segment, each bit is not the first bit. The first bit is determined according to the bit with the largest proportion in the first message.
[0116] S720: The transmitting end determines the length of the bit segment corresponding to each bit segment.
[0117] S730, the sending end configures the first control field corresponding to each bit segment of the first bit segment type; and replaces each bit segment of the first bit segment type in the first message with the first control field corresponding to the bit segment.
[0118] The first control field is used to record the type of the first bit segment and the length of the first bit segment corresponding to the bit segment.
[0119] S740, the sending end configures a second control field corresponding to each bit segment of the second bit segment type; the second control field is added to the beginning or end of the bit segment in the first message to obtain the second message.
[0120] The second control field is used to record the type of the second bit segment and the length of the second bit segment corresponding to the bit segment.
[0121] S750: The sending end sends a second message to the receiving end.
[0122] S760, the receiving end receives the second message sent by the sending end.
[0123] S770, the receiving end identifies each first control field in the second message; each bit in the bit segment of the first bit segment type is the first bit; and replaces each first control field in the second message with the first bit of the corresponding first bit segment length.
[0124] S780, the receiving end identifies each second control field in the second message; for each second control field, it verifies the bit segment corresponding to the second control field according to the length of the second bit segment in the second control field; after the verification passes, the second control field is deleted.
[0125] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.
[0126] Based on the same inventive concept, embodiments of this application also provide a message sending apparatus for implementing the message sending method and a message receiving apparatus for implementing the message receiving method described above. This apparatus can be applied to or integrated into a chip or chip module, for example. The solution provided by this apparatus is similar to the solution described in the above method; therefore, the specific limitations of the one or more message sending apparatus embodiments provided below can be found in the limitations of the message sending method above, and the specific limitations of the one or more message receiving apparatus embodiments provided below can be found in the limitations of the message receiving method above, and will not be repeated here.
[0127] In one exemplary embodiment, a message sending device is provided, applied to a sending end, see [link to relevant documentation]. Figure 8 The device includes:
[0128] The message segmentation module 810 is used to segment the first message to obtain at least one bit segment; wherein, the at least one bit segment includes a bit segment of a first bit segment type and / or a bit segment of a second bit segment type, wherein all bits in the bit segment of the first bit segment type are the same, and the bit segment of the second bit segment type contains different bits or bits that are the same but different from those in the bit segment of the first bit segment type.
[0129] The length determination module 820 is used to determine the length of the bit segment corresponding to each bit segment;
[0130] The message compression module 830 is used to compress the first message according to the bit segment type and bit segment length corresponding to each bit segment to obtain the second message;
[0131] The message sending module 840 is used to send a second message to the receiving end.
[0132] In one embodiment, each bit in a bit segment of the first bit segment type is the first bit, and each bit in a bit segment of the second bit segment type is not the first bit. The first bit is determined based on the bit that accounts for the largest proportion in the first message.
[0133] In one embodiment, the message compression module is specifically used to: configure a first control field corresponding to each bit segment of the first bit segment type; wherein, the first control field is used to record the first bit segment type and the length of the first bit segment corresponding to the bit segment; and replace each bit segment of the first bit segment type in the first message with the first control field corresponding to the bit segment.
[0134] In one embodiment, the message compression module is specifically used to: configure a second control field corresponding to each bit segment of the second bit segment type; wherein the second control field is used to record the second bit segment type and the second bit segment length corresponding to the bit segment; and add the second control field to the beginning or end of the bit segment in the first message.
[0135] In one exemplary embodiment, a message receiving device is provided, applied at a receiving end, see [link to relevant documentation]. Figure 9 The device includes:
[0136] The message receiving module 910 is used to receive the second message sent by the sending end;
[0137] The message decompression module 920 is used to decompress the second message according to the bit segment type and corresponding bit segment length in the second message.
[0138] In one embodiment, the message decompression module is used to: identify each first control field in the second message; wherein each first control field is used to record the first bit segment type and the first bit segment length of the corresponding bit segment; each bit in the bit segment of the first bit segment type is the first bit; and replace each first control field in the second message with the first bit of the corresponding first bit segment length.
[0139] In one embodiment, the message decompression module is used to: identify each second control field in the second message; wherein each second control field is used to record the second bit segment type and the second bit segment length of the corresponding bit segment; each bit in the bit segment of the second bit segment type is not the first bit; for the second control field, the bit segment corresponding to the second control field is verified according to the second bit segment length in the second control field; after the verification is passed, the second control field is deleted.
[0140] Regarding the modules / units included in the various devices and products described in the above embodiments, they can be software modules / units, hardware modules / units, or a combination of both. For example, for various devices and products applied to or integrated into a chip, all of their modules / units can be implemented using hardware methods such as circuits, or at least some modules / units can be implemented using software programs that run on a processor integrated within the chip, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits; for various devices and products applied to or integrated into a chip module, all of their modules / units can be implemented using hardware methods such as circuits, and different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or different components of the chip module, or at least some modules / units can be implemented using hardware methods such as circuits. The components can be implemented using software programs that run on the processor integrated within the chip module. The remaining (if any) modules / units can be implemented using hardware methods such as circuits. For various devices and products applied to or integrated into the terminal, each of its components / units can be implemented using hardware methods such as circuits. Different modules / units can be located in the same component (e.g., chip, circuit module, etc.) or in different components within the terminal. Alternatively, at least some modules / units can be implemented using software programs that run on the processor integrated within the terminal, while the remaining (if any) modules / units can be implemented using hardware methods such as circuits.
[0141] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 10As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements a message sending or receiving method.
[0142] Those skilled in the art will understand that Figure 10 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0143] In one exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps of the message sending method or message receiving method described above.
[0144] Based on the same inventive concept, this application also provides a chip, including a processor and a communication interface; the communication interface is used to receive or send data; the processor is configured to cause the chip to execute the steps of the message sending method or message receiving method in the above embodiments.
[0145] It is understood that the chip involved in the embodiments of this application may be a field-programmable gate array (FPGA), may be an application-specific integrated circuit (ASIC), may be a system on chip (SoC), may be a central processor unit (CPU), may be a network processor (NP), may be a digital signal processor (DSP), may be a microcontroller unit (MCU), may be a programmable logic device (PLD), or other integrated chips, etc.
[0146] Based on the same inventive concept, this application also provides a chip module, such as... Figure 11 As shown, the chip module includes a communication module, a power module, a storage module, and a chip. Specifically: the power module provides power to the chip module; the storage module stores data and instructions; the communication module enables internal communication within the chip module or communication between the chip module and external devices; and the chip corresponds to the chip in the aforementioned chip embodiment. The implementation of this chip module can be found in the relevant content of the aforementioned chip embodiment, and will not be repeated here.
[0147] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps of the message sending method or message receiving method described above.
[0148] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps of the message sending method or message receiving method described above.
[0149] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0150] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0151] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0152] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A message sending method, characterized in that, Applied to the sending end, the method includes: The first message is segmented to obtain at least one bit segment; wherein, the at least one bit segment includes a bit segment of a first bit segment type and / or a bit segment of a second bit segment type, wherein all bits in the bit segment of the first bit segment type are the same, and the bit segment of the second bit segment type contains different bits or bits that are the same but different from those in the bit segment of the first bit segment type; Determine the length of the bit segment corresponding to each bit segment; Based on the bit segment type and bit segment length corresponding to each bit segment, the first message is compressed to obtain the second message; Send the second message to the receiving end.
2. The method according to claim 1, characterized in that, In the first bit segment type, each bit is the first bit, and in the second bit segment type, each bit is not the first bit. The first bit is determined based on the bit that accounts for the largest proportion in the first message.
3. The method according to claim 2, characterized in that, The step of compressing the first message according to the bit segment type and bit segment length corresponding to each bit segment includes: For each bit segment of the first bit segment type, a first control field corresponding to the bit segment is configured; wherein, the first control field is used to record the first bit segment type and the length of the first bit segment corresponding to the bit segment; Replace each bit segment of the first bit segment type in the first message with the first control field corresponding to the bit segment.
4. The method according to claim 2, characterized in that, The step of compressing the first message according to the bit segment type and bit segment length corresponding to each bit segment includes: For each bit segment of the second bit segment type, a second control field corresponding to the bit segment is configured; wherein, the second control field is used to record the second bit segment type and the second bit segment length corresponding to the bit segment; Add the second control field to the beginning or end of the bit segment in the first message.
5. A message receiving method, characterized in that, Applied to the receiving end, the method includes: Receive the second message sent by the sender; The second message is decompressed according to the bit segment type and corresponding bit segment length in the second message.
6. The method according to claim 5, characterized in that, The step of decompressing the second message according to the bit segment type and corresponding bit segment length in the second message includes: Identify each first control field in the second message; wherein each first control field is used to record the first bit segment type and the first bit segment length of the corresponding bit segment; each bit in the bit segment of the first bit segment type is a first bit; Replace each of the first control fields in the second message with the first bit of the corresponding first bit segment length.
7. The method according to claim 5, characterized in that, The step of decompressing the second message according to the bit segment type and corresponding bit segment length in the second message includes: Identify each of the second control fields in the second message; wherein each of the second control fields is used to record the second bit segment type and the second bit segment length of the corresponding bit segment; each bit in the bit segment of the second bit segment type is not a first bit; For the second control field, the bit segment corresponding to the second control field is verified according to the length of the second bit segment in the second control field; After the verification is successful, delete the second control field.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.
9. A chip, characterized in that, The device includes a processor and a communication interface, the processor being configured to cause the chip to perform the steps of the method described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, It contains a computer program that is executed by a processor using the steps of the method described in any one of claims 1 to 7.