Message processing method and device, equipment, storage medium and computer program product

By determining the target encoder and decoder in the transmitter and receiver, a general processing of multiple communication protocols is achieved, and the problem of inefficient development due to the diversity of communication protocols in the prior art is solved, and the development efficiency and stability of communication protocols are improved.

CN119603379APending Publication Date: 2025-03-11CONTEMPORARY AMPEREX FUTURE ENERGY RES INST (SHANGHAI) LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311168353.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-11
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

Since multiple communication protocols are independent of each other, the sending and receiving end need to develop communication programs separately for different communication protocols, resulting in low development efficiency.

Method used

By obtaining the original message and its corresponding target message type, based on the target message type and the preset relationship, the target encoder is determined from multiple candidate encoders, the original message is encoded, and the encoded message is sent to the receiving end. The receiver determines the target decoder based on the target message type and decodes the encoded packet.

Benefits of technology

Communication between the sending end and the receiving end is realized. Different communication protocols can reuse the same communication processing logic without the need to develop a communication program separately, which improves the development efficiency of the communication protocol and reduces the probability of errors caused by protocol changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119603379A_ABST
    Figure CN119603379A_ABST
Patent Text Reader

Abstract

The invention relates to a message processing method and device, equipment, a storage medium and a computer program product. The method comprises the following steps: acquiring an original message and a target message type corresponding to the original message, determining a target encoder from a plurality of candidate encoders based on the target message type and a first preset relationship between the message type and the candidate encoders, encoding the original message by adopting the target encoder to obtain an encoded message, and sending the encoded message to a server; and sending the coded message to a receiving end, so that the receiving end decodes the coded message by adopting a decoder corresponding to the target message type. According to the embodiment of the invention, the target encoder is determined from the plurality of candidate encoders, the target encoder is adopted to encode the original message to obtain the encoded message, and the encoded message is sent to the receiving end, so that communication between the sending end and the receiving end can be realized; different communication protocols can repeatedly use the communication processing logic provided by the embodiment, so that the development efficiency of the communication protocols is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a message processing method, apparatus, device, storage medium and computer program product. Background Art

[0002] There are many types of communication protocols between the transmitter and the receiver in the power automation system, such as IEC101, IEC104, IEC103, modbus, etc. The transmitter and the receiver can communicate through a physical channel.

[0003] At present, due to the existence of multiple communication protocols, different communication protocols are independent of each other. For the sender and the receiver, corresponding communication programs need to be developed separately for different communication protocols to meet the communication needs of the sender and the receiver under different communication protocols.

[0004] Therefore, current communication programs are developed inefficiently. Summary of the invention

[0005] Based on this, it is necessary to provide a message processing method, apparatus, device, storage medium and computer program product that can improve the development efficiency of communication programs in response to the above technical problems.

[0006] In a first aspect, the present application provides a message processing method. The method comprises:

[0007] Get the original message and the target message type corresponding to the original message;

[0008] Determining a target encoder from a plurality of candidate encoders based on a target message type and a first preset relationship; the first preset relationship includes a mapping relationship between a message type and a candidate encoder;

[0009] The target encoder is used to encode the original message to obtain an encoded message, and the encoded message is sent to the receiving end so that the receiving end uses a decoder corresponding to the target message type to decode the encoded message.

[0010] The message processing method provided in the embodiment of the present application obtains the original message and the target message type corresponding to the original message, determines the target encoder from multiple candidate encoders based on the target message type and the first preset relationship between the message type and the candidate encoder, uses the target encoder to encode the original message to obtain an encoded message, and sends the encoded message to the receiving end, so that the receiving end uses the decoder corresponding to the target message type to decode the encoded message. Since the embodiment of the present application determines the target encoder from multiple candidate encoders, uses the target encoder to encode the original message to obtain an encoded message, and sends the encoded message to the receiving end, the communication between the sending end and the receiving end can be realized, and different communication protocols can reuse the communication processing logic provided by this embodiment, and there is no need to develop corresponding communication programs separately for different communication protocols to realize the communication between the sending end and the receiving end, thereby improving the development efficiency of the communication protocol and reducing the error probability caused by redeveloping the communication protocol for different communication protocols.

[0011] In one embodiment, the method further comprises:

[0012] Get the encoder registration request;

[0013] In response to the encoder registration request, the encoder indicated by the encoder registration request is added in the transmitting end.

[0014] The method provided in the embodiment of the present application obtains an encoder registration request, responds to the encoder registration request, and adds an encoder indicated by the encoder registration request in the transmitting end, so that the newly added encoder adapts to the new message type, realizes the processing and encoding function of the original message corresponding to the new message type, and is easy to realize message expansion. In addition, the newly added encoder can realize new functions, has high encoder expansion flexibility, can quickly respond to demand changes, and has strong stability and maintainability.

[0015] In one of the embodiments, determining a target encoder from a plurality of candidate encoders based on the target message type and the first preset relationship includes:

[0016] The encoding manager is called to determine a target encoder from a plurality of candidate encoders based on the target message type and a first preset relationship.

[0017] The method provided in the embodiment of the present application determines the target encoder from multiple candidate encoders based on the target message type and the first preset relationship by calling the encoding manager, thereby implementing the management of the candidate encoders by the encoding manager and facilitating the expansion of the encoder.

[0018] In one embodiment, obtaining an original message and a target message type corresponding to the original message includes:

[0019] Calling the first message call method passes the original message and the target message type to the encoding manager.

[0020] The method provided in the embodiment of the present application realizes passing the original message and the target message type to the encoding manager by calling the first message calling method, thereby facilitating the encoding manager to determine the target encoder from multiple candidate encoders based on the target message type and the first preset relationship.

[0021] In one embodiment, obtaining an original message and a target message type corresponding to the original message includes:

[0022] Calling the second message calling method to pass the original message to the message manager;

[0023] The calling message manager adopts the parameter passing method to pass the original message and the target message type of the original message to the encoding manager.

[0024] The method provided in the embodiment of the present application passes the original message to the message manager by calling the second message calling method, and the message manager is called to use the parameter passing method to pass the original message and the target message type of the original message to the encoding manager, thereby realizing the passing of the original message and the target message type of the original message to the encoding manager, so that the encoding manager can determine the target encoder from multiple candidate encoders based on the target message type and the first preset relationship.

[0025] In one embodiment, the method further comprises:

[0026] In response to the first adding request, adding a new message calling method indicated by the first adding request in the sending end;

[0027] In response to the second adding request, the message manager adds a new parameter transfer method indicated by the second adding request in the message manager.

[0028] The method provided in the embodiment of the present application achieves the expansion of the message calling method and the parameter passing method by responding to the first add request by adding a new message calling method indicated by the first add request in the sending end, and responding to the second add request by the message manager by adding a new parameter passing method indicated by the second add request in the message manager.

[0029] In one embodiment, encoding the original message using a target encoder to obtain an encoded message includes:

[0030] The target encoder is used to encode the original message based on the encoder interface to obtain an encoded message.

[0031] The method provided in the embodiment of the present application adopts a target encoder to encode the original message based on the encoder interface to obtain an encoded message. Since the implementation of the encoder interface does not affect other communication logics, the communication process is decoupled so that the communication logics of each part do not affect each other. In addition, the target encoder encodes the original message based on the encoder interface to obtain an encoded message, which can improve the code reuse rate of the encoder interface and further improve the development efficiency of the communication program.

[0032] In a second aspect, the present application also provides a message processing method, which is applied to a receiving end, and the method includes:

[0033] Receive an encoded message sent by a sending end; the encoded message is obtained by the sending end encoding the original message using a target encoder, the target encoder is determined by the sending end from multiple candidate encoders based on the target message type of the original message and a first preset relationship, and the first preset relationship includes a mapping relationship between the message type and the candidate encoder;

[0034] Determining a target decoder from a plurality of candidate decoders based on a target message type and a second preset relationship; the second preset relationship comprising a mapping relationship between a message type and a candidate decoder;

[0035] The target decoder is used to decode the encoded message to obtain the original message.

[0036] In one embodiment, the method further comprises:

[0037] Get decoder registration request;

[0038] In response to the decoder registration request, a decoder indicated by the decoder registration request is added in the receiving end.

[0039] In one embodiment, determining a target decoder from a plurality of candidate decoders based on the target message type and a preset relationship includes:

[0040] The decoding manager is called to determine a target decoder from a plurality of candidate decoders based on the target message type and a second preset relationship.

[0041] In one embodiment, a target decoder is used to decode the encoded message to obtain an original message, including:

[0042] The target decoder is used to decode the encoded message based on the decoder interface to obtain the original message.

[0043] In a third aspect, the present application also provides a message processing device. Set at a sending end, the device includes:

[0044] A first acquisition module, used to acquire an original message and a target message type corresponding to the original message;

[0045] A determination module, configured to determine a target encoder from a plurality of candidate encoders based on a target message type and a first preset relationship; the preset relationship includes a mapping relationship between a message type and a candidate encoder;

[0046] The encoding module is used to encode the original message using a target encoder to obtain an encoded message, and send the encoded message to a receiving end so that the receiving end uses a decoder corresponding to the target message type to decode the encoded message.

[0047] In a fourth aspect, the present application also provides a message processing device. Set at a receiving end, the device includes:

[0048] A receiving module, configured to receive an encoded message sent by a sending end; the encoded message is obtained by the sending end by encoding an original message using a target encoder, the target encoder is determined by the sending end from a plurality of candidate encoders based on a target message type of the original message and a first preset relationship, the first preset relationship including a mapping relationship between a message type and a candidate encoder;

[0049] A determination module, configured to determine a target decoder from a plurality of candidate decoders based on a target message type and a second preset relationship; the second preset relationship comprising a mapping relationship between a message type and a candidate decoder;

[0050] The decoding module is used to decode the encoded message using a target decoder to obtain the original message.

[0051] In a fifth aspect, the present application further provides a computer device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.

[0052] In a sixth aspect, the present application further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0053] In a seventh aspect, the present application further provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the above method are implemented.

[0054] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] Various other advantages and benefits will become apparent to those of ordinary skill in the art by reading the detailed description of the preferred embodiments below. The accompanying drawings are only for the purpose of illustrating the preferred embodiments and are not to be considered as limiting the present application. Moreover, the same reference numerals are used throughout the drawings to represent the same components. In the drawings:

[0056] Figure 1 An application environment diagram of a message processing method in an embodiment;

[0057] Figure 2 It is a flowchart of a message processing method provided by an embodiment of the present application;

[0058] Figure 3 It is a flowchart of an encoder registration method provided in an embodiment of the present application;

[0059] Figure 4 It is a flowchart of another method for obtaining the original message and target message types provided in an embodiment of the present application;

[0060] Figure 5 It is a flowchart diagram of a method added in a sending end provided in an embodiment of the present application;

[0061] Figure 6 This is a schematic diagram of a channel change process provided by an embodiment of the present application;

[0062] Figure 7 It is a flowchart of another message processing method provided in an embodiment of the present application;

[0063] Figure 8 It is a flowchart of a decoder registration method provided in an embodiment of the present application;

[0064] Fig. 9 It is a flow chart of a communication method between a transmitting end and a receiving end provided in an embodiment of the present application;

[0065] Fig.10 This is one of the structural block diagrams of the message processing device provided in the embodiment of the present application;

[0066] Fig.11 This is the second structural block diagram of the message processing device provided in the embodiment of the present application;

[0067] Fig.12 This is the third structural block diagram of the message processing device provided in the embodiment of the present application;

[0068] Fig.13 This is the fourth structural block diagram of the message processing device provided in the embodiment of the present application;

[0069] Fig.14This is the fifth structural block diagram of the message processing device provided in the embodiment of the present application;

[0070] Fig.15 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0071] The following embodiments of the technical solution of the present application are described in detail in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present application, and are therefore only used as examples, and cannot be used to limit the scope of protection of the present application.

[0072] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by technicians in the technical field to which this application belongs; the terms used herein are only for the purpose of describing specific embodiments and are not intended to limit this application; the terms "including" and "having" in the specification and claims of this application and the above-mentioned figure descriptions and any variations thereof are intended to cover non-exclusive inclusions.

[0073] In the description of the embodiments of the present application, the technical terms "first", "second", etc. are only used to distinguish different objects, and cannot be understood as indicating or implying relative importance or implicitly indicating the number, specific order or primary and secondary relationship of the indicated technical features. In the description of the embodiments of the present application, the meaning of "multiple" is more than two, unless otherwise clearly and specifically defined.

[0074] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0075] In the description of the embodiments of the present application, the term "and / or" is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0076] There are many types of communication protocols between the transmitter and the receiver in the power automation system, such as IEC101, IEC104, IEC103, modbus, etc. The transmitter and the receiver can communicate through a physical channel.

[0077] At present, due to the existence of multiple communication protocols, different communication protocols are independent of each other. For the sender and the receiver, corresponding communication programs need to be developed separately for different communication protocols to meet the communication needs of the sender and the receiver under different communication protocols.

[0078] Therefore, current communication programs are developed inefficiently.

[0079] In order to solve the above-mentioned technical problems, an embodiment of the present application provides a message processing method, which adds a management function for candidate encoders in the sending end, and adds a management function for candidate decoders in the receiving end. Therefore, when a new communication protocol is added or the communication protocol is replaced between the sending end and the receiving end, there is no need to separately develop a communication program corresponding to the new communication protocol, or separately develop a communication program corresponding to the replaced communication protocol, thereby improving the development efficiency of the communication program.

[0080] Exemplarily, if a new communication protocol is added between the transmitting end and the receiving end, the candidate encoder corresponding to the new communication protocol is registered in the transmitting end, and the candidate decoder corresponding to the candidate encoder under the new communication protocol is registered in the receiving end. It should be noted that multiple candidate codecs corresponding to the new communication protocol can be registered in the transmitting end, and multiple candidate decoders corresponding to multiple candidate encoders can be registered in the receiving end. Among them, one candidate encoder corresponds to one candidate decoder.

[0081] After adding candidate encoders and candidate decoders, the sender can use the newly added candidate encoders to encode the original message to obtain the encoded message, and the receiver can use the candidate decoder to decode the encoded message to obtain the original message. Therefore, the communication between the sender and the receiver can be realized without redeveloping the communication protocol, thereby improving the development efficiency of the communication protocol.

[0082] As another example, if a new communication protocol is used to replace the original communication protocol between the sender and the receiver, the candidate encoder corresponding to the new communication protocol is registered in the sender, and the candidate decoder corresponding to the candidate encoder under the new communication protocol is registered in the receiver. After adding the candidate encoder and the candidate decoder, the sender can use the newly added candidate encoder to encode the original message to obtain the encoded message, and the receiver can use the candidate decoder to decode the encoded message to obtain the original message. Therefore, when the communication protocol between the sender and the receiver is replaced, the communication between the sender and the receiver can be achieved without redeveloping a new communication protocol, thereby improving the development efficiency of the communication protocol.

[0083] The message processing method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown in FIG. 1 , there are a source 10, a transmitter 11, a channel 12, a receiver 13 and a receiver 14. The source 10 is the origin of the message, and its function is to convert various messages into original electrical signals (called original messages or baseband signals). According to the different types of messages, the source can be divided into an analog source (analog signal) and a digital source (digital signal). The transmitter 11 matches the source with the channel, completes some transformation on the original signal, such as amplification, modulation, encoding, etc., and then enters the channel for transmission. The channel 12 is the medium for signal transmission, which is responsible for establishing a channel between the transmitter 11 and the receiver 13 to ensure the normal transmission of the signal. The function of the receiver 13 is to amplify and reversely transform, that is, to transform the previously transformed signal back, such as filtering, decoding, demodulation, etc., and its purpose is to restore the received signal to the original electrical signal. The receiver 14 is the destination of the transmitted information, and its function is to convert the original electrical signal into the corresponding information.

[0084] The transmitting end 11 can obtain the original message such as sound, data or image from the source 10, and determine the encoder from multiple candidate encoders based on the target message type of the original message and the first preset correspondence. The encoder can be used to encode the original message to obtain an encoded message, and transmit it to the receiving end 13 through the channel. The receiving end 13 restores the encoded message to the original message, and the receiving end 13 sends the original message to the recipient 14. Among them, the transmitting end 11 and the receiving end 13 can be, but are not limited to, various personal computers, laptops, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, smart car-mounted devices, etc. Portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc.

[0085] In one embodiment, Figure 2 As shown, Figure 2 is a flow chart of a message processing method provided by an embodiment of the present application, in which the method is applied to Figure 1 Taking the sending end in the example as an example, the sending end may be a debugging device, and the receiving end may be a debugged device; or the sending end may be a debugged device, and the receiving end may be a debugging device. The method may include the following steps:

[0086] S201, obtaining an original message and a target message type corresponding to the original message.

[0087] The original message may include data such as sound, data or image. In a possible implementation, the original message and the target message type corresponding to the original message may be data input by the user through an interface displayed on the sending end, and accordingly, the sending end may obtain the original message and the target message type input by the user through the interface.

[0088] In another possible implementation, the sending end may obtain the original message input by the user through voice, and determine the message type of the original message based on the obtained original message, and use the determined message type as the target message type.

[0089] In the embodiment of the present application, the original message and the target message type corresponding to the original message can be obtained by the client in the sending end. Alternatively, the original message is obtained by the client in the sending end, and the client sends the original message to the encoding manager in the sending end, and the encoding manager determines the message type of the original message.

[0090] S202, determining a target encoder from a plurality of candidate encoders based on a target message type and a first preset relationship; the first preset relationship includes a mapping relationship between a message type and a candidate encoder.

[0091] The transmitting end may determine the target encoder from a plurality of candidate encoders based on the target message type and the first preset relationship. For example, message type A corresponds to candidate encoder A, and message type B corresponds to candidate encoder B. If the target message type is message type A, candidate encoder A may be used as the target encoder. The candidate encoder may be developed based on the communication protocol required for communication.

[0092] In the embodiment of the present application, a target encoder can be determined from multiple candidate encoders by an encoding manager in the transmitting end. The encoding manager can manage the candidate encoders. Exemplarily, managing the candidate encoders may include registering new candidate encoders in the encoding manager, deleting candidate encoders, determining the target encoder based on the target message type, etc.

[0093] It should be noted that, when the sending end obtains the original message and the target message type corresponding to the original message, the sending end may determine the target encoder from multiple candidate encoders based on the target message type and the first preset relationship.

[0094] S203, using a target encoder to encode the original message to obtain an encoded message, and sending the encoded message to a receiving end, so that the receiving end uses a decoder corresponding to the target message type to decode the encoded message.

[0095] In the embodiment of the present application, the target encoder is used to encode the original message to obtain an encoded message, and the encoded message is sent to the receiving end, which can be achieved in the following way:

[0096] In a possible implementation, the sending end may use a target encoder to encode the original message to obtain an encoded message, the target encoder sends the encoded message to the sending end in the sending end, and the sending end sends the encoded message to the receiving end.

[0097] In another possible implementation, the sending end may use a target encoder to encode the original message to obtain an encoded message. The target encoder sends the encoded message to the encoding manager in the sending end, the encoding manager sends the encoded message to the sending end, and the sending end sends the encoded message to the receiving end.

[0098] It should be noted that the target encoder can encode the original message to obtain the encoded message, that is, each candidate encoder can realize the function of processing the original message and encoding the message obtained after the processing, and different candidate encodings can process the original message differently. Alternatively, the target encoder can encode the original message based on the encoder interface to obtain the encoded message.

[0099] Here, it is explained that the target encoder can be used to encode the original message based on the encoder interface to obtain the encoded message. The encoder interface is an interface implemented at the software encoding level. The encoder interface can realize the encoding function, and each candidate encoder can realize the processing function corresponding to the message type. In this way, the process of obtaining the encoded message can be that the candidate encoder processes the original message to obtain the processed message, and the encoder interface encodes the processed message to obtain the encoded message. In this case, each candidate encoder can reuse the software code of the encoder interface, and there is no need to repeatedly write the code for implementing the encoding function, thereby further improving the development efficiency of the communication program.

[0100] It should be noted that the processing functions of the candidate encoders are different, that is, different candidate encoders can process the original message differently. The encoder interface has an encoding processing function, and can perform the same encoding processing on the processed messages obtained after processing by different candidate encoders.

[0101] The message processing method provided in the embodiment of the present application obtains the original message and the target message type corresponding to the original message, determines the target encoder from multiple candidate encoders based on the target message type and the first preset relationship between the message type and the candidate encoder, uses the target encoder to encode the original message to obtain an encoded message, and sends the encoded message to the receiving end, so that the receiving end uses the decoder corresponding to the target message type to decode the encoded message. Since the embodiment of the present application determines the target encoder from multiple candidate encoders, uses the target encoder to encode the original message to obtain an encoded message, and sends the encoded message to the receiving end, the communication between the sending end and the receiving end can be realized, and different communication protocols can reuse the communication processing logic provided by this embodiment, and there is no need to develop corresponding communication programs separately for different communication protocols to realize the communication between the sending end and the receiving end, thereby improving the development efficiency of the communication protocol and reducing the error probability caused by redeveloping the communication protocol for different communication protocols.

[0102] In one embodiment, in order to quickly respond to demand changes, further improve the development efficiency of communication programs, and improve the stability and maintainability of communication programs, the present application implements a method for registering an encoder at the sending end, thereby implementing the expansion of the encoder to meet the needs of different communication protocols or expand multiple encoders under the same communication protocol. Figure 3 As shown, Figure 3 : is a flowchart of an encoder registration method provided in an embodiment of the present application, and the method may include the following steps:

[0103] S301, obtaining an encoder registration request.

[0104] The sending end can obtain the encoder registration request triggered by the user through the interface. Exemplarily, the user can input the encoder identifier of the encoder through the interface and click the confirmation button to trigger the encoder registration request. Accordingly, the sending end obtains the encoder registration request, so that the encoder indicated by the encoder registration request can be added to the sending end in response to the encoder registration request. Among them, the encoder registration request can include an encoder identifier, and the sending end adds the encoder identifier to the encoder identifier list maintained by itself, so that when a message type corresponding to the encoder identifier is subsequently matched, the encoder corresponding to the encoder identifier is used to process the original message corresponding to the message type.

[0105] S302: In response to the encoder registration request, add an encoder indicated by the encoder registration request in the transmitting end.

[0106] In the embodiment of the present application, in response to the encoder registration request, the encoder indicated by the encoder registration request can be added to the encoder manager of the transmitting end. The newly added encoder in the encoder manager is used as a candidate encoder, and the encoder manager can manage the candidate encoders.

[0107] The method provided in the embodiment of the present application obtains an encoder registration request, responds to the encoder registration request, and adds an encoder indicated by the encoder registration request in the transmitting end, so that the newly added encoder adapts to the new message type, realizes the processing and encoding function of the original message corresponding to the new message type, and is easy to realize message expansion. In addition, the newly added encoder can realize new functions, has high encoder expansion flexibility, can quickly respond to demand changes, and has strong stability and maintainability.

[0108] In one embodiment, the above S202, determining the target encoder from multiple candidate encoders based on the target message type and the first preset relationship, can be implemented in the following manner:

[0109] The encoding manager is called to determine a target encoder from a plurality of candidate encoders based on the target message type and a first preset relationship.

[0110] A coding manager may be implemented in the transmitting end, and the coding manager is called to determine the target encoder from multiple candidate encoders based on the target message type and the first preset relationship, that is, the coding manager determines the target encoder from multiple candidate encoders based on the target message type and the first preset relationship. Since the implementation of the coding manager does not affect other communication logics, the communication process is decoupled, so that the communication logics of each part do not affect each other.

[0111] The method provided in the embodiment of the present application determines the target encoder from multiple candidate encoders based on the target message type and the first preset relationship by calling the encoding manager, thereby implementing the management of the candidate encoders by the encoding manager and facilitating the expansion of the encoder.

[0112] In one embodiment, the above S201 can be implemented as follows:

[0113] Calling the first message call method passes the original message and the target message type to the encoding manager.

[0114] The sending end may store a first message calling method, and the original message and the target message type are passed to the encoding manager through the first message calling method.

[0115] The method provided in the embodiment of the present application realizes passing the original message and the target message type to the encoding manager by calling the first message calling method, thereby facilitating the encoding manager to determine the target encoder from multiple candidate encoders based on the target message type and the first preset relationship.

[0116] In one embodiment, Figure 4 As shown, Figure 4 201 is a flowchart of another method for obtaining the type of original message and target message provided in an embodiment of the present application. The above S201 may include the following steps:

[0117] S401, calling a second message calling method to pass the original message to the message manager.

[0118] The sending end may maintain a second message calling method, and the sending end may call the second message calling method to pass the original message to the message manager.

[0119] S402, calling the message manager to pass the original message and the target message type of the original message to the encoding manager using a parameter passing method.

[0120] The parameter transfer method can be maintained in the message manager. After the message manager obtains the original message, it can determine the target message type of the original message, and use the parameter transfer method to transfer the original message and the target message type of the original message to the encoding manager, so that the encoding manager can determine the target encoder from multiple candidate encoders based on the target message type and the first preset relationship.

[0121] Since the implementation of the message manager and the encoding manager does not affect other communication logics, the communication process is decoupled so that the communication logics of each part do not affect each other.

[0122] The method provided in the embodiment of the present application passes the original message to the message manager by calling the second message calling method, and the message manager is called to use the parameter passing method to pass the original message and the target message type of the original message to the encoding manager, thereby realizing the passing of the original message and the target message type of the original message to the encoding manager, so that the encoding manager can determine the target encoder from multiple candidate encoders based on the target message type and the first preset relationship.

[0123] In one embodiment, Figure 5 As shown, Figure 5 This is a flowchart of a method added in a sending end provided in an embodiment of the present application. The method may include the following steps:

[0124] S501, in response to a first adding request, adding a new message calling method indicated by the first adding request in the sending end.

[0125] The first adding request may indicate adding a new message calling method, and the new message calling method may be a new first message calling method or a new second message calling method.

[0126] The user can input the identifier of the new message calling method in the interface of the sending end, and the sending end obtains the identifier and adds the new message calling method indicated by the identifier.

[0127] S502: In response to the second adding request, the message manager adds a new parameter transfer method indicated by the second adding request in the message manager.

[0128] The second addition request can indicate the addition of a new parameter passing method. After the second message calling method is pre-set, a parameter passing method can be selected from multiple parameter passing methods, and the selected parameter passing method can be used in conjunction with the pre-set second message calling method, that is, the pre-set second message calling method is used to obtain the original message, and the calling message manager uses the selected parameter passing method to pass the original message and the target message type of the original message to the encoding manager.

[0129] The user can input the identifier of the new message calling method in the interface of the sending end, and the sending end obtains the identifier and adds the new message calling method indicated by the identifier. The new message calling method indicated by the identifier can be added in the sending end.

[0130] The method provided in the embodiment of the present application achieves the expansion of the message calling method and the parameter passing method by responding to the first add request by adding a new message calling method indicated by the first add request in the sending end, and responding to the second add request by the message manager by adding a new parameter passing method indicated by the second add request in the message manager.

[0131] In some embodiments, the above-mentioned sending of the encoded message to the receiving end can be implemented in the following manner:

[0132] In a possible implementation manner, the sending end sends the encoded message to the receiving end through a network port channel.

[0133] In another possible implementation, the sending end sends the encoded message to the receiving end through a serial port channel.

[0134] The implementation method to be adopted can be combined with specific actual needs. If serial port communication is adopted between the sending end and the receiving end, the serial port channel is used to send the encoded message to the receiving end; if network port communication is adopted between the sending end and the receiving end, the network port channel is used to send the encoded message to the receiving end.

[0135] A channel interface can be implemented between the sending end and the receiving end, and the channel interface can call different channel communication methods to send the encoded message to the receiving end. Exemplarily, the channel interface can call the serial port communication method to send the encoded message to the receiving end through the serial port channel; or, call the network port communication method through the channel interface to send the encoded message to the receiving end through the network port channel.

[0136] The implementation of the channel interface does not affect other communication logics, and the communication process is decoupled, so that each part of the communication logic does not affect each other. If the channel needs to be replaced, it is only necessary to re-implement the channel communication method corresponding to the replaced channel, and other communication logic does not need to be changed. It can be seen that if the channel requirements change, it is only necessary to re-implement the channel communication method, and no other communication logic needs to be changed. Therefore, the development efficiency of the communication program is improved, and it can quickly respond to changes in requirements, with strong stability and maintainability. Figure 6 As shown, Figure 6 1 is a schematic diagram of a channel replacement process provided by an embodiment of the present application. If the communication between the transmitting end 11 and the receiving end 13 is previously implemented through the channel 12, if the channel 12 is replaced with the channel 15, the communication between the transmitting end 11 and the receiving end 13 is implemented through the channel 15. Figure 6The “×” between the transmitting end 11 and the channel 12 and the “×” between the channel 12 and the receiving end 13 indicate that the communication between the transmitting end 11 and the receiving end 13 through the channel 12 is no longer used.

[0137] The method provided in the embodiment of the present application uses a target encoder to encode the original message to obtain an encoded message, and sends the encoded message to the client through the message manager, and then calls the client to send the encoded message to the receiving end, thereby realizing communication between the sending end and the receiving end. By using the template method to solidify the communication processing logic between the receiving end and the sending end, the reuse rate of the communication code is improved.

[0138] In one embodiment, the above-mentioned step S203 uses a target encoder to encode the original message to obtain an encoded message, which can be implemented in the following manner:

[0139] The target encoder is used to encode the original message based on the encoder interface to obtain an encoded message.

[0140] The method provided in the embodiment of the present application adopts a target encoder to encode the original message based on the encoder interface to obtain an encoded message. Since the implementation of the encoder interface does not affect other communication logics, the communication process is decoupled so that the communication logics of each part do not affect each other. In addition, the target encoder encodes the original message based on the encoder interface to obtain an encoded message, which can improve the code reuse rate of the encoder interface and further improve the development efficiency of the communication program.

[0141] In one embodiment, Figure 7 As shown, Figure 7 is a flow chart of another message processing method provided in an embodiment of the present application, in which the method is applied to Figure 1 The receiving end in the example is used to illustrate this method. Figure 2 The method provided in the corresponding embodiment corresponds to the method comprising the following steps:

[0142] S701, receiving a coded message sent by a sending end.

[0143] The encoded message is obtained by the sender encoding the original message using a target encoder. The target encoder is determined by the sender from multiple candidate encoders based on the target message type of the original message and a first preset relationship. The first preset relationship includes a mapping relationship between the message type and the candidate encoders.

[0144] S702, determining a target decoder from a plurality of candidate decoders based on the target message type and a second preset relationship; the second preset relationship includes a mapping relationship between the message type and the candidate decoders.

[0145] The receiving end may determine the target decoder from multiple candidate decoders based on the target message type and the second preset relationship. For example, message type A corresponds to candidate decoder A, message type B corresponds to candidate decoder B, and if the target message type is message type A, candidate decoder A may be used as the target decoder. Among them, the candidate decoders may be developed based on the communication protocol required for communication, thereby meeting the requirements of different communication protocols.

[0146] In an embodiment of the present application, a target decoder can be determined from multiple candidate decoders by a decoding manager in a receiving end. The decoding manager can manage the candidate decoders. Exemplarily, managing the candidate decoders can include registering a new candidate decoder in the decoding manager, deleting a candidate decoder, determining the target decoder based on the target message type, etc.

[0147] S703, using a target decoder to decode the encoded message to obtain an original message.

[0148] The method provided in the embodiment of the present application receives the encoded message sent by the sender, determines the target decoder from multiple candidate decoders based on the target message type and the mapping relationship between the message type and the candidate decoder, and uses the target decoder to decode the encoded message to obtain the original message.

[0149] In one embodiment, Figure 8 As shown, Figure 8 : is a flowchart of a decoder registration method provided by an embodiment of the present application, and the method may include the following steps:

[0150] S801, obtaining a decoder registration request.

[0151] The receiving end can obtain the decoder registration request triggered by the user through the interface. Exemplarily, the user can input the decoder identifier of the decoder through the interface and click the confirmation button to trigger the decoder registration request. Accordingly, the receiving end obtains the decoder registration request, so that the decoder indicated by the decoder registration request can be added to the receiving end in response to the decoder registration request. Among them, the decoder registration request can include a decoder identifier, and the receiving end adds the decoder identifier to the decoder identifier list maintained by itself, so that when a message type corresponding to the decoder identifier is subsequently matched, the decoder corresponding to the decoder identifier is used to process the original message corresponding to the message type.

[0152] S802: In response to the decoder registration request, add a decoder indicated by the decoder registration request in the receiving end.

[0153] In the embodiment of the present application, in response to the decoder registration request, the decoder indicated by the decoder registration request can be added to the decoding manager of the receiving end. The newly added decoder in the decoding manager is used as a candidate decoder, and the decoding manager can manage the candidate decoders.

[0154] The method provided in the embodiment of the present application obtains a decoder registration request, responds to the decoder registration request, and adds a decoder indicated by the decoder registration request in the receiving end, so that the newly added decoder adapts to the new message type, and processes the encoded message corresponding to the new message type, which is easy to implement message expansion. In addition, the newly added decoder can realize new functions, has high decoder expansion flexibility, can quickly respond to demand changes, and has strong stability and maintainability.

[0155] In one embodiment, the above S803, determining the target decoder from multiple candidate decoders based on the target message type and the second preset relationship, can be implemented in the following manner:

[0156] The decoding manager is called to determine a target decoder from a plurality of candidate decoders based on the target message type and a second preset relationship.

[0157] A decoding manager can be implemented in the receiving end, and the decoding manager is called to determine the target decoder from multiple candidate decoders based on the target message type and the second preset relationship. That is, the decoding manager determines the target decoder from multiple candidate decoders based on the target message type and the second preset relationship. Since the implementation of the decoding manager does not affect other communication logics, the communication process is decoupled so that each part of the communication logic does not affect each other.

[0158] The method provided in the embodiment of the present application determines the target decoder from multiple candidate decoders based on the target message type and the second preset relationship by calling the decoding manager, thereby implementing the management of the candidate decoders by the decoding manager and facilitating the expansion of the decoder.

[0159] In one embodiment, Fig. 9 As shown, Fig. 9 1 is a flow chart of a method for communication between a transmitting end and a receiving end provided in an embodiment of the present application. The method may include the following steps:

[0160] S901, the sending end calls a message calling method to pass the original message to the message manager.

[0161] S902, the sending end calls the message manager to pass the original message and the target message type of the original message to the encoding manager using a parameter passing method.

[0162] S903: The sending end calls the encoding manager to determine a target encoder from multiple candidate encoders based on the target message type and the first preset relationship.

[0163] S904, using a target encoder to encode the original message based on an encoder interface to obtain an encoded message.

[0164] S905, the sending end sends the encoded message to the receiving end through the channel interface between the sending end and the receiving end.

[0165] S906: The receiving end receives the encoded message sent by the sending end.

[0166] S907: The receiving end calls a decoding manager to determine a target decoder from a plurality of candidate decoders based on the target message type and the second preset relationship.

[0167] S908, the receiving end uses the target decoder to decode the encoded message to obtain the original message.

[0168] Among them, the message manager, encoding manager, channel interface, and decoding manager are all reusable communication components. The communication components do not adopt the MVC architecture. The communication components of the embodiments of the present application are not only applicable to the browser and server (Browser / Server Architecture, BS) architecture, but also to the server / client (Client / Server, C / S) architecture, which expands the scope of application of the communication components.

[0169] The method provided in the embodiment of the present application realizes communication between the sending end and the receiving end by adding a coding manager and a message manager at the sending end and a decoding manager at the receiving end. Since the communication logic between the sending end and the receiving end is solidified, the reusability of the communication code is improved. By updating the channel, encoder, and decoder, it can quickly respond to changes in requirements and has strong stability and maintainability.

[0170] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0171] Based on the same inventive concept, the embodiment of the present application also provides a message processing device for implementing the message processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the one or more message processing device embodiments provided below can refer to the limitations on the message processing method above, and will not be repeated here.

[0172] In one embodiment, Fig.10 As shown, Fig.10 It is one of the structural block diagrams of the message processing device provided in the embodiment of the present application. The device 1000 is arranged at the sending end, and the device 1000 includes:

[0173] The first acquisition module 1001 is used to acquire an original message and a target message type corresponding to the original message;

[0174] A determination module 1002 is used to determine a target encoder from a plurality of candidate encoders based on a target message type and a first preset relationship; the preset relationship includes a mapping relationship between a message type and a candidate encoder;

[0175] The encoding module 1003 is used to encode the original message using a target encoder to obtain an encoded message, and send the encoded message to the receiving end so that the receiving end uses a decoder corresponding to the target message type to decode the encoded message.

[0176] In one embodiment, Fig.11 As shown, Fig.11 This is a second structural block diagram of a message processing device provided in an embodiment of the present application. The device 1100 includes:

[0177] The second acquisition module 1101 is used to obtain an encoder registration request;

[0178] The first adding module 1102 is configured to, in response to the encoder registration request, add an encoder indicated by the encoder registration request in the transmitting end.

[0179] In one embodiment, the determination module 1002 is specifically configured to call the encoding manager to determine a target encoder from a plurality of candidate encoders based on the target message type and the first preset relationship.

[0180] In one embodiment, the first acquisition module 1001 is specifically configured to call a first message calling method to pass the original message and the target message type to the encoding manager.

[0181] In one embodiment, the first acquisition module 1001 is specifically used to call the second message calling method to pass the original message to the message manager; the calling message manager adopts the parameter passing method to pass the original message and the target message type of the original message to the encoding manager.

[0182] In one embodiment, Fig.12 As shown, Fig.12 This is a structural block diagram of the message processing device provided in the embodiment of the present application. The device 1200 includes:

[0183] The second adding module 1201 is used to respond to the first adding request and add a new message calling method indicated by the first adding request in the sending end;

[0184] The third adding module 1202 is used to respond to the second adding request through the message manager and add a new parameter transfer method indicated by the second adding request in the message manager.

[0185] In one embodiment, the encoding module 1003 is specifically configured to use a target encoder to encode the original message based on an encoder interface to obtain an encoded message.

[0186] In one embodiment, Fig.13 As shown, Fig.13 1300 is a structural block diagram of a message processing device provided in an embodiment of the present application. The device 1300 is arranged at a receiving end, and the device 1300 includes:

[0187] The receiving module 1301 is used to receive an encoded message sent by a sending end; the encoded message is obtained by the sending end by encoding the original message using a target encoder, and the target encoder is determined by the sending end from multiple candidate encoders based on the target message type of the original message and a first preset relationship, and the first preset relationship includes a mapping relationship between the message type and the candidate encoder;

[0188] A determination module 1302, configured to determine a target decoder from a plurality of candidate decoders based on a target message type and a second preset relationship; the second preset relationship comprising a mapping relationship between a message type and a candidate decoder;

[0189] The decoding module 1303 is used to decode the encoded message using a target decoder to obtain an original message.

[0190] In one embodiment, Fig.14 As shown, Fig.14 This is a fifth structural block diagram of a message processing device provided in an embodiment of the present application. The device 1400 includes:

[0191] An acquisition module 1401 is used to acquire a decoder registration request;

[0192] The adding module 1402 is used to respond to the decoder registration request and add the decoder indicated by the decoder registration request in the receiving end.

[0193] In one embodiment, the determination module 1302 is specifically configured to call a decoding manager to determine a target decoder from a plurality of candidate decoders based on the target message type and a second preset relationship.

[0194] In one embodiment, the decoding module 1303 is specifically configured to use a target decoder to decode the encoded message based on a decoder interface to obtain an original message.

[0195] Each module in the above message processing device can be implemented in whole or in part by software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module above.

[0196] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.15 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a message processing method is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0197] Those skilled in the art will understand that Fig.15 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0198] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the steps provided in any of the above method embodiments are implemented.

[0199] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps provided in any of the above method embodiments are implemented.

[0200] In one embodiment, a computer program product is provided, including a computer program, which implements the steps provided in any of the above method embodiments when executed by a processor.

[0201] 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, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0202] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile 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), magnetoresistive 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. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

[0203] The technical features of the above embodiments may be arbitrarily combined. To make the description concise, 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 specification.

[0204] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them; although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application, and they should all be included in the scope of the claims and specification of the present application. In particular, as long as there is no structural conflict, the various technical features mentioned in the various embodiments can be combined in any way. The present application is not limited to the specific embodiments disclosed herein, but includes all technical solutions that fall within the scope of the claims.

Claims

1. A message processing method, characterized in that: Applied to the sending end, the method includes: Obtain an original message and a target message type corresponding to the original message; Determining a target encoder from a plurality of candidate encoders based on the target message type and a first preset relationship; the first preset relationship comprising a mapping relationship between a message type and a candidate encoder; The target encoder is used to encode the original message to obtain an encoded message, and the encoded message is sent to a receiving end, so that the receiving end uses a decoder corresponding to the target message type to decode the encoded message.

2. The method according to claim 1, characterized in that The method further comprises: Get the encoder registration request; In response to the encoder registration request, an encoder indicated by the encoder registration request is added to the transmitting end.

3. The method according to claim 1 or 2, characterized in that: The step of determining a target encoder from a plurality of candidate encoders based on the target message type and the first preset relationship includes: The calling encoding manager determines the target encoder from a plurality of candidate encoders based on the target message type and the first preset relationship.

4. The method according to claim 3, characterized in that The obtaining of the original message and the target message type corresponding to the original message includes: Invoking the first message invocation method passes the original message and the target message type to the encoding manager.

5. The method according to claim 3, characterized in that: The obtaining of the original message and the target message type corresponding to the original message includes: Calling a second message calling method to pass the original message to the message manager; The message manager is called to pass the original message and the target message type of the original message to the encoding manager using a parameter passing method.

6. The method according to claim 4 or 5, characterized in that: The method further comprises: In response to the first adding request, adding a new message calling method indicated by the first adding request in the sending end; In response to the second adding request, the message manager adds a new parameter transfer method indicated by the second adding request in the message manager.

7. The method according to claim 1 or 2, characterized in that: The step of encoding the original message by the target encoder to obtain an encoded message includes: The target encoder is used to encode the original message based on an encoder interface to obtain an encoded message.

8. A message processing method, characterized in that: Applied to the receiving end, the method includes: Receive an encoded message sent by a sending end; the encoded message is obtained by the sending end encoding an original message using a target encoder, and the target encoder is determined by the sending end from multiple candidate encoders based on a target message type of the original message and a first preset relationship, wherein the first preset relationship includes a mapping relationship between a message type and a candidate encoder; Determining a target decoder from a plurality of candidate decoders based on the target message type and a second preset relationship; wherein the second preset relationship includes a mapping relationship between the message type and the candidate decoders; The target decoder is used to decode the encoded message to obtain the original message.

9. The method according to claim 8, characterized in that The method further comprises: Get decoder registration request; In response to the decoder registration request, a decoder indicated by the decoder registration request is added in the receiving end.

10. The method according to claim 8 or 9, characterized in that: The step of determining a target decoder from a plurality of candidate decoders based on the target message type and the preset relationship comprises: The decoding manager is called to determine the target decoder from a plurality of candidate decoders based on the target message type and the second preset relationship.

11. The method according to claim 8 or 9, characterized in that: The step of decoding the encoded message using the target decoder to obtain the original message includes: The target decoder is used to decode the encoded message based on a decoder interface to obtain the original message.

12. A message processing device, characterized in that: Set at the sending end, the device includes: A first acquisition module, used to acquire an original message and a target message type corresponding to the original message; A determination module, configured to determine a target encoder from a plurality of candidate encoders based on the target message type and a first preset relationship; the preset relationship includes a mapping relationship between a message type and a candidate encoder; The encoding module is used to encode the original message using the target encoder to obtain an encoded message, and send the encoded message to the receiving end so that the receiving end uses a decoder corresponding to the target message type to decode the encoded message.

13. A message processing device, characterized in that: Set at the receiving end, the device includes: A receiving module, configured to receive an encoded message sent by a sending end; the encoded message is obtained by the sending end by encoding an original message using a target encoder, the target encoder is determined by the sending end from a plurality of candidate encoders based on a target message type of the original message and a first preset relationship, the first preset relationship comprising a mapping relationship between a message type and a candidate encoder; A determination module, configured to determine a target decoder from a plurality of candidate decoders based on the target message type and a second preset relationship; the second preset relationship comprising a mapping relationship between a message type and a candidate decoder; A decoding module is used to decode the encoded message using the target decoder to obtain the original message.

14. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 11 are implemented.

15. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.

16. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.