CN112039751B - Communication message sending method and device - Google Patents
Communication message sending method and device Download PDFInfo
- Publication number
- CN112039751B CN112039751B CN202010713843.1A CN202010713843A CN112039751B CN 112039751 B CN112039751 B CN 112039751B CN 202010713843 A CN202010713843 A CN 202010713843A CN 112039751 B CN112039751 B CN 112039751B
- Authority
- CN
- China
- Prior art keywords
- message
- parameter information
- sending
- tcp
- communication
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/06—Message adaptation to terminal or network requirements
- H04L51/066—Format adaptation, e.g. format conversion or compression
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L51/00—User-to-user messaging in packet-switching networks, transmitted according to store-and-forward or real-time protocols, e.g. e-mail
- H04L51/56—Unified messaging, e.g. interactions between e-mail, instant messaging or converged IP messaging [CPM]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The invention discloses a method and a device for sending communication messages, relates to the technical field of communication, and aims to solve the problem that the waiting response time is long when the communication messages of various communication software are sent in the prior art. The method mainly comprises the following steps: acquiring parameter information in a TCP buffer, wherein the parameter information comprises a service path, a receiver and message content; judging the message type of the parameter information according to the service path; extracting the configuration of the server corresponding to the message type according to a preset type configuration comparison table; according to the coding format of the message type, combining the server configuration, the receiver and the message content to generate a message code; and sending the message code according to a TCP protocol. The invention is mainly applied to the process of sending the communication message.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for sending a communication message.
Background
In the process of life and office, communication messages are often required to be sent through various communication software. In the process of using multiple communication software, because the communication software which needs to send communication messages has multiple types, the message quantity of each communication software is large, and files may need to be transferred between different communication software, a user needs to frequently switch the communication software and spend a large amount of waiting response time to send all real-time messages, and the experience of the user is poor.
Disclosure of Invention
In view of the above, the present invention provides a method and an apparatus for sending a communication message, and mainly aims to solve the problem of long waiting time when sending communication messages of multiple communication software in the prior art.
According to an aspect of the present invention, there is provided a method for sending a communication message, including:
acquiring parameter information in a TCP buffer, wherein the parameter information comprises a service path, a receiver and message content;
judging the message type of the parameter information according to the service path;
extracting the configuration of the server corresponding to the message type according to a preset type configuration comparison table;
according to the coding format of the message type, combining the server configuration, the receiver and the message content to generate a message code;
the message code is sent according to the TCP protocol.
According to another aspect of the present invention, there is provided a communication message transmitting apparatus, including:
the first acquisition module is used for acquiring parameter information in a TCP buffer, wherein the parameter information comprises a service path, a receiver and message content;
the judging module is used for judging the message type of the parameter information according to the service path;
The extraction module is used for extracting the configuration of the server side corresponding to the message type according to a preset type configuration comparison table;
a merging module, configured to merge the server configuration, the receiver, and the message content according to the coding format of the message type, so as to generate a message code;
and the sending module is used for sending the message code according to the TCP protocol.
According to still another aspect of the present invention, a computer storage medium is provided, wherein at least one executable instruction is stored in the computer storage medium, and the executable instruction causes a processor to execute an operation corresponding to the method for sending the communication message.
According to still another aspect of the present invention, there is provided a computer apparatus including: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the communication message sending method.
By the technical scheme, the technical scheme provided by the embodiment of the invention at least has the following advantages:
The invention provides a method and a device for sending communication messages, which are characterized in that parameter information in a TCP buffer area is firstly obtained, then the message type of the parameter information is judged according to a service path in the parameter information, server configuration corresponding to the message type is extracted according to a preset type configuration comparison table, each part in the parameter information is merged according to the coding format of the message type to generate a message code, and finally the message code is sent according to a TCP protocol. Compared with the prior art, the embodiment of the invention acquires the parameter information from the TCP buffer area no matter what message type the parameter information belongs to, repackages the parameter information, uniformly generates and sends the message code, avoids the problem that when sending the communication messages of different message types, the sending end is continuously switched, the message to be sent can be recorded only by waiting for the response of the communication software, the waiting response time is longer when switching different communication software, and a plurality of processes needing response are added for the background of system operation in the switching process, which is not beneficial to the optimal allocation of resources.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
fig. 1 is a flowchart illustrating a method for sending a communication message according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating another method for sending a communication message according to an embodiment of the present invention;
fig. 3 is a block diagram illustrating a communication message sending apparatus according to an embodiment of the present invention;
fig. 4 is a block diagram illustrating another communication message sending apparatus according to an embodiment of the present invention;
fig. 5 shows a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
Communication information sent between users often depends on communication application programs, communication information sent by different communication application programs has different characteristics, and in order to meet the use requirements of the users, the users often need to switch among different communication application programs according to various communication application programs in the use process. The communication application program comprises, but is not limited to, a nail, a WeChat, a mail, a QQ, a Payment treasure and the like, and calls an SDK package or an application program interface API of the communication application program when sending the communication message. If each communication application program usually has its own standard specification, the developer calls the SDK or API to send a message, specifically including filling in the development information specified by the communication application program developer, then coding according to the API given by the communication application program developer, or downloading the official SDK, then configuring various parameters, and finally testing, if successful, the message generation sending of the communication application program can be realized. In the process of butting a developer and a sending end of a communication application program, access of one module from beginning to end is often needed, a large amount of repeated codes need to be compiled, redundancy work is more, and manpower and material resources are consumed more.
An embodiment of the present invention provides a method for sending a communication message, as shown in fig. 1, where the method includes:
101. and acquiring parameter information in the TCP buffer.
The TCP protocol is used for end-to-end data transmission, so that a transmitting end and a receiving end are provided, each corresponding TCP Socket connection is provided with a transmitting buffer area and a receiving buffer area in a kernel, before the data is transmitted through the TCP protocol, the data is written into the TCP buffer area, and then the data is transmitted to a destination end through the TCP protocol.
Acquiring parameter information in the TCP buffer, namely acquiring related information of a communication message to be sent, wherein the specific parameter information comprises a service path, a receiver and message content. The service path is a sending service port of the communication message, and is illustratively http:// ip: port/con/notice/mail. The receiver is a receiver of the communication message, the data form of the receiver corresponds to the service path, and illustratively, on the basis of the service path, the receiver is 7754wq21@163. com. Message content refers to the actual content that needs to be sent. The message content may be one or more of text, pictures, voice, documents, or video. The message content corresponds to the messaging mode set by the application program, and if the communication message is an email message, the message content includes a subject, text content and/or an attachment document.
102. And judging the message type of the parameter information according to the service path.
And extracting key information in the service path according to the preset key words, and judging the message type of the parameter information according to the key information. Illustratively, the service path is http:// ip: port/conch/notice/mail, the keyword "mail" in the service path is extracted, and the message type is judged to be "mail" according to the keyword "mail".
103. And extracting the configuration of the server corresponding to the message type according to a preset type configuration comparison table.
And the preset type configuration comparison table is used for storing the corresponding relation between the message type and the server configuration. And extracting the server configuration corresponding to the message type from a barrel preset message type configuration comparison table. If the message type is a mail, the server configuration includes a mail server address spring.mail.host ═ smtp.xxx.cn, a mail server password spring.mail.mail.password ═ xxx, a mail server development port spring.mail.port ═ 25, and a mail server user name spring.mail.user name ═ alias @ xxx.cn.
104. And combining the configuration of the server, the receiver and the message content according to the coding format of the message type to generate a message code.
The coding format of the message type refers to a characteristic format of the communication message, the server configuration, the receiver and the message content are respectively compiled according to the coding format, and then the message codes are sequentially called to be generated and assembled into a uniform message format.
105. The message code is sent according to the TCP protocol.
The TCP protocol is a connection-oriented, reliable, byte stream based transport layer communication protocol, which is an end-to-end byte stream transport protocol. The message code is sent according to the TCP protocol.
The invention can be regarded as a black box, encapsulates the sending method of the communication message, only reserves the interface service for connecting the parameter information, obtains the parameter information of the TCP buffer area through the interface service, and the user can send the communication message by introducing the corresponding parameter information, such as sending a mail, sending a nail message, sending a WeChat message and the like.
The invention provides a method for sending communication messages, which comprises the steps of firstly obtaining parameter information in a TCP buffer area, then judging the message type of the parameter information according to a service path in the parameter information, then extracting service terminal configuration corresponding to the message type according to a preset type configuration comparison table, merging all parts in the parameter information according to the coding format of the message type to generate message codes, and finally sending the message codes according to a TCP protocol. Compared with the prior art, the embodiment of the invention acquires the parameter information from the TCP buffer area no matter what message type the parameter information belongs to, repackages the parameter information, uniformly generates and sends the message code, avoids the problem that when sending the communication messages of different message types, the sending end is continuously switched, the message to be sent can be recorded only by waiting for the response of the communication software, the waiting response time is longer when switching different communication software, and a plurality of processes needing response are added for the background of system operation in the switching process, which is not beneficial to the optimal allocation of resources.
An embodiment of the present invention provides another method for sending a communication message, as shown in fig. 2, where the method includes:
201. and acquiring the parameter information through an application program interface.
The application program interface in the invention is a data transmission channel for acquiring parameter information, and is a calling interface for program developers to test the invention or users to use the invention.
Designing a message sending interface, configuring the message sending interface through the interface parameters, and facing the user with the interface. The message sending interface is provided with the function keys, so that the requirement on a user is reduced, the operability of the user is enhanced, and the popularization rate of the invention is improved.
202. And calculating the serialization parameters of the parameter information according to a preset algorithm.
Serialization refers to the process of converting Java objects into byte sequences, and more specifically, the process of converting the state information of objects into a form of storage or transmission. During serialization, the object writes its current state to a temporary or persistent store. The most important role of serialization is to guarantee the integrity and transferability of objects.
In serializing the parameters of the parameter information, the preset algorithm may include: the conversion is carried out in a java primary flow mode, a jackson packet is used for conversion through an Objectmapper class, fastjson is used for conversion, and a protocol buffer structured data storage format is used for conversion. Where fastjson is a Json parser and generator implemented by the Java language. The Protobuff serialized objects can be compressed to a great extent, the data transmission size can be greatly reduced, and the system performance is improved. In the embodiment of the present invention, a preset algorithm for calculating the serialization parameters of the parameter information is not limited.
203. And sending the serialization parameters to a TCP buffer area.
204. And acquiring the serialization parameters in the TCP buffer.
The TCP protocol is used for end-to-end data transmission, so that a transmitting end and a receiving end are provided, each corresponding TCP Socket connection is provided with a transmitting buffer area and a receiving buffer area in a kernel, before the data is transmitted through the TCP protocol, the data is written into the TCP buffer area, and then the data is transmitted to a destination end through the TCP protocol. The serialization parameters correspond to parameter information including service path, recipient and message content.
205. And performing deserialization calculation on the serialized parameters to acquire parameter information.
Deserialization, which is the restoration of a byte sequence to a Java object, has the effect of reconstructing the object by deserialization based on the state of the object and description information stored in the bytes. And performing deserialization calculation on the serialized parameters according to the process of calculating the serialized parameters by a preset algorithm to acquire parameter information. The parameter information includes a service path, a recipient, and message content.
206. And judging the message type of the parameter information according to the service path.
And extracting key information in the service path according to the preset key words, and judging the message type of the parameter information according to the key information. Illustratively, the service path is http:// ip: port/conch/notice/mail, the keyword "mail" in the service path is extracted, and the message type is judged to be "mail" according to the keyword "mail".
207. And importing server configurations corresponding to all message types, and generating a preset type configuration comparison table.
And in the configuration center, storing all server configurations, and importing the corresponding server configurations according to all message types of user requirements set by the user terminal. The configuration center is an open source configuration management center, can be used for centrally managing the configurations of different environments and different clusters, can be pushed to an application end in real time after configuration modification, and has the characteristics of standard authority, flow management and the like. For example, the configuration center may be an Apollo configuration center, where the stored server configuration is a read-only variable independent of the program, and may be loaded in various ways. The loading mode includes a program internal hard code, a configuration file, an environment variable, a starting parameter or a database, and is not limited in the embodiment of the present invention. And importing the configuration of the service end from the configuration center, and generating a preset type configuration comparison table comprising all message types.
208. And extracting the configuration of the server corresponding to the message type according to a preset type configuration comparison table.
And the preset type configuration comparison table is used for storing the corresponding relation between the message type and the server configuration. And extracting the server configuration corresponding to the message type from a barrel preset message type configuration comparison table. If the message type is a mail, the server configuration includes a mail server address spring.mail.host ═ smtp.xxx.cn, a mail server password spring.mail.mail.password ═ xxx, a mail server development port spring.mail.port ═ 25, and a mail server user name spring.mail.user name ═ alias @ xxx.cn.
209. And according to the coding format of the message type, combining the configuration of the server side, the receiver side and the message content to generate a message code.
The coding format of the message type refers to a characteristic format of the communication message, the server configuration, the receiver and the message content are respectively compiled according to the coding format, and then the message codes are sequentially called to be generated and assembled into a uniform message format.
After generating the message code, further comprising: checking the message code according to a preset sending rule, wherein the preset sending rule comprises a naming rule of a receiver and an identifiable rule of message content; if the checking result is correct, sending a message code according to a TCP (transmission control protocol); and if the verification result is incorrect, generating alarm information, and combining the configuration of the server, the theme, the receiver and the message content according to the coding format of the message type again to generate a message code.
After the message code is generated, the message code is checked to ensure that the message code conforms to a message sending format, so that the success rate of sending the message code is improved. In the checking process, the recipient name and the identifiability of the message content need to be checked. And if the verification result is correct, performing the next operation, if the verification result is incorrect, regenerating the message code, and performing verification again after regenerating the message code. In the re-authentication process, the number of repetitions of regenerating the message code may be counted, and the message code may be regenerated again if the number of repetitions does not exceed a preset number. In the verification process, the error reason of the error checking part is included in the alarm information.
210. The message code is sent according to the TCP protocol.
The TCP protocol is a connection-oriented, reliable, byte-stream based transport layer communication protocol, which is an end-to-end byte-stream transport protocol. The message code is sent according to the TCP protocol. After sending the message, the method further comprises: and acquiring a feedback message of the message code, and displaying the feedback message on the user terminal. The feedback message may be a text, an icon, a sound, etc., and the form of the feedback message is not limited in the embodiment of the present invention.
The invention can be regarded as a black box, encapsulates the sending method of the communication message, provides interface service which is configured in an interface mode and only reserves the butt-joint parameter information for the outside, completely butts developers of most communication application programs in the market, adopts a distributed architecture and containerized deployment, obtains the parameter information of a TCP buffer area through the interface service, and can realize the sending of the communication message by the user by inputting the corresponding parameter information, thereby realizing the sending of the message with high availability and low delay, reducing the cost of developers to the maximum extent and improving the development efficiency.
The invention provides a method for sending communication messages, which comprises the steps of firstly obtaining parameter information in a TCP buffer area, then judging the message type of the parameter information according to a service path in the parameter information, then extracting service terminal configuration corresponding to the message type according to a preset type configuration comparison table, merging all parts in the parameter information according to the coding format of the message type to generate message codes, and finally sending the message codes according to a TCP protocol. Compared with the prior art, the embodiment of the invention acquires the parameter information from the TCP buffer area no matter what message type the parameter information belongs to, repackages the parameter information, uniformly generates and sends the message code, avoids the problem that when sending the communication messages of different message types, the sending end is continuously switched, the message to be sent can be recorded only by waiting for the response of the communication software, the waiting response time is longer when switching different communication software, and a plurality of processes needing response are added for the background of system operation in the switching process, which is not beneficial to the optimal allocation of resources.
Further, as an implementation of the method shown in fig. 1, an embodiment of the present invention provides a device for sending a communication message, and as shown in fig. 3, the device includes:
a first obtaining module 301, configured to obtain parameter information in a TCP buffer, where the parameter information includes a service path, a receiving party, and message content;
a determining module 302, configured to determine a message type of the parameter information according to the service path;
an extracting module 303, configured to extract, according to a preset type configuration comparison table, a server configuration corresponding to the message type;
a merging module 304, configured to merge the server configuration, the receiver, and the message content according to the encoding format of the message type, so as to generate a message code;
a first sending module 305, configured to send the message code according to a TCP protocol.
The invention provides a sending device of communication messages, which firstly obtains parameter information in a TCP buffer area, then judges the message type of the parameter information according to a service path in the parameter information, extracts the server configuration corresponding to the message type according to a preset type configuration comparison table, merges all parts in the parameter information according to the coding format of the message type to generate a message code, and finally sends the message code according to a TCP protocol. Compared with the prior art, the embodiment of the invention acquires the parameter information from the TCP buffer area no matter what message type the parameter information belongs to, repackages the parameter information, uniformly generates and sends the message code, avoids the problem that when sending the communication messages of different message types, the sending end is continuously switched, the message to be sent can be recorded only by waiting for the response of the communication software, the waiting response time is longer when switching different communication software, and a plurality of processes needing response are added for the background of system operation in the switching process, which is not beneficial to the optimal allocation of resources.
Further, as an implementation of the method shown in fig. 2, an embodiment of the present invention provides another communication message sending apparatus, as shown in fig. 4, where the apparatus includes:
a first obtaining module 401, configured to obtain parameter information in a TCP buffer, where the parameter information includes a service path, a receiving party, and a message content;
a determining module 402, configured to determine a message type of the parameter information according to the service path;
an extracting module 403, configured to extract, according to a preset type configuration comparison table, a server configuration corresponding to the message type;
a merging module 404, configured to merge the server configuration, the receiver, and the message content according to the coding format of the message type, so as to generate a message code;
a first sending module 405, configured to send the message code according to a TCP protocol.
Further, the apparatus further comprises:
a second obtaining module 406, configured to obtain the parameter information through an application program interface before obtaining the parameter information in the TCP buffer;
a calculating module 407, configured to calculate a serialization parameter of the parameter information according to a preset algorithm;
a second sending module 408, configured to send the serialization parameters to the TCP buffer;
The first obtaining module 401 is configured to:
acquiring the serialization parameters in a TCP buffer;
and performing deserialization calculation on the serialized parameters to acquire the parameter information.
Further, the apparatus further comprises:
a generating module 409, configured to import the server configurations corresponding to all the message types before extracting the server configuration corresponding to the message type according to the preset type configuration comparison table, and generate the preset type configuration comparison table.
Further, the method further comprises:
a checking module 410, configured to, after combining the server configuration, the topic, the receiver, and the message content according to the encoding format of the message type to generate a message code, check the message code according to a preset sending rule, where the preset sending rule includes a naming rule of the receiver and an identifiable rule of the message content;
the first sending module 405 is further configured to send the message code according to a TCP protocol if the check result is correct;
the merging module 404 is further configured to generate an alarm message if the verification result is incorrect, and merge the server configuration, the topic, the receiver, and the message content according to the coding format of the message type again to generate a message code.
Further, after the message code is sent according to the TCP protocol, the apparatus further includes:
the feedback module 411 is further configured to obtain a feedback message of the message code, and display the feedback message on the user terminal.
The invention provides a sending device of communication messages, which firstly obtains parameter information in a TCP buffer area, then judges the message type of the parameter information according to a service path in the parameter information, extracts the server configuration corresponding to the message type according to a preset type configuration comparison table, merges all parts in the parameter information according to the coding format of the message type to generate a message code, and finally sends the message code according to a TCP protocol. Compared with the prior art, the embodiment of the invention acquires the parameter information from the TCP buffer area no matter what message type the parameter information belongs to, repackages the parameter information, uniformly generates and sends the message code, avoids the problem that when sending the communication messages of different message types, the sending end is continuously switched, the message to be sent can be recorded only by waiting for the response of the communication software, the waiting response time is longer when switching different communication software, and a plurality of processes needing response are added for the background of system operation in the switching process, which is not beneficial to the optimal allocation of resources.
According to an embodiment of the present invention, a computer storage medium is provided, where at least one executable instruction is stored, and the computer executable instruction may execute the method for sending the communication message in any of the method embodiments.
Fig. 5 is a schematic structural diagram of a computer device according to an embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the computer device.
As shown in fig. 5, the computer apparatus may include: a processor (processor)502, a Communications Interface 504, a memory 506, and a communication bus 508.
Wherein: the processor 502, communication interface 504, and memory 506 communicate with one another via a communication bus 508.
A communication interface 504 for communicating with network elements of other devices, such as clients or other servers.
The processor 502 is configured to execute the program 510, and may specifically execute the relevant steps in the embodiment of the method for sending the communication message.
In particular, program 510 may include program code that includes computer operating instructions.
The processor 502 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement an embodiment of the present invention. The computer device includes one or more processors, which may be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 506 for storing a program 510. The memory 506 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 510 may specifically be used to cause the processor 502 to perform the following operations:
in a TCP buffer area, acquiring parameter information, wherein the parameter information comprises a service path, a receiving party and message content;
judging the message type of the parameter information according to the service path;
extracting the configuration of the server corresponding to the message type according to a preset type configuration comparison table;
according to the coding format of the message type, combining the server configuration, the receiver and the message content to generate a message code;
the message code is sent according to the TCP protocol.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims (10)
1. A method for sending a communication message, comprising:
acquiring parameter information through an application program interface and writing the parameter information into a TCP (transmission control protocol) cache region;
acquiring parameter information in a TCP buffer, wherein the parameter information comprises a service path, a receiver and message content;
judging the message type of the parameter information according to the service path;
extracting the configuration of the server corresponding to the message type according to a preset type configuration comparison table;
according to the coding format of the message type, combining the server configuration, the receiver and the message content to generate a message code;
the message code is sent according to the TCP protocol.
2. The method of claim 1, wherein obtaining parameter information and writing the parameter information to the TCP buffer via an application program interface comprises:
Acquiring parameter information through an application program interface;
calculating serialization parameters of the parameter information according to a preset algorithm;
sending the serialization parameters to the TCP cache region;
the acquiring parameter information in the TCP buffer includes:
acquiring the serialization parameters in a TCP buffer;
and performing deserialization calculation on the serialized parameters to acquire the parameter information.
3. The method of claim 1, wherein before the extracting the server configuration corresponding to the message type according to a preset type configuration look-up table, the method further comprises:
and importing server configuration corresponding to all message types, and generating the preset type configuration comparison table.
4. The method of claim 1, wherein after combining the server configuration, the recipient, and the message content to generate a message code according to the encoding format of the message type, the method further comprises:
checking the message code according to a preset sending rule, wherein the preset sending rule comprises a naming rule of the receiver and an identifiable rule of the message content;
if the checking result is correct, the message code is sent according to a TCP (transmission control protocol);
And if the verification result is incorrect, generating alarm information, and combining the server side configuration, the receiving side and the message content according to the coding format of the message type again to generate a message code.
5. The method of claim 1, wherein after sending the message code according to the TCP protocol, the method further comprises:
and acquiring a feedback message of the message code, and displaying the feedback message on the user terminal.
6. An apparatus for sending a communication message, comprising:
the first acquisition module is used for acquiring parameter information through an application program interface and writing the parameter information into a TCP (transmission control protocol) cache region;
the first obtaining module is further configured to obtain parameter information in a TCP buffer, where the parameter information includes a service path, a receiver, and a message content;
the judging module is used for judging the message type of the parameter information according to the service path;
the extraction module is used for extracting the configuration of the server side corresponding to the message type according to a preset type configuration comparison table;
a merging module, configured to merge the server configuration, the receiver, and the message content according to the coding format of the message type, so as to generate a message code;
And the first sending module is used for sending the message code according to the TCP protocol.
7. The apparatus of claim 6, wherein the apparatus further comprises:
a second obtaining module, configured to obtain the parameter information through an application program interface before obtaining the parameter information in the TCP buffer;
the calculation module is used for calculating the serialization parameters of the parameter information according to a preset algorithm;
the second sending module is used for sending the serialization parameters to the TCP cache region;
the first obtaining module is configured to:
acquiring the serialization parameters in a TCP buffer;
and performing deserialization calculation on the serialized parameters to acquire the parameter information.
8. The apparatus of claim 6, wherein the apparatus further comprises:
and the generating module is used for importing the server configurations corresponding to all the message types before extracting the server configurations corresponding to the message types according to a preset type configuration comparison table, and generating the preset type configuration comparison table.
9. A computer storage medium having at least one executable instruction stored thereon, the executable instruction causing a processor to perform operations corresponding to the method of sending a communication message according to any one of claims 1-5.
10. A computer device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface are communicated with each other through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction causes the processor to execute the operation corresponding to the communication message sending method according to any one of claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010713843.1A CN112039751B (en) | 2020-07-22 | 2020-07-22 | Communication message sending method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010713843.1A CN112039751B (en) | 2020-07-22 | 2020-07-22 | Communication message sending method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112039751A CN112039751A (en) | 2020-12-04 |
CN112039751B true CN112039751B (en) | 2022-05-31 |
Family
ID=73582943
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010713843.1A Active CN112039751B (en) | 2020-07-22 | 2020-07-22 | Communication message sending method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112039751B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114900381B (en) * | 2022-03-23 | 2024-03-22 | 青岛海尔科技有限公司 | Message sending method and device, storage medium and electronic device |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102123158A (en) * | 2011-04-11 | 2011-07-13 | 深圳市同洲软件有限公司 | Method and system for realizing network data processing |
WO2013067210A1 (en) * | 2011-11-01 | 2013-05-10 | Google Inc. | Integrated social network and stream playback |
CN104363291A (en) * | 2014-11-19 | 2015-02-18 | 中国航天科工集团第二研究院七〇六所 | Network communication middleware implementation method |
-
2020
- 2020-07-22 CN CN202010713843.1A patent/CN112039751B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102123158A (en) * | 2011-04-11 | 2011-07-13 | 深圳市同洲软件有限公司 | Method and system for realizing network data processing |
WO2013067210A1 (en) * | 2011-11-01 | 2013-05-10 | Google Inc. | Integrated social network and stream playback |
CN104350451A (en) * | 2011-11-01 | 2015-02-11 | 谷歌公司 | Integrated social network and stream playback |
CN104363291A (en) * | 2014-11-19 | 2015-02-18 | 中国航天科工集团第二研究院七〇六所 | Network communication middleware implementation method |
Also Published As
Publication number | Publication date |
---|---|
CN112039751A (en) | 2020-12-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
RU2365049C2 (en) | System and method of use of packed compressed buffers for improved data transfer between client and server | |
JP5485993B2 (en) | Service load balancing | |
CN100421431C (en) | Method for realizing instant message communication | |
JP2008524879A (en) | File transmission method, system, virtual printer apparatus and restoration apparatus in network | |
CN111835837B (en) | Message pushing method and system with multi-terminal adaptation | |
US20090030917A1 (en) | Multimedia messaging service-based database synchronization | |
CN109684097A (en) | A kind of parsing of JSON data and storage method based on CMSP | |
CN112055078A (en) | Data transmission method and device, computer equipment and storage medium | |
CN113556359A (en) | Communication protocol conversion method, device, system and gateway device | |
CN112039751B (en) | Communication message sending method and device | |
CN112073923A (en) | Communication method, device, gateway and readable storage medium compatible with multiple operators | |
CN106817689B (en) | High-reliability data subscription and release method and system | |
CN107948242A (en) | More service number template message sending methods and system | |
CN116405547A (en) | Message pushing method and device, processor, electronic equipment and storage medium | |
EP2139193B1 (en) | A method of performing data mediation, and an associated computer program product, data mediation device and information system | |
EP2437447B1 (en) | Multimedia message forwarding method, device and system thereof | |
US20210243036A1 (en) | Blockchain network communication management | |
CN112039754A (en) | Message processing system, method, sending method, device and electronic equipment | |
CN111327680A (en) | Authentication data synchronization method, device, system, computer equipment and storage medium | |
JP2000029797A (en) | Electronic mail system | |
CN108055305B (en) | Storage expansion method and storage expansion device | |
CN104468514B (en) | Information processing method, electronic equipment and server | |
CN113269590B (en) | Data processing method, device and system for resource subsidy | |
CN114697389B (en) | Data transmission method, device and scanning engine | |
CN113572578B (en) | TCP data transmission method, device, equipment and medium based on data center |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |