[go: up one dir, main page]

HK1224124A1 - Method and device for sending communication information - Google Patents

Method and device for sending communication information Download PDF

Info

Publication number
HK1224124A1
HK1224124A1 HK16112077.3A HK16112077A HK1224124A1 HK 1224124 A1 HK1224124 A1 HK 1224124A1 HK 16112077 A HK16112077 A HK 16112077A HK 1224124 A1 HK1224124 A1 HK 1224124A1
Authority
HK
Hong Kong
Prior art keywords
communication
connections
communication channel
connection
information
Prior art date
Application number
HK16112077.3A
Other languages
Chinese (zh)
Other versions
HK1224124B (en
Inventor
趙航
赵航
Original Assignee
创新先进技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 创新先进技术有限公司 filed Critical 创新先进技术有限公司
Publication of HK1224124A1 publication Critical patent/HK1224124A1/en
Publication of HK1224124B publication Critical patent/HK1224124B/en

Links

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

The invention provides a communication information transmitting method and a communication information transmitting device. The communication information transmitting method is characterized in that a downlink request of communication information can be received; a communication channel matched with the communication information can be searched according to the downlink request; the communication channel is provided with the related communication connections and the used connection number; when the local used connection number is not zero, the communication connections can be used to transmit the communication information to the connected communication platform, which is used to transmit the communication information to the corresponding communication object. The differentiation deployment of the communication channels of the servers can be realized, and the number of the servers is not required to be equal to the number of the communication connections, and under the condition of the unequal and limited communication connections provided by the communication platform, the communication connections can be fully used, and therefore the utilization rate of the communication connections can be improved, the idle states of the resources can be prevented, the strong dependence on the connection resources of the communication platform is not required, the convenience of the dilatation can be improved, and the requirement of increasing the capacity constantly can be satisfied.

Description

Communication information sending method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for sending communication information.
Background
With the development of communication technology, especially with the popularization of mobile internet, a plurality of service platforms send information to users to provide diversified services. For example, the service platform sends a login verification short message, a weather forecast short message, a holiday greeting multimedia message and the like to the mobile phone of the user.
As shown in fig. 1, in the service platform, the gateway (i.e. smsgw) is usually bound to servers, each server needs to start all channels, each channel needs to establish a connection with the operator, and when receiving a request from the service system, the gateway communicates with the operator.
In the conventional method, a connection needs to be established between a server and an operator, so that after the information is popularized to a cluster, each server needs to establish a connection with the operator, and the number of the connections between the server and the operator is required to be consistent.
In practice, the channel resources of the operator are limited and do not provide sufficiently redundant connections. And the market share of each operator is different, and the service capability that each operator can provide is also different, resulting in different numbers of connections that can be provided by multiple operators.
If the number of servers is the same as the number of connections, the service platform is limited to the minimum number of connections in the operator, and cannot fully utilize all resources.
And because the number of connections given by different operators is different, the operator needs to be applied for each time when a new connection needs to be added, and the capacity expansion of the gateway and the cost of operator access are seriously influenced.
Although the capacity problem can be solved by accessing multiple operators, the problem of the number of connections needs to be solved as the demand for capacity increases.
If the number of machines is the same as the number of connections, the application capacity expansion requires the number of connections to be expanded, which cannot be achieved by most operators.
When the server is online and offline, the connection may not be acquired or released in time, so that the operation and maintenance cost is high.
Therefore, one technical problem that needs to be urgently solved by those skilled in the art is: how to provide a communication information publishing mechanism for utilizing all connection numbers to the maximum extent and facilitating capacity expansion and operation and maintenance.
Disclosure of Invention
The technical problem to be solved by the embodiments of the present application is to provide a method for sending communication information, so as to improve the convenience of capacity expansion and maintenance.
Correspondingly, the embodiment of the application further provides a device for sending the communication information, so that the convenience of capacity expansion and maintenance is improved.
In order to solve the above problem, an embodiment of the present application discloses a method for sending communication information, including:
receiving a downlink request of communication information;
searching a communication channel matched with the communication information according to the downlink request; the communication channel has associated communication connections and a number of used connections;
and when the number of the used connections is not zero locally, the communication information is sent to the connected communication platforms through the communication connections, and the communication platforms are used for sending the communication information to the corresponding communication objects.
Preferably, the method further comprises the following steps:
when the number of the used connections is locally zero, searching a server which is associated with the communication channel and has non-zero number of the used connections;
and sending the communication information to the server, wherein the server is used for sending the communication information to the communication platform through the communication connection.
Preferably, before the step of searching for the communication platform corresponding to the communication information according to the downlink request, the method further includes:
and preprocessing the communication information.
Preferably, the communication information includes communication object identification and communication content; the step of searching the communication channel matched with the communication information according to the downlink request comprises the following steps:
searching a communication channel to which a communication object identifier of the communication information belongs;
and searching a communication channel matched with the communication content from the communication channels to which the communication object identifiers belong.
Preferably, the communication channel comprises a default communication channel and a backup communication channel; the step of searching the communication channel matched with the communication information according to the downlink request comprises the following steps:
searching a default communication channel matched with the communication information according to the downlink request;
and when the default communication channel is unavailable, searching for an available backup communication channel.
Preferably, the communication connection is provided with a message queue; the step of sending the communication information to the connected communication platform through the communication connection comprises the following steps:
respectively writing the communication information into corresponding thread pools; each thread pool has a corresponding priority;
writing the communication information of the thread pool into the message queue;
and sending the communication information in the message queue to a connected communication platform through the communication connection according to the priority of the thread pool to which the communication information belongs.
Preferably, before the step of receiving the downlink request of the communication information, the method further includes:
reading the number of local used connections associated with each communication channel during cold start;
establishing communication connections with the same number as the used connection number for each communication channel;
correspondingly modifying the number of used connections and the number of unused connections associated with each communication channel;
and registering communication service for the communication channel.
Preferably, the method further comprises the following steps:
when a modification instruction of communication connection is received, judging whether a communication channel associated with the communication connection is opened or not;
when the communication channel related to the communication connection is not opened, unloading communication service for the communication channel;
closing the communication connection related to the communication channel;
and correspondingly modifying the number of used connections and the number of unused connections associated with the communication channel.
Preferably, the method further comprises the following steps:
when the communication channel associated with the communication connection is opened, judging whether the number of the used connections associated with the communication channel is zero locally;
when the number of the used connections is locally zero, reading the number of the locally used connections associated with the communication channel from a memory;
establishing communication connections with the same number as the number of used connections read from the memory for the communication channels;
correspondingly modifying the number of used connections and the number of unused connections associated with the communication channel;
and registering communication service for the communication channel.
Preferably, the method further comprises the following steps:
when the number of the used connections is locally nonzero, modifying the communication connections related to the communication channels according to the modification instruction;
and correspondingly modifying the number of used connections and the number of unused connections associated with the communication channel.
Preferably, the step of modifying the communication connection associated with the communication channel according to the modification instruction includes:
and when the modification instruction is an increase connection instruction, establishing communication connection for the communication channel.
Preferably, the step of modifying the communication connection associated with the communication channel according to the modification instruction includes:
and when the modification instruction is a connection reduction instruction, closing the communication connection related to the communication channel.
Preferably, the method further comprises the following steps:
judging whether the modified used connection quantity is zero or not; and if so, unloading the communication service for the communication channel.
Preferably, the method further comprises the following steps:
when on-line operation is triggered, reading the number of unused connections associated with the communication channel corresponding to the on-line operation;
when the number of the unused connections is not zero, establishing communication connections for the communication channel;
correspondingly modifying the number of used connections and the number of unused connections associated with the communication channel;
and registering communication service for the communication channel.
Preferably, the method further comprises the following steps:
when the offline operation is triggered, closing the communication connections associated with all the current communication channels;
correspondingly modifying the number of used connections and the number of unused connections associated with the communication channel;
and unloading communication service for the communication channel.
The embodiment of the application also discloses a device for sending communication information, which comprises:
a downlink request receiving module, configured to receive a downlink request for communication information;
the communication channel searching module is used for searching a communication channel matched with the communication information according to the downlink request; the communication channel has associated communication connections and a number of used connections;
the first communication information sending module is used for sending the communication information to the connected communication platforms through the communication connection when the used connection number is locally nonzero; and the communication platform is used for sending the communication information to a corresponding communication object.
Preferably, the method further comprises the following steps:
the server searching module is used for searching the server with the non-zero used connection number related to the communication channel when the used connection number is locally zero;
the second communication information sending module is used for sending the communication information to the server; the server is used for sending the communication information to the communication platform through the communication connection.
Preferably, the method further comprises the following steps:
and the preprocessing module is used for preprocessing the communication information.
Preferably, the communication information includes communication object identification and communication content; the communication channel searching module comprises:
the identifier attribution searching submodule is used for searching a communication channel to which the communication object identifier of the communication information belongs;
and the content matching submodule is used for searching a communication channel matched with the communication content from the communication channel to which the communication object identifier belongs.
Preferably, the communication channel comprises a default communication channel and a backup communication channel; the communication channel searching module comprises:
the default communication channel searching submodule is used for searching a default communication channel matched with the communication information according to the downlink request;
and the backup communication channel searching submodule is used for searching an available backup communication channel when the default communication channel is unavailable.
Preferably, the communication connection is provided with a message queue; the first communication information sending module comprises:
the thread pool writing submodule is used for respectively writing the communication information into the corresponding thread pools; each thread pool has a corresponding priority;
the message queue writing submodule is used for writing the communication information of the thread pool into the message queue;
and the priority sending submodule is used for sending the communication information in the message queue to a connected communication platform through the communication connection according to the priority of the thread pool to which the communication information belongs.
Preferably, the method further comprises the following steps:
the first reading module is used for reading the number of the local used connections related to each communication channel during cold start;
the first establishing module is used for respectively establishing communication connections with the same number as the used connections for each communication channel;
the first modification module is used for correspondingly modifying the number of used connections and the number of unused connections associated with each communication channel;
and the first registration module is used for registering communication service for the communication channel.
Preferably, the method further comprises the following steps:
the starting judging module is used for judging whether to start a communication channel related to the communication connection when receiving a modification instruction of the communication connection;
the first unloading module is used for unloading communication service for the communication channel when the communication channel associated with the communication connection is not opened;
the first closing module is used for closing the communication connection related to the communication channel;
and the second modification module is used for correspondingly modifying the number of the used connections and the number of the unused connections associated with the communication channel.
Preferably, the method further comprises the following steps:
the first judgment module is used for judging whether the used connection quantity associated with the communication channel is zero locally or not when the communication channel associated with the communication connection is opened;
the second reading module is used for reading the local used connection quantity associated with the communication channel from the memory when the local used connection quantity is zero;
the second establishing module is used for establishing communication connections with the same number as the used connections read from the memory for the communication channels;
a third modification module, configured to modify the number of used connections and the number of unused connections associated with the communication channel correspondingly;
and the second registration module is used for registering communication service for the communication channel.
Preferably, the method further comprises the following steps:
the fourth modification module is used for modifying the communication connection related to the communication channel according to the modification instruction when the number of the used connections is locally nonzero;
and a fifth modification module, configured to modify the number of used connections and the number of unused connections associated with the communication channel correspondingly.
Preferably, the fourth modification module includes:
and the third establishing submodule is used for establishing communication connection for the communication channel when the modification instruction is an increasing connection instruction.
Preferably, the fourth modification module includes:
and the second closing submodule is used for closing the communication connection related to the communication channel when the modification instruction is a connection reduction instruction.
Preferably, the method further comprises the following steps:
the second judgment module is used for judging whether the modified used connection quantity is zero or not; if so, calling a second unloading module;
and the second unloading module is used for unloading the communication service for the communication channel.
Preferably, the method further comprises the following steps:
the third reading module is used for reading the number of unused connections associated with the communication channel corresponding to the online operation when the online operation is triggered;
the fourth establishing module is used for establishing communication connection for the communication channel when the number of the unused connections is not zero;
a sixth modification module, configured to modify the number of used connections and the number of unused connections associated with the communication channel correspondingly;
and the third registration module is used for registering communication service for the communication channel.
Preferably, the method further comprises the following steps:
the third closing module is used for closing the communication connections related to all the current communication channels when the offline operation is triggered;
a seventh modification module, configured to modify the number of used connections and the number of unused connections associated with the communication channel correspondingly;
and the third unloading module is used for unloading the communication service for the communication channel.
Compared with the background art, the embodiment of the application has the following advantages:
according to the embodiment of the application, a communication channel matched with the communication information is searched according to the downlink request of the communication information; and when the number of the used connections is not zero locally, the communication information is sent to the connected communication platforms through the communication connections, and the communication platforms send the communication information to the corresponding communication objects. The number of the communication connections is configured and managed, the communication channels are searched for communication information, differential deployment of the communication channels of the servers is achieved, the number of the servers is not required to be consistent with the number of the communication connections, the communication connections can be fully utilized under the condition that the communication connections provided by the communication platform are unequal and limited, the utilization rate of the communication connections is improved, resource vacancy is avoided, connection resources which depend on the communication platform strongly are not required, the capacity expansion simplicity is improved, and continuously improved capacity requirements are met.
According to the method and the device, when the cold start is carried out, the corresponding communication connection is established according to the number of the local unused connections associated with each communication channel, the current connection resources are fully utilized by configuring the number of the communication connections, and the operation and maintenance cost is reduced.
In the embodiment of the application, when the server is started in a hot state, if the server does not start the communication channel associated with the communication connection, the communication channel is invalid, the communication service of the communication channel needs to be unloaded, the associated communication connection is closed, and the used connection quantity and the unused connection quantity are correspondingly modified, so that the communication information needing the communication channel service is prevented from being sent to the current server by other servers, and resources are wasted; meanwhile, the occupied connection resources are released, and the operation and maintenance cost is reduced.
When the method and the device are started in a hot mode, if the used connection quantity is zero locally, corresponding communication connection is established according to the local used connection quantity related to the communication channel, so that the problem that the communication channel is opened but the communication connection is not started yet during initialization is solved, current connection resources are fully utilized, and the operation and maintenance cost is reduced.
According to the embodiment of the application, the communication connection related to the communication channel is modified according to the modification instruction, and the related used connection quantity and unused connection quantity are correspondingly modified, so that the connection resources are fully utilized, the idle connection resources are avoided, and the operation and maintenance cost is reduced.
According to the communication channel service unloading method and the communication channel service unloading device, when the communication connection is closed, the number of used connections is zero, the communication service is unloaded, the problem that communication information cannot be sent due to the fact that other servers send communication information needing the communication channel service to the current server is solved, and waste of resources is avoided.
According to the embodiment of the application, communication connection can be dynamically bound according to the number of unused connections during online operation so as to obtain connection resources, and the problems that idle startup is caused and any communication information cannot be sent are avoided.
According to the embodiment of the application, communication connection can be dynamically released according to the number of used connections during offline operation, so that waste of connection resources is avoided.
Drawings
FIG. 1 is a diagram of a connection example of a conventional business system;
FIG. 2 is a flowchart illustrating steps of an embodiment of a method for sending a communication message according to the present application;
FIG. 3 is a diagram of an example of a connection for a business system of the present application;
FIG. 4 is an exemplary diagram of a message queue of the present application;
FIG. 5 is an exemplary diagram of a lookup server of the present application;
FIG. 6 is a diagram illustrating an exemplary communication message transmission according to the present application;
FIG. 7 is a flow chart illustrating steps of another exemplary method of sending a communication message according to the present application;
FIG. 8 is a flow chart illustrating steps in an alternative exemplary method of sending a communication message;
FIG. 9 is a flowchart illustrating steps of another exemplary method of sending a communication message;
fig. 10 is a block diagram of an embodiment of a communication information transmitting apparatus according to the present application.
Detailed Description
In order to make the aforementioned objects, features and advantages of the present application more comprehensible, the present application is described in further detail with reference to the accompanying drawings and the detailed description.
In a general service platform, communication information can be sent by selecting different communication platforms according to different services (i.e., communication capacities).
For example, the short message (one of the communication information) of the check code class may select the communication channel of the mobile operator a, the telecom operator B, and the Unicom operator C; the credit card repayment reminding short message can select a mobile operator D, a telecom operator E and a Unicom operator F.
The gateway cluster performs load balancing on the transmitted communication information, and the load balancing may be random. Each server may send communication information of any service, so that each server needs to establish a connection with any communication platform.
If the number of the servers is larger than the number of the communication connections, the communication connection of a certain communication platform is not established on a certain machine, and the communication information of the service distributed to the server cannot be sent. If the number of servers is less than the number of communication connections, the communication connections are not fully utilized and resources are free.
Therefore, it is required that the number of servers and the number of communication connections of the communication platform are consistent.
For example, in fig. 1, the smsgw1 has 3 communication channels, each of which has two communication links, and each of the two communication channels is connected to mobile operator 1, mobile operator 2, communication operator 1, communication operator 2, telecommunication operator 1 and telecommunication operator 2.
In practical application, the server may be expanded horizontally, that is, corresponding hardware is added, that is, the number of servers sending communication information is increased.
For example, the sending capability of the server stand alone is 100tps (100 pieces of communication information are sent in 1 second), and 10000tps of service capability are currently required, so that 100 servers are required for simultaneous service.
Since the capacity of one communication platform is limited, in order to meet the service requirement of all communication information, the capacity problem can be solved by accessing a plurality of communication platforms.
For example, the communication platform of Zhejiang mobile operator, Shanghai mobile operator, Guangzhou mobile operator, Liaoning mobile operator, etc. may be accessed.
However, since communication connections, especially long connections, are very resource consuming, the communication platform can provide very limited communication connections.
For example, the communication platform of the mobile operator in Zhejiang can provide 20 communication connections, and the communication platform of the mobile operator in Shanghai can provide 10 communication connections.
According to the service requirements of all communication information, if 100 servers are required to send communication information, each communication platform needs 100 communication connections to ensure that the communication information of all services can be sent.
If the number of the servers is the same as the number of the communication connections, and if the number of the servers is the same as the number of the communication connections, the capacity expansion of the servers requires the capacity expansion of the communication connections, most communication platforms cannot achieve the capacity expansion, and the bottleneck of the capacity expansion is the minimum number of the communication connections in the communication platforms, so that all resources cannot be fully utilized.
In addition, because communication connection needs to be established for sending the communication information, the management of the communication connection is not available, and the operation and maintenance cost is high. During online operation, how many communication connections are used and how many communication connections are used are not known, so that connection resources may not be obtained, and emergency capacity expansion during capacity sudden increase cannot be performed. During the offline operation, it is unknown that the number of communication connections is large, and the connection resources may not be released in time, so that the connection resources are not used.
Therefore, one of the core concepts of the embodiment of the application is provided, a communication connection management mechanism of a communication platform is established, the communication connection management mechanism comprises the total connection number, the used connection number and the unused connection number, and the communication connection information of each server is managed in a mode of configuration information; starting connection according to the configuration information when the server is started; the allocation of communication connection is dynamically adjusted when the server runs, and the server can take effect in real time without restarting; when the online operation or the offline operation is triggered, the connection resources can be preempted or released according to the actual use condition of the communication connection without depending on the configuration information.
Referring to fig. 2, a flowchart illustrating steps of an embodiment of a method for sending communication information according to the present application is shown, and specifically, the method may include the following steps:
step 201, receiving a downlink request of communication information;
it should be noted that the embodiments of the present application can be applied to a service system having a long connection (one of communication connections).
Referring to fig. 3, a communication gateway cluster (i.e. smsgw cluster) in the service system needs to start a communication channel, which needs to establish a long connection with a communication platform (e.g. mobile operator, telecom operator, etc.) for communication.
The communication channel can be an account number provided by the communication platform and can be used for receiving/sending communication information. One communication channel may create one or more communication connections.
A long connection may refer to a communication link based on a communication channel that may continuously transmit multiple data packets. During the connection hold, if no data packet is sent, a link check packet needs to be sent by both sides of the connection.
The long connection may be used for frequent and point-to-point communication, and may specifically include a TCP (transmission control protocol) connection.
In particular implementations, the communication information applied to the long connection may include short messages, multimedia messages, instant messenger messages, emails, P2P (peer-to-peer) information, and so on.
The downlink request of the communication information may refer to an indication that the service system sends a certain communication information in a downlink mode.
Due to business requirements, for example, sending a verification short message when a user registers an account, sending a prompt short message when the account is abnormally logged in, sending a credit card repayment prompt short message and the like, the business system needs to downlink communication information, namely communication information sending behavior initiated by the business system is processed by the business system and the communication platform to send the communication information to a communication object.
In a preferred embodiment of the present application, the communication information may be preprocessed.
In a specific implementation, a communication information center (smsenter) shown in fig. 3 may be responsible for preprocessing the communication information itself requested to be sent by the service system, and specifically may include checking, splitting, grouping, and the like.
Further, according to different service scenarios, various checks may be performed, for example:
length check, checking whether the communication information exceeds the word number limit of the single communication information;
checking the sensitive words, and checking whether the communication information contains illegal character strings;
and repeating the check to check whether the communication information is sent to the same communication object in a short time.
Further, splitting may refer to splitting a single long communication message (e.g., exceeding a predetermined length threshold) into multiple short communication messages.
For example, if a short message is 100 words and exceeds the word number limit (length threshold) of 90 words, the short message can be split into two short messages to be sent, wherein one short message is 90 words and the other short message is 10 words.
In addition, grouping may refer to grouping communication information according to a grouping policy.
For example, the communication information may be divided into three groups according to the importance of the service, and the priority is high, medium, and low.
Of course, the foregoing preprocessing is only an example, and when the embodiment of the present application is implemented, other preprocessing may be set according to an actual situation so as to meet a sending requirement of a service system, which is not limited in the embodiment of the present application. In addition, besides the above pretreatment, those skilled in the art can also use other pretreatment according to actual needs, and the embodiment of the present application is not limited thereto.
Step 202, searching a communication channel matched with the communication information according to the downlink request;
in a specific implementation, the communication information center (smsenter) shown in fig. 3 may preprocess the communication information requested to be sent by the service system, and may deliver the preprocessed communication information (the short message list if the short message is split) to the communication information router (smsrouter), and the communication information router (smsrouter) provides routing service.
In a preferred embodiment of the present application, the communication information may include a communication object identifier and communication content, and in this embodiment, step 202 may include the following sub-steps:
substep S11, searching candidate communication channel to which the communication object mark of the communication information belongs;
in particular implementations, the communication object identifier may be information that can represent a uniquely identified communication object. For example, if the communication object is a mobile phone, the communication object identifier may be a mobile phone number.
The service system can access different communication platforms such as a mobile operator, a communication operator, a telecommunication operator and the like, and each communication platform generally has a communication mode of communicating with a communication object, so that in the embodiment of the application, a proper communication platform needs to be selected, and communication information is sent through a communication channel corresponding to the communication platform.
For example, if the mobile phone number is a mobile number, a communication channel of a communication platform of a mobile operator can be searched; if the mobile phone number is a communication number, a communication channel of a communication platform of a communication operator can be searched; if the mobile phone number is the telecommunication number, the communication channel of the communication platform of the telecommunication operator can be searched.
And a substep S12, searching a communication channel matched with the communication content from the communication channels to which the communication object identifiers belong.
In a specific implementation, the communication content may be information that needs to be sent to the communication object.
The business system can be accessed to a plurality of operators such as mobile, communication and telecommunication, the service quality of communication platforms (such as Beijing mobile operator, Tianjin mobile operator, inner Mongolia mobile operator and the like) under the mobile operator is different, and the embodiment of the application can preset a downlink strategy to search a communication channel matched with the matched communication content.
In an example of the embodiment of the present application, a corresponding communication channel may be set according to a type of communication information.
For example, the short message of the check code class can select the communication channels of a mobile operator A, a telecom operator B and a Unicom operator C; the credit card repayment reminding short message can select a mobile operator D, a telecom operator E and a Unicom operator F.
In another example of the embodiment of the present application, communication channels with different qualities may be selected according to factors of the communication channels, and a communication channel with a higher quality may preferentially provide a service for communication information with a higher priority.
For example, the factors for selecting the communication channel may include at least one of a transmission success rate, an authority parameter, a time consumed for arrival, and a communication number length.
The success rate of sending may be a success rate of sending the communication information, and the higher the success rate of sending, the higher the success rate of sending the communication information to the communication object, which is sent through the communication channel to which the communication information belongs, is. Then, from the viewpoint of success rate, the communication channel with high transmission success rate can be selected to transmit the communication information.
The authority parameter may be a parameter required by the same service system of the communication platform to send the communication information, for example, the price of the communication information, that is, the cost of sending the communication information, the authority parameter of a single piece of communication information of each communication platform may be different, and from the cost perspective, a communication channel with a low authority parameter may be selected to send the communication information.
The time consumed for arrival can be the time when the communication information is sent from the sender to the sender, and the smaller the time consumed for arrival is, the faster the communication is sent to the communication object, the shorter the user waiting time is. From the time point of view, a communication channel which consumes less time to reach can be selected to send the communication information.
The communication number length may be the length of the access number of the communication channel, and if the communication number of the communication channel a is 5 digits, the communication number of the communication channel B is 11 digits. For the user, the recognition degree of the 5-digit communication number is far better than that of the 11-digit communication number. From the perspective of the communication number, a communication channel with a smaller communication number length can be selected to send the communication information.
Of course, the above-mentioned factors of the communication channel are only examples, and when implementing the embodiment of the present application, other factors of the communication channel may be set according to practical situations, which is not limited in the embodiment of the present application. In addition, besides the above-mentioned factors of the communication channel, those skilled in the art may also adopt other factors of the communication channel according to actual needs, and the embodiment of the present application is not limited thereto.
In a preferred embodiment of the present application, the communication channel may include a default communication channel and a backup communication channel, and in this embodiment, step 202 may include the following sub-steps:
substep S21, searching a default communication channel matched with the communication information according to the downlink request;
and a substep S22, searching for an available backup communication channel when the default communication channel is not available.
In the embodiment of the application, the default communication channel configured in the background can be selected according to the information such as the communication identification and the communication content of the communication information, and if the default communication channel is available, the default communication channel is used.
And under the condition that the communication platform cannot provide communication service and the like, the communication channel is unavailable.
If the default communication channel is not available, an available backup communication channel may be searched.
Further, each backup channel may have a corresponding priority, and in the embodiment of the present application, all backup communication channels of the default communication channel may be traversed according to the priority, and an available backup communication channel with the highest priority is used.
It should be noted that the found communication channel matching the communication information may be identified by a communication channel identifier.
The communication channel ID may represent information of a uniquely determined communication channel, such as an Identity (ID) of the communication channel.
Furthermore, the communication channel may have an associated communication connection, which is a communication gateway (smsgateway) connected to the communication platform.
By applying the embodiment of the application, a communication connection management mechanism can be configured for each channel, and the communication channel can have associated used connection quantity, unused connection quantity and total connection quantity.
The total connection number can be the number of all communication connections provided for the communication platform;
the number of used connections may be the number of communication connections for which a connection has been established;
the number of unused connections may be the number of communication connections for which no connection is established;
generally, the total number of connections is the sum of the number of used connections and the number of unused connections, but may be increased or decreased as the number of communication connections provided by the communication platform increases or decreases.
The total control table recording the number of used connections, the number of unused connections and the total number of connections for each communication channel may be managed at a connection management module named "connection management" as shown in fig. 3, an example of which may be shown as follows:
TABLE 1
Communication platform Total number of connections Number of used connections Number of unused connections
Zhejiang mobile operator 20 10 10
Operator of Zhejiang Unicom 10 10 0
Zhejiang telecommunication operator 5 4 1
Shanghai mobile operator 30 30 0
In addition, the configuration information (sms _ server) of the communication connection is configured and maintained through the connection management module.
An example format of the configuration information (sms _ server) may be as shown in the following table:
TABLE 2
Name of field Type (B) Description of the invention
Id Int primary key auto_increment Running water ID
Channel_id Int not null Communication channel ID
Link_count Int not null Number of connection instances
Server_name Varchar(32)not null Server name
Room Varchar(32) Machine room names, e.g. ZUE, ZTG
Operator Varchar(32) Operator
Gmt_create Datetime not null Recording creation time
Gmt_modified Datetime not null Recording last modification time
An example of the core data of the configuration information (sms _ server) may be as shown in the following table:
TABLE 3
Id Communication channel ID Number of connection instances Server name
1 Zhejiang shift 2 smsserver-1-1
2 Zhejiang shift 3 smsserver-1-2
3 Zhejiang shift 3 smsserver-1-3
4 Movement in the sea 1 smsserver-1-1
5 Zhejiang telecommunication 1 smsserver-1-3
The number of the connection instances may be the number of the used connections of the communication channel in each server, and each server may query the number of the connection instances in the configuration information to obtain the number of the used connections of the communication channel in the local area.
In addition, the number of used connections of the communication channel in the total control table may be the sum of the number of instance connections in each server in the configuration information.
Step 203, when the number of the used connections is locally nonzero, the communication information is sent to the connected communication platforms through the communication connections;
if the communication channel matching the communication information is found, the communication information route (smsrouter) shown in fig. 3 may check whether the server is locally deployed with the communication connection of the communication channel.
Specifically, the communication information router (smsrouter) may query the configuration information (sms _ server) from the connection management module to know whether the communication connection of the communication channel is deployed locally.
If the number of the inquired used connections is not zero locally, the server can be represented to be locally deployed with the communication connection of the communication channel, and the local communication channel can be directly used for sending communication information.
Specifically, the communication identifier (e.g., a mobile phone number) and the communication content of the communication information may be sent to the communication platform according to the protocol specification of the communication connection.
For example, if the name of the local server is "smsverr-1-1" and the ID of the required communication channel is "zhejiang mobile" communication channel, and the number of connection instances of the local server is 2 as can be queried in table 3, it indicates that the local server has deployed two communication connections of "zhejiang mobile" communication channels, and can directly use the local communication channel to send communication information.
In a preferred embodiment of the present application, the communication connection may have a message queue therein, and then in this embodiment of the present application, step 203 may include the following sub-steps:
substep S31, writing the communication information into corresponding thread pools respectively; each thread pool may have a corresponding priority;
substep S32, writing the communication information of the thread pool into the message queue;
and a substep S33, sending the communication information in the message queue to the connected communication platform through the communication connection according to the priority of the thread pool to which the communication information belongs.
In the embodiment of the present application, the communication information gateway (smsgateway) shown in fig. 3 generally operates in a manner of connecting to a single instance.
As shown in fig. 4, the communication link has a message queue 404 for temporarily storing communication information to be transmitted from the communication channel.
In the embodiment of the present application, one or more thread pools may be configured at the same time, and each thread pool may have a corresponding priority, such as the high-level thread pool 401, the medium-level thread pool 402, and the low-level thread pool 403 in fig. 4, which correspond to the high level, the medium level, and the low level of the priority, respectively.
The communication information center (smsenter) shown in fig. 3 may group the communication information during preprocessing, for example, the communication information may be divided into three groups, and the priority is high, medium and low, respectively, and then may be directly written into the high level thread pool 401, the medium level thread pool 402 and the low level thread pool 403 shown in fig. 4.
The high-level thread pool 401, the middle-level thread pool 402 and the low-level thread pool 403 respectively add the communication information corresponding to the priority to the end of the message queue 404.
Different queuing strategies are available in the message queue 404, and the message is sent to the communication platform 407 through the communication connection 405 or the communication connection 406 according to the priority of the thread pool to which the communication information belongs, that is, the priority of the communication information is sent with higher priority.
In a preferred embodiment of the present application, the method may further include the steps of:
step 204, when the number of the used connections is zero, searching a server which is associated with the communication channel and has a nonzero number of the used connections;
step 205, sending the communication information to the server; the server is used for sending the communication information to the communication platform through the communication connection.
If the number of used connections is locally zero, it may indicate that the server does not deploy the communication connection of the communication channel locally, and the communication information route (smsrouter) shown in fig. 3 may send the communication information to the server that deploys the communication connection of the communication channel for sending.
In the embodiment of the present application, a server with a non-zero number of used connections associated with a communication channel may be found by the configuration center as shown in fig. 3.
The configuration center and the servers can be a communication framework based on a classic "publish/subscribe" model, and users (i.e. servers) of the configuration center are divided into two key roles: a publisher and a subscriber. They do not see each other's existence, and what they are maintaining is the data they are interested in common, indicated by "data identification (DataID)".
In the embodiment of the application, the deployment of the communication channel on the specified server can be realized by using the registered communication service and the uninstalled communication service of the configuration center.
In a specific implementation, the current server may send a message to the configuration center in the role of a subscriber, where the message includes a server identifier (e.g., a server ID) of the current server and a communication identifier (e.g., a communication ID) of a communication channel, which indicates that the current server needs a service of the communication channel.
The configuration center searches for a server of a communication channel deployed with the channel identifier (such as a communication ID) in other servers registered for the communication service. If the communication channel is found, a message may be sent to the current server, where the message includes a server identifier (e.g., a server ID) of another server and a communication identifier (e.g., a communication ID) of the communication channel, which indicates that the other server may provide the service of the communication channel.
The current server can send the communication information to the server identification (such as server ID) corresponding to the other server, and the server sends the communication information to the communication platform.
For example, as shown in fig. 5, a server 501 having an ID of "smsverr-1-1" registers a communication service of a communication channel having an ID of "zhejiang mobile" in a configuration center 500; server 502 having an ID of "smsverr-1-2" registers a service of a communication channel having an ID of "shanghai unicom" in configuration center 500.
If the server 503 with the ID of "smsverr-1-3" needs the service of the communication channel with the ID of "zhejiang mobile", a message including "smsverr-1-3" and "zhejiang mobile" may be sent to the configuration center 500, and when the configuration center 500 finds that the server 501 is registered with the service of the communication channel, a message including "smsverr-1-1" and "zhejiang mobile" may be sent to the server 503, and the server 503 may send the communication information needed to be sent to the server 501 with the ID of "smsverr-1-1".
If the server 504 with the ID of "smsverr-1-4" needs the service of the communication channel with the ID of "shanghai unicom", a message including "smsverr-1-4" and "shanghai unicom" may be sent to the configuration center 500, and when the configuration center 500 finds that the server 502 is registered with the service of the communication channel, a message including "smsverr-1-2" and "shanghai unicom" may be sent to the server 504, and the server 504 may send the communication information needed to be sent to the server 502 with the ID of "smsverr-1-2".
In a specific implementation, the communication platform receives the communication information, and may be configured to send the communication information to a corresponding communication object.
The communication platform may include communication platforms of different operators (such as mobile, internet, telecommunication, virtual operator, etc.), and may support different mobile networks, such as a second generation mobile communication technology 2G network, an integrated digital enhanced network (i.e. 2.5G network), a third generation mobile communication technology 3G network, a fourth generation mobile communication technology 4G network, a virtual operator (VNO) network, etc.
The communication information may include a communication object identifier (e.g., a mobile phone number) and communication content, and the communication platform may send the communication content to the communication object (e.g., a mobile phone) according to the communication object identifier.
In order to make those skilled in the art better understand the embodiments of the present application, the following describes a method for sending communication information according to the embodiments of the present application by using a specific example.
As shown in fig. 6, the service system 601 requests to send the communication information in step 605, the gateway cluster smsgw602 of the server receives the communication information in step 606, and searches for a communication channel matching with the communication information in step 607.
When the communication channel is found, in step 608, it is determined whether a communication connection of the communication channel is deployed locally, and if the communication connection of the communication channel is located locally, the communication connection may be directly sent to the communication platform connected to the communication channel through the communication connection in step 609. If the communication connection of the communication channel is not deployed locally, in step 610, the configuration center 603 finds the server where the communication connection of the communication channel is deployed.
When the server is found, the communication information is routed to the server in step 611, the gateway cluster smsgw604 of the server receives the communication information in step 612, and sends the communication information to the communication platform connected to the communication channel through the communication connection in step 613.
According to the embodiment of the application, a communication channel matched with the communication information is searched according to the downlink request of the communication information; and when the number of the used connections is not zero locally, the communication information is sent to the connected communication platforms through the communication connections, and the communication platforms send the communication information to the corresponding communication objects. The number of the communication connections is configured and managed, the communication channels are searched for communication information, differential deployment of the communication channels of the servers is achieved, the number of the servers is not required to be consistent with the number of the communication connections, the communication connections can be fully utilized under the condition that the communication connections provided by the communication platform are unequal and limited, the utilization rate of the communication connections is improved, resource vacancy is avoided, connection resources which depend on the communication platform strongly are not required, the capacity expansion simplicity is improved, and continuously improved capacity requirements are met.
Referring to fig. 7, a flowchart illustrating steps of another embodiment of a method for sending communication information according to the present application is shown, and specifically, the method may include the following steps:
step 701, reading the number of locally used connections associated with each communication channel during cold start;
step 702, respectively establishing communication connections with the same number as the used connection number for each communication channel;
step 703, correspondingly modifying the number of used connections and the number of unused connections associated with each communication channel.
It should be noted that the cold boot may be relative to the hot boot, the cold boot may refer to booting the server in a shutdown state, and the hot boot may be that the server has been booted previously, and needs to be rebooted due to reasons such as adjusting configuration.
In a specific implementation, when the server is in a cold start, the number of locally used connections (i.e., the number of instance connections) associated with each communication channel may be read from the connection management module shown in fig. 3, and since the number of connection instances is already allocated, the number of communication connections written in the configuration information may be created in the server for each communication channel according to the allocated number.
For example, the core data of the read configuration information is shown in the following table:
Id communication channel ID Number of connection instances Server name
1 Zhejiang shift 2 smsserver-1-1
2 Zhejiang shift 3 smsserver-1-2
3 Zhejiang shift 3 smsserver-1-3
4 Movement in the sea 1 smsserver-1-1
5 Zhejiang telecommunication 1 smsserver-1-3
If the name of the local server is 'smsverr-1-1', 2 communication connections can be established for the communication channel with the ID of 'Zhejiang mobile' and connected with Zhejiang mobile operators at the time of cold start, and 1 communication connection can be established for the communication channel with the ID of 'Shanghai mobile' and connected with Shanghai mobile operators.
The following describes a procedure of creating a communication channel by taking a TCP connection as an example of a communication connection.
The TCP protocol is a connection-oriented communication protocol of a transmission layer, provides reliable data transmission, and is characterized by completing the tasks of flow control and error detection and ensuring reliable data transmission. However, the TCP protocol requires the communication gateway and the communication platform to perform three information interactions before transmitting data to ensure accurate and reliable transmission of data, and the process is as follows:
1. the communication gateway sends a data segment containing a flag bit of a synchronous serial number to the communication platform, and requests the communication platform to establish connection;
2. after receiving the request of the server, the communication platform responds to the communication gateway by a data segment with an Acknowledgement (ACK) and a synchronous sequence number (SYN) zone bit;
3. after receiving the data segment, the communication gateway sends a confirmation response to confirm that the data segment of the communication platform is received and starts to transmit actual data.
The connection according to the TCP protocol requires three times of information interaction to ensure that data can be transmitted accurately and reliably, and therefore, certain resources are consumed, and if each communication operation is performed after the connection, the processing speed is reduced. Therefore, after each communication operation is finished, the connection can be disconnected, and the data packet is directly sent when the next communication operation is carried out without reestablishing the connection.
After the communication connection is created, the number of used connections and the number of unused connections associated with each communication channel may be modified accordingly.
Specifically, the number of created communication connections may be increased for the number of used connections of each communication channel, and the number of created communication connections may be decreased for the number of unused connections of each communication channel in the total control table.
Step 704, registering the communication service for the communication channel.
In this embodiment of the present application, a configuration center shown in fig. 3 may dynamically register a communication service for the communication channel, which indicates which communication platform's communication channel is started by the current server, and may provide the communication service of the communication channel.
In a specific implementation, the server may send a message including "uniqId ═ communication channel ID" (unique identifier of the configuration center), the server identifier, and the registration service to the configuration center in the role of the publisher, so as to complete the registration of the communication service.
According to the method and the device, when the cold start is performed, the corresponding communication connection is established according to the number of the used connections associated with each communication channel and in the local area, the current connection resources are fully utilized by configuring the number of the communication connections, and the operation and maintenance cost is reduced.
Step 705, receiving a downlink request of communication information;
step 706, searching a communication channel matched with the communication information according to the downlink request; the communication channel has associated communication connections and a number of used connections;
step 707, when the number of used connections is locally non-zero, sending the communication information to a connected communication platform through the communication connection; and the communication platform is used for sending the communication information to a corresponding communication object.
Referring to fig. 8, a flowchart illustrating steps of another embodiment of a method for sending communication information according to the present application is shown, and specifically, the method may include the following steps:
step 801, receiving a downlink request of communication information;
step 802, searching a communication channel matched with the communication information according to the downlink request; the communication channel has associated communication connections and a number of used connections;
step 803, when the number of the used connections is locally nonzero, the communication information is sent to the connected communication platforms through the communication connections; and the communication platform is used for sending the communication information to a corresponding communication object.
Step 804, when receiving a modification instruction of communication connection, judging whether to open a communication channel associated with the communication connection;
in particular implementations, the state of the communication channel may be maintained via a state table.
For example, an example of the state table may be as shown in the following table:
communication channel ID Status of state
Zhejiang shift Is opened
Zhejiang river Unicom Close off
In the embodiment of the application, whether the communication channel associated with the communication connection is opened or not can be judged by inquiring the state table. If the communication channel is in the "open" state, it may indicate that the communication channel is already opened, and if the communication channel is in the "closed" state, it may indicate that the communication channel is not opened.
Step 805, when the communication channel associated with the communication connection is not opened, unloading communication service for the communication channel;
in the embodiment of the present application, the configuration center shown in fig. 3 may be dynamically offloaded to the communication channel for communication services. After unloading, the configuration center does not have the communication service of the communication channel provided by the server.
In a specific implementation, the server may send a message containing "uniqId ═ communication channel ID" (unique identifier of the configuration center), server identification, and offload service to the configuration center in the role of the publisher, so as to complete registration of the communication service.
Step 806, closing the communication connection associated with the communication channel.
Step 807, the number of used connections and the number of unused connections associated with the communication channel are modified accordingly.
In this embodiment of the present application, the maintenance during the deployment and operation of the communication connection may be performed in a background manner in a timed task manner, or may be manually triggered to perform a single execution, which is not limited in this embodiment of the present application.
The communication connection is modified when the number of communication connections provided by the communication platform increases/decreases, the demand for a single server to send communication information through a certain communication platform increases, and the like.
In the case of warm start, if the server does not open the communication channel associated with the communication connection, it may indicate that the communication information cannot be sent through the communication channel, the communication channel is invalid, the created communication connection is also invalid, and it is necessary to offload the communication service for the communication channel to the configuration center, which indicates that the server does not provide the communication service of the communication channel, and close the communication connection associated with the communication channel to release the connection resource occupied by the server.
If the communication connection is closed, the number of used connections and the number of unused connections associated with the communication channel may be modified correspondingly.
Specifically, the number of closed communication connections may be decreased in the configuration information and the number of used connections in the master table for the communication channel for which the communication service is offloaded, and the number of closed communication connections may be increased in the number of unused connections for the communication channel for which the communication service is offloaded.
In the embodiment of the application, when the server is started in a hot state, if the server does not start the communication channel associated with the communication connection, the communication channel is invalid, the communication service of the communication channel needs to be unloaded, the associated communication connection is closed, and the used connection quantity and the unused connection quantity are correspondingly modified, so that the communication information needing the communication channel service is prevented from being sent to the current server by other servers, and resources are wasted; meanwhile, the occupied connection resources are released, and the operation and maintenance cost is reduced.
Step 808, when the communication channel associated with the communication connection is opened, judging whether the used connection quantity associated with the communication channel is zero locally;
if the server opens the communication channel associated with the communication connection, the server indicates that the communication information can be sent through the communication channel, and the communication channel is effective and can continuously judge whether the communication channel is deployed.
Step 809, when the number of used connections is locally zero, reading the number of locally used connections associated with the communication channel from a memory;
step 810, creating communication connections with the same number as the number of used connections read from the memory for the communication channels;
step 811, correspondingly modifying the number of used connections and the number of unused connections associated with the communication channel;
step 812, registering the communication service for the communication channel.
In the embodiment of the application, when the server is started in a cold state, the initial state is generally that the communication connection is not started. If the communication channel is already started but the communication connection is not started during initialization, configuration start is performed, which causes the problem that the communication channel is already started but the communication connection is not established.
If the number of used connections is locally zero, it may indicate that the communication channel is not deployed in the current server, and no corresponding communication connection transmits communication information.
Although no communication connection is actually created, the number of communication connections assigned to the server is already stored in the memory, so that the number of locally used connections associated with the communication channel can be read from the memory to create a corresponding number of communication connections and register the communication service for the communication channel with the configuration center.
If the communication connection is created, the number of used connections and the number of unused connections associated with the communication channel may be modified correspondingly.
Specifically, the number of created communication connections may be increased for the number of used connections of the communication channel in the configuration information and the master table, and the number of created communication connections may be decreased for the number of unused connections of the communication channel.
When the method and the device are started in a hot mode, if the used connection quantity is zero locally, corresponding communication connection is established according to the local used connection quantity related to the communication channel, so that the problem that the communication channel is opened but the communication connection is not started yet during initialization is solved, current connection resources are fully utilized, and the operation and maintenance cost is reduced.
Step 813, when the number of used connections is locally non-zero, modifying the communication connection associated with the communication channel according to the modification instruction.
Step 814, correspondingly modifying the number of used connections and the number of unused connections associated with the communication channel.
If the number of used connections is locally non-zero, when the number of used connections is locally zero, it may indicate that the communication channel is deployed in the current server, and the communication connection may be modified accordingly according to the modification instruction.
According to the embodiment of the application, the communication connection related to the communication channel is modified according to the modification instruction, and the related used connection quantity and unused connection quantity are correspondingly modified, so that the connection resources are fully utilized, the idle connection resources are avoided, and the operation and maintenance cost is reduced.
In a preferred embodiment of the present application, step 813 may comprise the following sub-steps:
substep S41, when the modification command is an increase connection command, creating a communication connection for the communication channel;
in this embodiment, the connection adding command may be a command for adding a communication connection.
If the communication connection is created, the number of used connections and the number of unused connections associated with the communication channel may be modified correspondingly.
Specifically, the number of communication connections created may be increased for the number of connections used in the configuration information and the master control table of the communication channel, and the number of communication connections created may be decreased for the number of unused connections of the communication channel.
In a preferred embodiment of the present application, step 813 may comprise the following sub-steps:
and a substep S42, closing the communication connection associated with the communication channel when the modification command is a decrease connection command.
In this embodiment, the connection reduction command may be a command for reducing communication connection.
If the communication connection is closed, the number of used connections and the number of unused connections associated with the communication channel may be modified correspondingly.
Specifically, the number of closed communication connections may be decreased with respect to the number of used connections of the communication channel in the configuration information and the master table, and the number of closed communication connections may be increased with respect to the number of unused connections of the communication channel.
In a preferred embodiment of the present application, the following sub-steps may be further included:
step S43, judging whether the modified used connection number is zero; if yes, go to step S46;
step S44, offloading communication services for the communication channel.
If the number of the used connections of the communication channel in the server is zero, it may be indicated that the current server does not have an available communication connection to send the communication information, the communication channel is invalid, and it is necessary to offload the communication service for the communication channel to the configuration center shown in fig. 3, which indicates that the server does not provide the communication service of the communication channel, so as to prevent other servers from sending the communication information that needs the communication channel service to the current server, which causes a problem that the communication information cannot be sent, and avoid wasting resources.
According to the communication channel service unloading method and the communication channel service unloading device, when the communication connection is closed, the number of used connections is zero, the communication service is unloaded, the problem that communication information cannot be sent due to the fact that other servers send communication information needing the communication channel service to the current server is solved, and waste of resources is avoided.
Referring to fig. 9, a flowchart illustrating steps of another embodiment of a method for sending communication information according to the present application is shown, and specifically, the method may include the following steps:
step 901, receiving a downlink request of communication information;
step 902, searching a communication channel matched with the communication information according to the downlink request; the communication channel has associated communication connections and a number of used connections;
step 903, when the number of the used connections is locally nonzero, the communication information is sent to the connected communication platforms through the communication connections; and the communication platform is used for sending the communication information to a corresponding communication object.
Step 904, when the on-line operation is triggered, reading the number of unused connections associated with the communication channel corresponding to the on-line operation;
step 905, when the number of the unused connections is not zero, establishing communication connections for the communication channels;
step 906, correspondingly modifying the number of used connections and the number of unused connections associated with the communication channel;
step 907, register communication service for the communication channel.
It should be noted that the online operation may refer to an operation of adding a server.
Under the conditions of service growth and the like, the capacity is increased, the original server cannot meet the service requirement, and a new server needs to be added to meet the capacity requirement.
The online operation may be an emergency, and the initialization of the configuration information is not time to start, which easily causes the problems of idle start of a new server, no available communication connection, and no possibility of sending any communication information.
According to the embodiment of the application, communication connection can be dynamically bound according to the number of unused connections during online operation so as to obtain connection resources, and the problems that idle startup is caused and any communication information cannot be sent are avoided.
If the communication connection is created, the number of used connections and the number of unused connections associated with the communication channel may be modified correspondingly.
Specifically, the number of created communication connections may be increased for the number of used connections of the communication channel in the configuration information and the master table, and the number of created communication connections may be decreased for the number of unused connections of the communication channel.
Step 908, closing the communication connections associated with all the current communication channels when the offline operation is triggered;
step 909, correspondingly modifying the number of used connections and the number of unused connections associated with the communication channel;
step 910, offloading communication services for the communication channel.
It should be noted that the offline operation may mean that the original server is not used any more, may be temporarily offline, and may also be adjusted by the machine room.
The offline operation may be an emergency, which is likely to cause the situation that the communication connection is released and waste the connection resources.
According to the embodiment of the application, communication connection can be dynamically released according to the number of used connections during offline operation, so that waste of connection resources is avoided.
If the communication connection is closed, the number of used connections and the number of unused connections associated with the communication channel may be modified correspondingly.
Specifically, the number of closed communication connections may be decreased with respect to the number of used connections of the closed communication channel in the configuration information and the master table, and the number of closed communication connections may be increased with respect to the number of unused connections of the closed communication channel.
It should be noted that, for simplicity of description, the method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the embodiments are not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the embodiments. Further, those skilled in the art will also appreciate that the embodiments described in the specification are presently preferred and that no particular act is required of the embodiments of the application.
Referring to fig. 10, a block diagram of an embodiment of a communication information sending apparatus according to the present application is shown, which may specifically include the following modules:
a downlink request receiving module 1001, configured to receive a downlink request for communication information;
a communication channel searching module 1002, configured to search a communication channel matching the communication information according to the downlink request; the communication channel has associated communication connections and a number of used connections;
a first communication information sending module 1003, configured to send the communication information to a connected communication platform through the communication connection when the number of used connections is locally nonzero; and the communication platform is used for sending the communication information to a corresponding communication object.
In a preferred embodiment of the present application, the apparatus may further include the following modules:
the server searching module is used for searching the server with the non-zero used connection number related to the communication channel when the used connection number is locally zero;
the second communication information sending module is used for sending the communication information to the server; the server is used for sending the communication information to the communication platform through the communication connection.
In a preferred embodiment of the present application, the apparatus may further include the following modules:
and the preprocessing module is used for preprocessing the communication information.
In a preferred embodiment of the present application, the communication information may include a communication object identifier and communication content; the communication channel searching module 1002 may include the following sub-modules:
the identifier attribution searching submodule is used for searching a communication channel to which the communication object identifier of the communication information belongs;
and the content matching submodule is used for searching a communication channel matched with the communication content from the communication channel to which the communication object identifier belongs.
In a preferred embodiment of the present application, the communication channel may include a default communication channel and a backup communication channel; the communication channel searching module 1002 may include the following sub-modules:
the default communication channel searching submodule is used for searching a default communication channel matched with the communication information according to the downlink request;
and the backup communication channel searching submodule is used for searching an available backup communication channel when the default communication channel is unavailable.
In a preferred embodiment of the present application, the communication connection may have a message queue therein; the first communication information sending module 1003 may include the following sub-modules:
the thread pool writing submodule is used for respectively writing the communication information into the corresponding thread pools; each thread pool has a corresponding priority;
the message queue writing submodule is used for writing the communication information of the thread pool into the message queue;
and the priority sending submodule is used for sending the communication information in the message queue to a connected communication platform through the communication connection according to the priority of the thread pool to which the communication information belongs.
In a preferred embodiment of the present application, the apparatus may further include the following modules:
the first reading module is used for reading the number of the local used connections related to each communication channel during cold start;
the first establishing module is used for respectively establishing communication connections with the same number as the used connections for each communication channel;
the first modification module is used for correspondingly modifying the number of used connections and the number of unused connections associated with each communication channel;
and the first registration module is used for registering communication service for the communication channel.
In a preferred embodiment of the present application, the apparatus may further include the following modules:
the starting judging module is used for judging whether to start a communication channel related to the communication connection when receiving a modification instruction of the communication connection;
the first unloading module is used for unloading communication service for the communication channel when the communication channel associated with the communication connection is not opened;
the first closing module is used for closing the communication connection related to the communication channel;
and the second modification module is used for correspondingly modifying the number of the used connections and the number of the unused connections associated with the communication channel.
In a preferred embodiment of the present application, the apparatus may further include the following modules:
the first judgment module is used for judging whether the used connection quantity associated with the communication channel is zero locally or not when the communication channel associated with the communication connection is opened;
the second reading module is used for reading the local used connection quantity associated with the communication channel from the memory when the local used connection quantity is zero;
the second establishing module is used for establishing communication connections with the same number as the used connections read from the memory for the communication channels;
a third modification module, configured to modify the number of used connections and the number of unused connections associated with the communication channel correspondingly;
and the second registration module is used for registering communication service for the communication channel.
In a preferred embodiment of the present application, the apparatus may further include the following modules:
the fourth modification module is used for modifying the communication connection related to the communication channel according to the modification instruction when the number of the used connections is locally nonzero;
and a fifth modification module, configured to modify the number of used connections and the number of unused connections associated with the communication channel correspondingly.
In a preferred embodiment of the present application, the fourth modification module may include the following sub-modules:
and the third establishing submodule is used for establishing communication connection for the communication channel when the modification instruction is an increasing connection instruction.
In a preferred embodiment of the present application, the fourth modification module may include the following sub-modules:
and the second closing submodule is used for closing the communication connection related to the communication channel when the modification instruction is a connection reduction instruction.
In a preferred embodiment of the present application, the apparatus may further include the following modules:
the second judgment module is used for judging whether the modified used connection quantity is zero or not; if so, calling a second unloading module;
and the second unloading module is used for unloading the communication service for the communication channel.
In a preferred embodiment of the present application, the apparatus may further include the following modules:
the third reading module is used for reading the number of unused connections associated with the communication channel corresponding to the online operation when the online operation is triggered;
the fourth establishing module is used for establishing communication connection for the communication channel when the number of the unused connections is not zero;
a sixth modification module, configured to modify the number of used connections and the number of unused connections associated with the communication channel correspondingly;
and the third registration module is used for registering communication service for the communication channel.
In a preferred embodiment of the present application, the apparatus may further include the following modules:
the third closing module is used for closing the communication connections related to all the current communication channels when the offline operation is triggered;
a seventh modification module, configured to modify the number of used connections and the number of unused connections associated with the communication channel correspondingly;
and the third unloading module is used for unloading the communication service for the communication channel.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
The embodiments in the present specification are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other.
As will be appreciated by one of skill in the art, embodiments of the present application may be provided as a method, apparatus, or computer program product. Accordingly, embodiments of the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
In a typical configuration, the computer device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory. The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium. Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transmyedia), such as modulated data signals and carrier waves.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing terminal to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing terminal to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing terminal to cause a series of operational steps to be performed on the computer or other programmable terminal to produce a computer implemented process such that the instructions which execute on the computer or other programmable terminal provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present application have been described, additional variations and modifications of these embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including the preferred embodiment and all such alterations and modifications as fall within the true scope of the embodiments of the application.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or terminal that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or terminal. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or terminal that comprises the element.
The above detailed description is given to a communication information sending method and a communication information sending device provided by the present application, and a specific example is applied in the present application to explain the principle and the implementation manner of the present application, and the description of the above embodiment is only used to help understanding the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (16)

1. A method for sending a communication message, comprising:
receiving a downlink request of communication information;
searching a communication channel matched with the communication information according to the downlink request; the communication channel has associated communication connections and a number of used connections;
and when the number of the used connections is not zero locally, the communication information is sent to the connected communication platforms through the communication connections, and the communication platforms are used for sending the communication information to the corresponding communication objects.
2. The method of claim 1, further comprising:
when the number of the used connections is locally zero, searching a server which is associated with the communication channel and has non-zero number of the used connections;
and sending the communication information to the server, wherein the server is used for sending the communication information to the communication platform through the communication connection.
3. The method according to claim 1, wherein before the step of searching for the communication platform corresponding to the communication information according to the downlink request, the method further comprises:
and preprocessing the communication information.
4. The method of claim 1, wherein the communication information comprises communication object identification and communication content; the step of searching the communication channel matched with the communication information according to the downlink request comprises the following steps:
searching a communication channel to which a communication object identifier of the communication information belongs;
and searching a communication channel matched with the communication content from the communication channels to which the communication object identifiers belong.
5. The method of claim 1 or 2 or 3 or 4, wherein the communication channel comprises a default communication channel and a backup communication channel; the step of searching the communication channel matched with the communication information according to the downlink request comprises the following steps:
searching a default communication channel matched with the communication information according to the downlink request;
and when the default communication channel is unavailable, searching for an available backup communication channel.
6. A method according to claim 1, 2 or 3, characterized in that there is a message queue in the communication connection; the step of sending the communication information to the connected communication platform through the communication connection comprises the following steps:
respectively writing the communication information into corresponding thread pools; each thread pool has a corresponding priority;
writing the communication information of the thread pool into the message queue;
and sending the communication information in the message queue to a connected communication platform through the communication connection according to the priority of the thread pool to which the communication information belongs.
7. The method of claim 1, wherein prior to the step of receiving the downstream request for communication information, further comprising:
reading the number of local used connections associated with each communication channel during cold start;
establishing communication connections with the same number as the used connection number for each communication channel;
correspondingly modifying the number of used connections and the number of unused connections associated with each communication channel;
and registering communication service for the communication channel.
8. The method of claim 1, further comprising:
when a modification instruction of communication connection is received, judging whether a communication channel associated with the communication connection is opened or not;
when the communication channel related to the communication connection is not opened, unloading communication service for the communication channel;
closing the communication connection related to the communication channel;
and correspondingly modifying the number of used connections and the number of unused connections associated with the communication channel.
9. The method of claim 8, further comprising:
when the communication channel associated with the communication connection is opened, judging whether the number of the used connections associated with the communication channel is zero locally;
when the number of the used connections is locally zero, reading the number of the locally used connections associated with the communication channel from a memory;
establishing communication connections with the same number as the number of used connections read from the memory for the communication channels;
correspondingly modifying the number of used connections and the number of unused connections associated with the communication channel;
and registering communication service for the communication channel.
10. The method of claim 9, further comprising:
when the number of the used connections is locally nonzero, modifying the communication connections related to the communication channels according to the modification instruction;
and correspondingly modifying the number of used connections and the number of unused connections associated with the communication channel.
11. The method of claim 10, wherein modifying the communication connection associated with the communication channel according to the modification instruction comprises:
and when the modification instruction is an increase connection instruction, establishing communication connection for the communication channel.
12. The method of claim 10, wherein modifying the communication connection associated with the communication channel according to the modification instruction comprises:
and when the modification instruction is a connection reduction instruction, closing the communication connection related to the communication channel.
13. The method of claim 12, further comprising:
judging whether the modified used connection quantity is zero or not; and if so, unloading the communication service for the communication channel.
14. The method of claim 1, further comprising:
when on-line operation is triggered, reading the number of unused connections associated with the communication channel corresponding to the on-line operation;
when the number of the unused connections is not zero, establishing communication connections for the communication channel;
correspondingly modifying the number of used connections and the number of unused connections associated with the communication channel;
and registering communication service for the communication channel.
15. The method of claim 1 or 14, further comprising:
when the offline operation is triggered, closing the communication connections associated with all the current communication channels;
correspondingly modifying the number of used connections and the number of unused connections associated with the communication channel;
and unloading communication service for the communication channel.
16. A communication information transmitting apparatus, comprising:
a downlink request receiving module, configured to receive a downlink request for communication information;
the communication channel searching module is used for searching a communication channel matched with the communication information according to the downlink request; the communication channel has associated communication connections and a number of used connections;
the first communication information sending module is used for sending the communication information to the connected communication platforms through the communication connection when the used connection number is locally nonzero; and the communication platform is used for sending the communication information to a corresponding communication object.
HK16112077.3A 2016-10-20 Method and device for sending communication information HK1224124B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410532592.1A CN105578426B (en) 2014-10-10 2014-10-10 A kind of sending method and device of communication information

Publications (2)

Publication Number Publication Date
HK1224124A1 true HK1224124A1 (en) 2017-08-11
HK1224124B HK1224124B (en) 2020-04-24

Family

ID=

Also Published As

Publication number Publication date
CN105578426B (en) 2019-03-29
CN105578426A (en) 2016-05-11

Similar Documents

Publication Publication Date Title
CN111736872B (en) Gray scale release upgrading method, device, computer system and readable storage medium
KR102277186B1 (en) Delivery of application services through application service avatars
CN113535648B (en) IPFS-based distributed cloud storage method, IPFS-based distributed cloud storage equipment and storage medium
CN113037831B (en) Service gateway message processing method and device
US7925785B2 (en) On-demand capacity management
JP5485993B2 (en) Service load balancing
US20030126196A1 (en) System for optimizing the invocation of computer-based services deployed in a distributed computing environment
CN108616398B (en) DNS load balancing technology-based container dynamic capacity reduction method
EP2838243B1 (en) Capability aggregation and exposure method and system
CN105578426A (en) Communication information transmitting method and communication information transmitting device
CN112418794B (en) Service circulation method and device
CN114363233B (en) Packet routing method, device, electronic equipment and storage medium
CN112433863A (en) Micro-service calling method and device, terminal equipment and storage medium
CN101146089A (en) Method for configuring core resources on multi-core system, multi-core system and management core
CN116566984B (en) Routing information creation method and device of k8s container cluster and electronic equipment
CN108880896B (en) Program gray level publishing method and device based on mainframe
CN112988378A (en) Service processing method and device
CN112579310B (en) Service calling method and device
EP3796598A1 (en) Node switching method, network node, network system, and storage medium
CN113485758A (en) Micro-service issuing method and device, electronic equipment and storage medium
CN112532666A (en) Reverse proxy method, apparatus, storage medium, and device
CN112579639A (en) Data processing method and device, electronic equipment and storage medium
CN114640553A (en) Message processing method and device
US10819777B1 (en) Failure isolation in a distributed system
CN114092256B (en) Online transaction method, device, program product, readable medium and electronic device

Legal Events

Date Code Title Description
PC Patent ceased (i.e. patent has lapsed due to the failure to pay the renewal fee)

Effective date: 20241010