CN108696588B - Information sending method and equipment - Google Patents

Information sending method and equipment Download PDF

Info

Publication number
CN108696588B
CN108696588B CN201810455647.1A CN201810455647A CN108696588B CN 108696588 B CN108696588 B CN 108696588B CN 201810455647 A CN201810455647 A CN 201810455647A CN 108696588 B CN108696588 B CN 108696588B
Authority
CN
China
Prior art keywords
server
information
target
link
target information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810455647.1A
Other languages
Chinese (zh)
Other versions
CN108696588A (en
Inventor
程慧琳
柳德超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201810455647.1A priority Critical patent/CN108696588B/en
Priority to PCT/CN2018/097552 priority patent/WO2019218479A1/en
Publication of CN108696588A publication Critical patent/CN108696588A/en
Application granted granted Critical
Publication of CN108696588B publication Critical patent/CN108696588B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/566Grouping or aggregating service requests, e.g. for unified processing

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The invention is suitable for the technical field of Internet, and provides an information sending method and system, comprising the following steps: the first server receives target information sent by an information sending end; determining a link number based on the user identifier and the application identifier; if the first local link list does not contain the link number, adding the link number to target information, and pushing the target information to an information push server; the information push server pushes target information to each second server in the information push list; and if the second local link list contains the link number, the second server sends the target information to the information receiving end through the communication link corresponding to the link number. In the invention, the mutual information transmission between different servers does not need to establish a special physical link, but can realize the information transmission and reception operation of the cross-server through the issuing and pushing functions of the information pushing server, thereby reducing the information transmission cost.

Description

Information sending method and equipment
Technical Field
The invention belongs to the technical field of internet, and particularly relates to an information sending method and equipment.
Background
With the continuous deepening of the informatization process, the frequency of data receiving and sending among devices is higher and higher, and when the devices in different servers need to perform information interaction, an information exchange technology crossing the servers needs to be used. The existing information exchange technology across servers can realize information mutual transmission only by building a physical link between the servers. However, the method has a long construction period and a large difficulty in network expansion, and the physical link needs extra manpower and material resources for maintenance, so that the transmission cost is increased.
Disclosure of Invention
In view of this, embodiments of the present invention provide an information sending method and device, so as to solve the problems that in the existing cross-server information exchange technology, a physical link needs to be established between servers, so that the establishment period is long, the network expansion difficulty is large, and the physical link also needs to be maintained by extra manpower and material resources, so that the transmission cost is increased.
A first aspect of an embodiment of the present invention provides an information sending method, where the information sending system includes: the method comprises a first server, a second server and an information pushing server, wherein the information sending method comprises the following steps:
the first server receives target information sent by an information sending end; the target information carries a user identifier of an information receiving end and an application identifier of an application program to which the target information belongs;
the first server determines a link number for sending the target information based on the user identifier and the application identifier;
if the first local link list of the first server does not contain the link number, the first server adds the link number to the target information and sends the target information to the information push server;
the information push server pushes the target information to each second server in an information push list; the information push list is used for recording a second server which establishes a subscription relationship with the information push server;
and if the second local link list of the second server contains the link number of the target information, the second server sends the target information to the information receiving end through a communication link corresponding to the link number.
A second aspect of an embodiment of the present invention provides an information transmission system, including: the system comprises a first server, a second server and an information push server:
the first server is used for receiving the target information sent by the information sending end; the target information carries a user identifier of an information receiving end and an application identifier of an application program to which the target information belongs;
the first server is used for determining a link number for sending the target information based on the user identification and the application identification;
the first server is configured to add the link number to the target information and send the target information to the information push server if the first local link list of the first server does not include the link number;
the information push server is used for pushing the target information to each second server in an information push list; the information push list is used for recording a second server which establishes a subscription relationship with the information push server;
the second server is configured to send the target information to the information receiving end through a communication link corresponding to the link number if the second local link list of the second server includes the link number of the target information.
The information sending method and the information sending system provided by the embodiment of the invention have the following beneficial effects:
according to the embodiment of the invention, the first server and the second server establish the service subscription relationship with the information push server, so that the information can be uploaded to the information push server and the information pushed by the push server can be received. Based on the networking characteristics among the three servers, when an information sending end sends target information to a first server to which the information sending end belongs, the first server can determine a link number of the target information, and if the link number is not in a local link list of the first server, the link number is sent to an information pushing server and is handed to the information pushing server to be forwarded to other servers with subscription relations; if one server exists in the servers which have a subscription relationship with the information push server, namely the local link list of the second server contains the link number of the target information, the second server forwards the target information to the information receiving end corresponding to the link number. Compared with the existing information interaction technology of crossing servers, the information interaction between different servers does not need to establish a special physical link, but can realize the information receiving and sending operation of crossing servers through the issuing and pushing functions of the information pushing server, thereby reducing the information transmission cost.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the embodiments or the prior art descriptions will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is an interaction flowchart of a method for sending information according to a first embodiment of the present invention;
fig. 2 is a detailed interaction flowchart of a method for sending information S102 according to a second embodiment of the present invention;
fig. 3 is a flowchart illustrating a specific implementation of a method for sending information according to a third embodiment of the present invention;
fig. 4 is a flowchart of a detailed implementation of a method for sending information S302 according to a fourth embodiment of the present invention;
fig. 5 is a flowchart of a specific implementation of a method for sending information S104 according to a fifth embodiment of the present invention;
fig. 6 is a block diagram of a system for transmitting information according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
According to the embodiment of the invention, the first server and the second server establish the service subscription relationship with the information push server, so that the information can be uploaded to the information push server and the information pushed by the push server can be received. Based on the networking characteristics among the three servers, when an information sending end sends target information to a first server to which the information sending end belongs, the first server can determine a link number of the target information, and if the link number is not in a local link list of the first server, the link number is sent to an information pushing server and is handed to the information pushing server to be forwarded to other servers with subscription relations; if one server exists in the servers which have a subscription relationship with the information pushing server, namely the local link list of the second server contains the link number of the target information, the second server forwards the target information to the information receiving end corresponding to the link number, and the problems that in the existing information exchange technology of crossing servers, a physical link needs to be built between the servers, the building period is long, the network expansion difficulty is high, the physical link needs extra manpower and material resources for maintenance, and the transmission cost is increased are solved.
In the embodiment of the present invention, the main execution body of the flow is an information transmission system. The information sending equipment comprises a first server, a second server and an information pushing server, wherein the first server and the second server can be different types of servers, but the two servers establish a subscription relationship with the information pushing server, and can upload information to the information pushing server and receive the information sent by the information pushing server. The information push server can push the received information to all servers in an information push list, so that the function of information publishing is achieved. Fig. 1 shows an interaction flowchart of a method for sending information according to a first embodiment of the present invention, which is detailed as follows:
in S101, the first server receives target information sent by an information sending end; the target information carries a user identifier of an information receiving end and an application identifier of an application program to which the target information belongs.
In this embodiment, if the information sending end needs to send information to the information receiving end, the information sending end sends a piece of target information to the server to which the local server belongs, that is, the first server, so as to send the target information to the information receiving end through the first server through the corresponding communication link, thereby completing the purpose of sending information. When the information sending end generates the target information, the user identifier of the information receiving end is encapsulated in the target information, so that the first server can determine the receiving equipment corresponding to the information when receiving the target information. Moreover, the target information output by different application programs may also carry an application identifier of the application program, for example, for an audio file output by an audio application program, the application identifier of the audio application program may be marked, and for an image editing application program, an output edited image may also be attached with the application identifier of the image editing application program, and servers corresponding to different application programs are different, and thus corresponding information transmission links may also differ.
It should be noted that, the first server may receive target information sent by different information sending ends, and for different information sending ends, a concurrence thread may be allocated in the main thread for processing an information sending request of the information sending end.
In this embodiment, the user identifier of the correspondent node is specifically identity information used for representing an object to be sent by the target information, and may be a user account and a user number of the correspondent node, or may be a target address or a device number where the correspondent node is located. If the opposite communication terminal is a user account, it is necessary to determine a server that the user currently logs in, in this case, an information sending system needs to acquire currently online device information in each server and a user account associated with each device information, determine a user terminal that the user account logs in based on matching between the user account included in the target information and the currently online device information in each server, and use the user terminal as a message receiving terminal of the target information.
In this embodiment, the application identifier may be information such as a program name and an application number of the application program output by the target information, and is specifically used for identifying different application programs.
In S102, the first server determines a link number for transmitting the target information based on the user identifier and the application identifier.
In this embodiment, when receiving a target message, the first server may extract a user identifier and an application identifier included in the target message, and may determine a communication address of an information receiving end through the user identifier, and may determine an interface/port used by the information receiving end to transmit the type of information through the application identifier, so that based on the two pieces of information, a link number used for transmitting the target message may be obtained.
In this embodiment, the encoding rules of the link codes used by the servers are the same, so that the link number generated by the first server according to the user identifier and the application identifier is not only suitable for encoding the data transmission link included in the first server, but also suitable for other servers except the first server. The coding rule of the link code can be downloaded from the upper device corresponding to the server, and in this case, the upper device corresponding to the server broadcasts the coding rule of the link code to the servers in the whole network, so that the purpose of unifying the link code rules is achieved. Optionally, the upper device is provided with a coding update condition, and if it is detected that the current time meets a preset coding update condition, for example, a new server is added to the network, or a coding update cycle is reached, the updated coding rule is broadcasted, so as to achieve the purpose of updating the coding rule.
Optionally, in this embodiment, a manner of generating the link code by the first server based on the user identifier and the application identifier may be: and according to a preset cross coding algorithm, on the basis of the user identification, the application identification is inserted in a cross mode to obtain the link number. Optionally, the link encoding rule may also be a hash function, and the first server imports the user identifier and the application identifier into the hash function to output the link numbers corresponding to the two parameters.
In this embodiment, the first server records a list of link numbers of all currently valid data links, i.e. a first local link list. The first server, after determining the link code used to transmit the target message, detects whether the link code is in the local link list. If the link code is in the list, the target message is transmitted to a corresponding information receiving end through the first server, and under the condition, the first server determines the data link of the link code and sends the data link to a communication opposite end through the data link without handing the data link to an information pushing server; on the contrary, if the link code is not in the list, it indicates that the information interaction between the servers belongs to, and the operation of S103 is executed.
In S103, if the first local link list of the first server does not include the link number, the first server adds the link number to the target information, and sends the target information to the information push server.
In this embodiment, if the link number is not recorded in the first local link list, in this case, the first server will add the link number to the target information, and upload the added target information to the information push server having a subscription relationship with the target information, so as to forward the target information to the server where the information receiving end is located through the information push server, and then submit the target information to the server for sending the target information.
In this embodiment, the first server and the information push server have a subscription relationship, that is, the "publishing" operation of the information may be performed by the information push server, that is, when the information push server receives the information sent by the server a, the information push server may send the received information to all devices that subscribe to the subscription relationship of the information push server, not limited to the server but also to various types of terminal devices, that is, it is equivalent to the server a performing the "publishing" operation on the information. The first server can also realize the function of subscription through the information push server, and receive the messages published by other servers in the publication operation.
Optionally, before the first server sends the target message to the information push server, the method may further include: the first server detects whether a subscription function is started or not, and sends a subscription relationship establishment request to the information push server if the subscription function is not started; after receiving the subscription relationship establishment request, the information push server authenticates the request, if the authentication is successful, the first server is added into the information push list, and sends the subscription success information to the first server, and the subscription relationship establishment is successful. And after the operation is finished, sending the target message to the information push server.
In S104, the information push server pushes the target information to each second server in an information push list; the information push list is used for recording a second server which establishes a subscription relationship with the information push server.
In this embodiment, the information push server stores an information push list, and each second server that establishes a subscription relationship with the information push server is recorded in the information push list. After the information push server receives the target information, the target information is pushed to each server, and the operation of information release is realized. Optionally, the information push server is provided with a push trigger condition, for example, to detect whether the current time reaches a preset push period, or whether the total data amount of the information to be pushed exceeds a preset threshold, and when it is detected that the current time meets the push trigger condition, the information push server executes to push the target message.
In this embodiment, the information push list may only record the second servers having valid subscription relationship at the current time, and may also record the unsubscribed servers that have subscribed to the information push server. For the unsubscribed server or the terminal equipment, the information pushing server stores the information which is not pushed into a cache unit corresponding to the unsubscribed server or the terminal equipment, and pushes the information which is not sent in the cache unit after detecting that the equipment reestablishes the subscription relationship.
In S105, if the second local link list of the second server includes the link number of the target information, the second server sends the target information to the information receiving end through the communication link corresponding to the link number.
In this embodiment, if a link number of target information is recorded in the second local link list of a certain second server, it indicates that an information receiving end of the target information is connected to the second server, and in this case, the second server queries a communication link corresponding to the link number and sends the target information to the information receiving end through the communication link.
In this embodiment, if the second local link list of the second server does not have the link number of the target message recorded therein, it indicates that the message receiving end is not connected to the second server. Optionally, if the second server further establishes a subscription relationship with another information push server, in this case, the second server may further push the target information to the other information push server, and the other information push server forwards the target information, and the specific implementation process may refer to the relevant operations of S104 and S105 until determining that the server connected to the information receiving end is reached.
As can be seen from the above, in the information sending method provided in the embodiment of the present invention, a service subscription relationship is established between the first server and the information push server, so that a message can be uploaded to the information push server and a message pushed by the information push server can be received. Based on the networking characteristics among the three servers, when an information sending end sends target information to a first server to which the information sending end belongs, the first server can determine a link number of the target information, and if the link number is not in a local link list of the first server, the link number is sent to an information pushing server and is handed to the information pushing server to be forwarded to other servers with subscription relations; if one server exists in the servers which have a subscription relationship with the information push server, namely the local link list of the second server contains the link number of the target information, the second server forwards the target information to the information receiving end corresponding to the link number. Compared with the existing information interaction technology of crossing servers, the information interaction between different servers does not need to establish a special physical link, but can realize the information receiving and sending operation of crossing servers through the issuing and pushing functions of the information pushing server, thereby reducing the information transmission cost.
Fig. 2 shows a specific interaction flowchart of a method for sending information S102 according to a second embodiment of the present invention. Referring to fig. 2, in the embodiment described with respect to fig. 1, S102 in the sending method of information provided in this embodiment includes: s1021 to S1025 are specifically described as follows:
further, the user identification comprises a target address of the information receiving terminal; the first server determines a link number for transmitting the target information based on the user identifier and the application identifier, and includes:
in S1021, the first server sends a routing table obtaining request to the information push server.
In this embodiment, the user identifier includes a destination address of the information receiving end, the first server only records address information of the terminal device connected to each port of the server, and the information receiving end is not necessarily connected to the local port. Therefore, the first server sends a routing table acquisition request to the information push server so as to collect routing information of all servers having a subscription relationship with the information push server.
In this embodiment, the first server may establish a subscription relationship with a plurality of information push servers at the same time, in which case, the first server may establish a communication link with each information push server, and send a routing table acquisition request to each information push server. By the above mode, when it is determined that the information receiving end is not connected with the first server and needs to forward through the information pushing server, the target information can be sent to the information pushing server corresponding to the target address, so that the information pushing efficiency is improved, and the condition of invalid uploading is avoided.
In S1022, the information push server broadcasts a routing table summarizing instruction to receive routing information sent by each server that has a subscription relationship with the information push server, and summarizes all the routing information to generate an external routing table.
In this embodiment, after receiving the routing table acquisition request, the information push server generates a routing table summarizing instruction, and broadcasts the routing table summarizing instruction to each device connected to the information push server, so that each server having a subscription relationship with the information push server returns its own routing information. It should be noted that, if some terminal devices do not directly communicate with the information push server via the server, in this case, the information push server directly adds the routing information of the terminal device directly connected to the information push server to the external routing table.
In this embodiment, after receiving the routing table summarizing instruction, the server that has a subscription relationship with the information push server acquires the network address of each port, generates routing information corresponding to the server, and returns the routing information to the information push server. After receiving the routing information returned by all the servers, the information push server collects all the routing information and generates an external routing table of the first server. Optionally, the information push server may be configured with a maximum waiting time, after the information push server broadcasts a routing table summarizing instruction to each server, a waiting timer may be started, and if the waiting timer reaches the maximum waiting time and a server still does not return routing information, an external routing table is generated based on the routing information received at the current time, and the server that does not return routing information is identified as an abnormal server, and an abnormal operation is performed.
In S1023, the first server receives the external routing table sent by the information push server, queries the local routing table of the first server and the external routing table, and determines a target server corresponding to a target address of the user identifier; and generating a main coding factor based on the equipment identification of the target server.
In this embodiment, after generating the external routing table, the information push server sends the external routing table to the first server, and then the first server queries the local routing table in which the routing information of each port is recorded and whether the external routing table contains the target address in the target information, and then may locate the target server to which the target address is recorded, that is, it means that the target information is sent to the target server, and may forward the target information to the receiving end of the information through the target server.
In this embodiment, after determining the target server, the first server may obtain the device identifier of the target server, and generate a primary encoding factor for determining the link number according to the device identifier. It should be noted that the primary coding factor is unique, and since the device identifiers of different servers are different, the primary coding factors output after conversion will be different, and if two link codes with the same primary coding factor are encoded, they belong to the same device. The sub-coding factors are determined based on the network protocol used for transmitting the target information, and different servers can share the same set of network protocol, so that the sub-coding factors corresponding to different servers can be the same and do not have uniqueness.
In this embodiment, the manner of generating the primary coding factor according to the device identifier may be: the first server stores a conversion algorithm of the main coding factor, the conversion algorithm can be a hash function, and the first server imports the device identifier into the conversion algorithm and can output the corresponding main coding factor. Preferably, the first server may directly use the device identifier as the primary encoding factor, or select the content of a fixed field in the device identifier as the primary encoding factor.
In S1024, the first server determines, based on the application identifier, a network protocol to be invoked for transmitting the target information and a communication port number corresponding to each of the network protocols; and generating a sub-coding factor according to the communication port number.
In this embodiment, the first server further determines an application identifier to which the target message belongs, that is, by which application program the target message is output. During data interaction of different applications, the network protocols used are different, for example, for web applications, the HTTP protocol is mainly used, and the used port number is 80, and for mail applications, the STMP protocol is mainly used, and the corresponding port number is 25. Therefore, the network protocols used by different applications are different, and the port numbers for transmitting the protocols are also different. The first server needs to determine not only the device identifier corresponding to the target message, but also which port to transmit the target message to the device, and thus determines the network protocol to be invoked for transmitting the application based on the application identifier, thereby obtaining the communication port number corresponding to each network protocol, and generating the sub-coding factor based on the port number. Preferably, the first server may directly use the port number as the sub-coding factor.
It should be noted that, the S1021 to S1023 and the S1024 are independent from each other, and there is no precedence relationship, that is, the first server may determine the main coding factor first, may determine the sub-coding factor first, and may determine both the main coding factor and the sub-coding factor at the same time.
In S1025, the first server obtains the link number based on the primary encoding factor and the secondary encoding factor.
In this embodiment, after determining the main coding factor and the sub coding factor, the first server may synthesize the two coding factors to obtain the link number of the target information. Wherein, the specific process of the synthesis can be as follows: the main coding factor and the sub coding factor are directly spliced, and cross combination can also be carried out. Certainly, the user can set the merging mode by himself, and after the setting is finished, the merging mode is synchronized to the servers of the whole network, so that the merging mode of the whole network is kept consistent.
In the embodiment of the invention, after the main coding factor and the sub-coding factor of the link code are determined, the link code is output, so that the link code has uniqueness, and meanwhile, the target equipment needing to be transmitted and the communication channel needing to be used can be accurately positioned, and accurate transmission is realized.
Fig. 3 is a flowchart illustrating a specific implementation of a method for sending information according to a third embodiment of the present invention. Referring to fig. 3, with respect to the embodiment shown in fig. 1, the method for sending information provided in this embodiment further includes S301 to S304, which are described in detail as follows:
further, before the first server establishes a long connection with the information push server, the information sending method further includes:
in S301, if the first server receives the long connection request sent by the information sending end, a long connection validity timer is started, and a long connection link with the information sending end is added to the first local link list.
In this embodiment, when the first server needs to establish a connection with the information sending end, a long connection request is sent to the information sending end, and since when to return the sending result information to the information sending end and when to push the information to the first server by the information sending end are both random, the connection between the first server and the information sending end needs to be effective for a long time in the connection process, so as to ensure that the information can be sent immediately and the sending result can be returned to the first server.
In this embodiment, in order to maintain the validity of the long connection between the first server and the information sending end, the first server starts a long connection validity timer to determine the validity of the long connection. At this time, an effective long connection is already established between the first server and the information sending end, so that the long connection link is added into the first local link list, and a link number is configured for the long connection link.
In S302, if the first server receives a data packet sent by an information sending end, it is identified whether a data type of the data packet is a heartbeat data type.
In this embodiment, after the long connection link is established, the information sending end sends a heartbeat packet to the first server at a preset periodic interval in order to maintain the validity of the long connection link. And the duration of the preset period is less than the failure threshold of the long connection validity timer.
In this embodiment, if the value of the validity timer of the first server is smaller than the preset threshold and the data packet sent by the information sending end is received, it is detected whether the data type of the data packet is the heartbeat data type. The heartbeat data type is specifically a data packet used to maintain a long connection valid. Preferably, the heartbeat data packet does not carry valid information. The heartbeat data packet may be a data packet formed by a preset pulse frequency, and may also be a data packet with all 0 or all 1 of a preset number of bits. The first server acquires the data characteristics of the heartbeat data packet and detects whether the received data packet conforms to the data characteristics. If the data packet conforms to the data characteristics, performing the relevant operation of S303; otherwise, if the packet is not a heartbeat packet, the long connection validity timer continues to count.
In S303, if the data type of the data packet is a heartbeat data type, the first server resets the value of the long connection validity timer.
In this embodiment, if the data type of the data packet sent by the information sending end is a heartbeat data type, it indicates that the data packet is a heartbeat data packet, and is used to maintain the validity of the long connection, so that the value of the long connection validity timer is reset to avoid that the long connection is failed due to the timeout of the long connection validity timer.
In S304, if the value of the long connection validity timer reaches a preset threshold, the first server disconnects the long connection link, and deletes the link number corresponding to the long connection link from the first local link list.
In this embodiment, if the value of the long connection validity timer reaches the preset threshold and the heartbeat packet sent by the information sending end is not received, it may be determined that the information sending end has an abnormal condition, and the long connection link cannot be maintained by an effective means. In this case, in order to avoid the resource waste caused by the occupied long connection port, the first server may disconnect the long connection link and release the resources for maintaining the long connection link, such as the port resources and the listener listening to the heartbeat data packet and the related thread resources. On the other hand, since the long connection link has failed, the first server also deletes the link number corresponding to the long connection link from the first local link list.
In the embodiment of the invention, after the long connection between the first server and the information sending end is established, the long connection is maintained by sending the heartbeat data packet, and the value of the effective counter of the long connection is refreshed periodically, so that the stability of the long connection is improved.
Fig. 4 shows a flowchart of a specific implementation of a method S302 for sending information according to a fourth embodiment of the present invention. Referring to fig. 4, with respect to the embodiment described in fig. 3, in the sending method of information provided in this embodiment, S302 includes: s3021 to S3023 are specifically described as follows:
in S3021, the first server obtains the data amount of the data packet.
In this embodiment, since the heartbeat data packet generally does not include valid data, the data type of a certain data packet is the heartbeat data type, and the data amount corresponding to the data packet should be small. Therefore, in order to quickly identify whether the data packet is a heartbeat data packet, most of the data packets of non-heartbeat data types can be filtered out through the data volume.
In this embodiment, if the data amount of the received data packet is greater than or equal to the preset data amount threshold, it indicates that the data packet has an effective information field, and the data type of the data packet is a non-heartbeat data packet, and the first server performs corresponding operations such as forwarding or outputting on the data packet; otherwise, if the data amount of the data packet is smaller than the preset data amount threshold, the operation of S3022 is performed.
In S3022, if the data amount is smaller than the preset data amount threshold, the first server parses a bit value of a reserved field of the data packet.
In this embodiment, if the data amount of the data packet is smaller than the preset data amount threshold, it is detected whether the bit value in the reserved field for marking the data type is a preset bit value. If the bit value in the reserved field is not a preset bit value, the data packet may be a synchronization frame or a connection detection frame, and corresponding operation is executed based on the data type of the data packet; otherwise, if the position of the reserved field of the data packet is the preset bit value, the related operation of S3023 is performed.
In S3023, if the bit value of the reserved field is a preset bit value, the first server identifies that the data type of the data packet is a heartbeat data type.
In this embodiment, the first server records bit value information corresponding to the heartbeat data packet, that is, the preset bit value, and if the bit value of a certain data packet in the reserved field is the same as the preset bit value, it indicates that the data type of the data packet is the heartbeat type, thereby implementing the identification operation on the heartbeat data packet.
In the embodiment of the invention, the data packets with large capacity are filtered according to the data volume, so that the operation of identifying the heartbeat data type of the data with large capacity is avoided, and the identification efficiency of the heartbeat data packets is improved. Since it takes a long time to parse a large volume of data packets, which are generally not of the heartbeat data type, a large number of invalid parsing operations can be avoided.
Fig. 5 shows a flowchart of a specific implementation of a method for sending information S104 according to a fifth embodiment of the present invention. Referring to fig. 5, with respect to the embodiments described in fig. 1 to fig. 4, in the sending method of information provided by this embodiment, S104 includes: s1041 and S1042 are specifically described as follows:
further, the target information carries a skip counter; the information pushing server pushes the target information to each second server in an information pushing list, and the method comprises the following steps:
in S1041, if the count value of the skip counter is less than or equal to a preset skip threshold, the information push server increases the count value of the skip counter of the target information, and pushes the target information to each second server in the information push list.
In this embodiment, since the server may establish a subscription relationship with a plurality of information push servers at the same time, when a certain server detects that the link number of the target information does not exist in the local link list, the certain server may be handed over to another information push server to forward the target information, thereby implementing information publishing across the information push servers. In order to avoid that one target message continuously flows between two information push servers to lead to a fatal cycle, the target message carries a skip timer for recording the times of the information push servers passed by the target message in the sending process. If the count value of the jump counter is less than or equal to the jump threshold, executing the relevant operation of S1041; otherwise, if the count value of the skip counter is greater than the preset skip threshold, the relevant operation of S1042 is executed.
In this embodiment, if the count value of the skip counter does not exceed the skip threshold, it indicates that the target information may be further distributed across the information push servers, in this case, the information push server increases the count value of the skip timer, and pushes the target information to each second server in the push list.
In S1042, if the count value of the skip timer is greater than the skip threshold, the information push server returns a sending failure message to the first server.
In this embodiment, if the count value of the skip timer is greater than the skip threshold, it indicates that the number of skips of the target message in the information push server exceeds the normal range, and therefore a failure of sending is returned to the first server, the target message is discarded, and the target message is not forwarded to the second server.
In the embodiment of the invention, the target information is prevented from continuously flowing between the information pushing servers by setting the skip counter, so that the stability of the network is improved.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
Fig. 6 is a block diagram illustrating a system for sending information according to an embodiment of the present invention, where the sending device of the information includes devices for executing steps in the embodiment corresponding to fig. 1. Please refer to fig. 1 and fig. 1 for the corresponding description of the embodiment. For convenience of explanation, only the portions related to the present embodiment are shown.
Referring to fig. 6, the information transmission system includes: first server 61, information push server 62, and second server 63:
the first server 61 is configured to receive target information sent by an information sending end; the target information carries a user identifier of an information receiving end and an application identifier of an application program to which the target information belongs;
the first server 61 is configured to determine a link number for sending the target information based on the user identifier and the application identifier;
the first server 61 is configured to add the link number to the target information and send the target information to the information push server 62 if the first local link list of the first server does not include the link number;
the information push server 62 is configured to push the target information to each second server 63 in an information push list; the information push list is used for recording a second server 63 which establishes a subscription relationship with the information push server;
the second server 63 is configured to send the target information to the information receiving end through a communication link corresponding to the link number if the second local link list of the second server includes the link number of the target information.
Optionally, the user identifier includes a destination address of the information receiving end; the first server 61, configured to determine, based on the user identifier and the application identifier, a link number for sending the target information, including:
the first server 61 is configured to send a routing table acquisition request to the information push server 62;
the information push server 62 is configured to broadcast a routing table summarizing instruction, so as to receive routing information sent by each server that establishes a subscription relationship with the information push server, and summarize all the routing information to generate an external routing table;
the first server 61 is configured to receive the external routing table sent by the information push server 62, query the local routing table of the first server 61 and the external routing table, and determine a target server corresponding to a target address of the user identifier; generating a primary coding factor based on the device identification of the target server;
the first server 61 is configured to determine, based on the application identifier, a network protocol to be invoked for transmitting the target information and a communication port number corresponding to each of the network protocols; generating a sub-coding factor according to the communication port number;
the first server 61 is configured to obtain the link number based on the main coding factor and the sub-coding factor.
Optionally, the first server 61 is further configured to:
the first server 61 is configured to start a long connection validity timer if a long connection request sent by the information sending end is received, and add a long connection link with the information sending end to the first local link list;
the first server 61 is configured to, if a data packet sent by an information sending end is received, identify whether a data type of the data packet is a heartbeat data type;
the first server 61 is configured to reset the value of the long connection validity timer if the data type of the data packet is a heartbeat data type;
the first server 61 is configured to disconnect the long connection link and delete the link number corresponding to the long connection link from the first local link list if the value of the long connection validity timer reaches a preset threshold.
Optionally, the first server 61 is configured to, if a data packet sent by an information sending end is received, identify whether a data type of the data packet is a heartbeat data type, and includes:
the first server 61 is configured to obtain a data volume of the data packet;
the first server 61 is configured to, if the data size is smaller than the preset data size threshold, analyze a bit value of a reserved field of the data packet;
the first server 61 is configured to identify that the data type of the data packet is a heartbeat data type if the bit value of the reserved field is a preset bit value.
Optionally, the target information carries a skip counter; the information push server 62 is configured to push the target information to each second server 63 in the information push list, and includes:
the information push server 62 is configured to increase a count value of the skip counter of the target information if the count value of the skip counter is less than or equal to a preset skip threshold, and push the target information to each second server 63 in the information push list;
the information push server 62 is configured to return sending failure information to the first server if the count value of the skip timer is greater than the skip threshold.
Therefore, in the information sending system provided by the embodiment of the invention, the mutual information sending between different servers does not need to establish a special physical link, but can realize the information sending and receiving operation of the cross-server through the issuing and pushing functions of the information pushing server, thereby reducing the information transmission cost.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (8)

1. An information sending method is applied to an information sending system, and is characterized in that the information sending system comprises: the method comprises a first server, a second server and an information pushing server, wherein the information sending method comprises the following steps:
the first server receives target information sent by an information sending end; the target information carries a user identifier of an information receiving end and an application identifier of an application program to which the target information belongs;
the first server determines a link number for sending the target information based on the user identifier and the application identifier;
if the first local link list of the first server does not contain the link number, the first server adds the link number to the target information and sends the target information to the information push server;
the information push server pushes the target information to each second server in an information push list; the information push list is used for recording a second server which establishes a subscription relationship with the information push server;
if the second local link list of the second server contains the link number of the target information, the second server sends the target information to the information receiving end through a communication link corresponding to the link number;
the user identification comprises a target address of the information receiving end; the first server determines, based on the user identifier and the application identifier, a link number for transmitting the target information, including:
the first server sends a routing table acquisition request to the information push server;
the information push server broadcasts a routing table summarizing instruction so as to receive routing information sent by each server which establishes a subscription relationship with the information push server, summarizes all the routing information and generates an external routing table;
the first server receives the external routing table sent by the information push server, queries a local routing table of the first server and the external routing table, and determines a target server corresponding to a target address of the user identifier; generating a primary coding factor based on the device identification of the target server;
the first server determines network protocols required to be called for transmitting the target information and communication port numbers corresponding to the network protocols based on the application identifiers; generating a sub-coding factor according to the communication port number;
and the first server obtains the link number based on the main coding factor and the sub coding factor.
2. The transmission method of claim 1, further comprising:
if the first server receives a long connection request sent by the information sending end, a long connection effective timer is started, and a long connection link between the first server and the information sending end is added into the first local link list;
if the first server receives a data packet sent by an information sending end, identifying whether the data type of the data packet is a heartbeat data type;
if the data type of the data packet is a heartbeat data type, resetting the value of the long connection validity timer by the first server;
and if the value of the long connection validity timer reaches a preset threshold value, the first server disconnects the long connection link and deletes the link number corresponding to the long connection link from the first local link list.
3. The sending method according to claim 2, wherein the identifying whether the data type of the data packet is a heartbeat data type if the first server receives the data packet sent by an information sending end includes:
the first server acquires the data volume of the data packet;
if the data volume is smaller than the preset data volume threshold value, the first server analyzes a bit value of a reserved field of the data packet;
and if the bit value of the reserved field is a preset bit value, the first server identifies that the data type of the data packet is a heartbeat data type.
4. The transmission method according to any one of claims 1 to 3, characterized in that the target information carries a skip counter; the information pushing server pushes the target information to each second server in an information pushing list, and the method comprises the following steps:
if the count value of the skip counter is smaller than or equal to a preset skip threshold value, the information push server increases the count value of the skip counter of the target information and pushes the target information to each second server in the information push list;
and if the count value of the skip timer is greater than the skip threshold value, the information push server returns sending failure information to the first server.
5. A system for transmitting information, the system comprising: the system comprises a first server, a second server and an information push server:
the first server is used for receiving the target information sent by the information sending end; the target information carries a user identifier of an information receiving end and an application identifier of an application program to which the target information belongs;
the first server is used for determining a link number for sending the target information based on the user identification and the application identification;
the first server is configured to add the link number to the target information and send the target information to the information push server if the first local link list of the first server does not include the link number;
the information push server is used for pushing the target information to each second server in an information push list; the information push list is used for recording a second server which establishes a subscription relationship with the information push server;
the second server is configured to send the target information to the information receiving end through a communication link corresponding to the link number if a second local link list of the second server includes the link number of the target information;
the user identification comprises a target address of the information receiving end; the first server, configured to determine, based on the user identifier and the application identifier, a link number for sending the target information includes:
the first server is used for sending a routing table acquisition request to the information push server;
the information push server is used for broadcasting a routing table summarizing instruction so as to receive routing information sent by each server which establishes a subscription relationship with the information push server, and summarizing all the routing information to generate an external routing table;
the first server is configured to receive the external routing table sent by the information push server, query the local routing table of the first server and the external routing table, and determine a target server corresponding to a target address of the user identifier; generating a primary coding factor based on the device identification of the target server;
the first server is used for determining the network protocols required to be called for transmitting the target information and the communication port numbers corresponding to the network protocols based on the application identifiers; generating a sub-coding factor according to the communication port number;
the first server is configured to obtain the link number based on the main coding factor and the sub-coding factor.
6. The sending system of claim 5, wherein the first server is further configured to:
the first server is used for starting a long connection validity timer and adding a long connection link between the first server and the information sending end into the first local link list if a long connection request sent by the information sending end is received;
the first server is used for identifying whether the data type of the data packet is a heartbeat data type or not if the data packet sent by the information sending end is received;
the first server is configured to reset the value of the long connection validity timer if the data type of the data packet is a heartbeat data type;
the first server is configured to disconnect the long connection link and delete the link number corresponding to the long connection link from the first local link list if the value of the long connection validity timer reaches a preset threshold value.
7. The sending system of claim 6, wherein the first server, if receiving a data packet sent by an information sending end, is configured to identify whether a data type of the data packet is a heartbeat data type, and the identifying comprises:
the first server is used for acquiring the data volume of the data packet;
the first server is configured to analyze a bit value of a reserved field of the data packet if the data amount is smaller than the preset data amount threshold;
the first server is configured to identify that the data type of the data packet is a heartbeat data type if the bit value of the reserved field is a preset bit value.
8. The transmission system according to any one of claims 5 to 7, wherein the destination information carries a skip counter; the information push server is configured to push the target information to each second server in an information push list, and includes:
the information push server is used for increasing the count value of the skip counter of the target information and pushing the target information to each second server in the information push list if the count value of the skip counter is smaller than or equal to a preset skip threshold value;
and the information push server is used for returning and sending failure information to the first server if the count value of the skip timer is greater than the skip threshold.
CN201810455647.1A 2018-05-14 2018-05-14 Information sending method and equipment Active CN108696588B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201810455647.1A CN108696588B (en) 2018-05-14 2018-05-14 Information sending method and equipment
PCT/CN2018/097552 WO2019218479A1 (en) 2018-05-14 2018-07-27 Method and device for sending information

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810455647.1A CN108696588B (en) 2018-05-14 2018-05-14 Information sending method and equipment

Publications (2)

Publication Number Publication Date
CN108696588A CN108696588A (en) 2018-10-23
CN108696588B true CN108696588B (en) 2021-06-25

Family

ID=63846421

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810455647.1A Active CN108696588B (en) 2018-05-14 2018-05-14 Information sending method and equipment

Country Status (2)

Country Link
CN (1) CN108696588B (en)
WO (1) WO2019218479A1 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111083193A (en) * 2019-11-11 2020-04-28 厦门网宿有限公司 Long connection message sending method, server and storage medium
CN112184312A (en) * 2020-09-28 2021-01-05 建信金融科技有限责任公司 Touch frequency control method, device, equipment and medium
CN112231601B (en) * 2020-10-14 2024-05-28 深圳前海微众银行股份有限公司 Link management method, device, equipment and computer storage medium
CN112559558B (en) * 2020-12-07 2024-04-09 北京理房通支付科技有限公司 Method and device for generating serial numbers, computing equipment and storage medium
CN112804309B (en) * 2020-12-31 2022-09-20 中国人寿保险股份有限公司上海数据中心 Multicast pushing method
CN114189489A (en) * 2021-11-11 2022-03-15 深圳市科脉技术股份有限公司 Message pushing method, device, server and medium
CN114374705A (en) * 2022-01-06 2022-04-19 青岛海信智慧生活科技股份有限公司 Service cluster and message pushing method
CN116669132A (en) * 2022-02-18 2023-08-29 华为技术有限公司 Data transmission method, network equipment and user equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001025908A2 (en) * 1999-10-01 2001-04-12 Accenture Llp Presentation service architectures for netcentric computing systems
CN101610280A (en) * 2008-06-20 2009-12-23 华为技术有限公司 The method and apparatus that between the PUSH server and client side, communicates
CN102365841A (en) * 2009-03-09 2012-02-29 苹果公司 Push notification service
CN106230896A (en) * 2016-07-18 2016-12-14 深圳国泰安教育技术股份有限公司 A kind of information push method, Apparatus and system

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9137679B2 (en) * 2011-09-18 2015-09-15 Loyalblocks Ltd Methods circuits systems and associated computer executable code for localizing and messaging a wireless communication device
CN105139599A (en) * 2015-09-29 2015-12-09 深圳市国投电信有限公司 Community alarm method and system
CN105389219A (en) * 2015-10-15 2016-03-09 北京乐动卓越科技有限公司 Cross-computer room communication method and system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2001025908A2 (en) * 1999-10-01 2001-04-12 Accenture Llp Presentation service architectures for netcentric computing systems
CN101610280A (en) * 2008-06-20 2009-12-23 华为技术有限公司 The method and apparatus that between the PUSH server and client side, communicates
CN102365841A (en) * 2009-03-09 2012-02-29 苹果公司 Push notification service
CN106230896A (en) * 2016-07-18 2016-12-14 深圳国泰安教育技术股份有限公司 A kind of information push method, Apparatus and system

Also Published As

Publication number Publication date
CN108696588A (en) 2018-10-23
WO2019218479A1 (en) 2019-11-21

Similar Documents

Publication Publication Date Title
CN108696588B (en) Information sending method and equipment
JP6640038B2 (en) Method and apparatus for performing extended file distribution in multicast communication or broadcast communication
US11019367B2 (en) Live video transmission method and system, and apparatus
US20150215400A1 (en) File Upload Method And System
JP5485134B2 (en) Robust file cast for mobile TV
CN110431807B (en) IPTV service quality detection method, device and system
US11032122B2 (en) Multicast delay diagnosis method and apparatus
KR102132266B1 (en) Secondary node type based control for data streaming
WO2020155293A1 (en) Stream pushing method, system and server
WO2016141589A1 (en) Method and apparatus for transmitting real-time transport protocol (rtp) packet
JP6480452B2 (en) Packet processing method and apparatus
EP3057287A1 (en) Node allocation method, device and system
WO2023061060A1 (en) Audio and video code stream scheduling method, system, medium and electronic apparatus
US10841633B2 (en) Hot live video determining method and device
CN109818901B (en) Method, device and system for determining message header compression mechanism
WO2024098815A1 (en) Data transmission processing method and device, storage medium, and electronic device
KR20050009061A (en) Apparatus and Method for efficient data transmission/reception in Mobile Ad-hoc Network
WO2017041534A1 (en) Power line network communication method and device, and computer storage media
US10516502B2 (en) File repair method, related apparatus, and system
CN107786441B (en) Communication method, OpenFlow switch and communication system
CN113162855B (en) Multicast message detection method, network equipment and system
CN105210347B (en) Monitoring server, resolution server, request equipment and node selecting method
US9668238B1 (en) Multicast file delivery
US8295200B2 (en) Discovering multicast routing capability of an access network
CN114095108A (en) Smart broadcasting method applied to client

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant