CN110311967A - The method, apparatus of data-pushing and data receiver, equipment and system - Google Patents

The method, apparatus of data-pushing and data receiver, equipment and system Download PDF

Info

Publication number
CN110311967A
CN110311967A CN201910555370.4A CN201910555370A CN110311967A CN 110311967 A CN110311967 A CN 110311967A CN 201910555370 A CN201910555370 A CN 201910555370A CN 110311967 A CN110311967 A CN 110311967A
Authority
CN
China
Prior art keywords
domain name
grouping
request
service instance
name addresses
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.)
Granted
Application number
CN201910555370.4A
Other languages
Chinese (zh)
Other versions
CN110311967B (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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology 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 Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN201910555370.4A priority Critical patent/CN110311967B/en
Publication of CN110311967A publication Critical patent/CN110311967A/en
Application granted granted Critical
Publication of CN110311967B publication Critical patent/CN110311967B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • 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
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/45Network directories; Name-to-address mapping
    • H04L61/4505Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
    • H04L61/4511Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]

Abstract

The disclosure is about the method, apparatus of a kind of data-pushing and data receiver, equipment and system, the method of the data-pushing includes: the request sent in response to client, targeted packets are determined from the multiple groupings being pre-created, wherein, it include the websocket Service Instance in multiple and different sources in each grouping, each grouping has corresponding domain name addresses;Determine the corresponding target domain name addresses of the targeted packets, and the target domain name addresses is returned into the client, so that the client establishes long connection based on websocket Service Instance request of the target domain name addresses into the targeted packets, and the data of the websocket Service Instance push are received after the long connection is established.The present embodiment can request to concentrate on the situation that same websocket Service Instance causes the Service Instance pressure excessive to avoid user, achieve the purpose that load balancing.

Description

The method, apparatus of data-pushing and data receiver, equipment and system
Technical field
This disclosure relates to technical field of data processing more particularly to the method, apparatus of data-pushing and data receiver, equipment And system.
Background technique
WebSocket is a kind of agreement that full duplex communication is carried out in single TCP connection that HTML5 starts to provide.? In WebSocket API, browser and server, which only needs to be performed, once shakes hands, and just can directly create persistence between the two Connection, and carry out bidirectional data transfers.WebSocket makes the data exchange between client and server become simpler It is single, allow server-side actively to client push data.For example, client can be connect by WebSocket in live scene The direct broadcasting room message got off from server push is received, WebSocket long, which is connected in live scene, can not only promote direct broadcasting room Message real-time more greatly alleviates the pressure of server.
For web site based on HTTPS, it is required that using the wss agreement of WebSocket, it is therefore desirable to give WebSocket application wss domain name, as shown in the configuration diagram of Fig. 1, when user by wss domain name be connected to nginx cluster with Afterwards, nginx reverse proxy establishes connection with a WebSocket server at random, this will appear multiple users and is all connected to certain Situation on one WebSocket server, so that the server load is excessive.For example, it is assumed that currently there is 100,000 main broadcasters It is being broadcast live, if not making any strategy, the user that leaves connects WebSocket server at random, will lead to 10w direct broadcasting room Viewing user is likely to be connected on same WebSocket server, therefore single WebSocket server can be made to safeguard 10w direct broadcasting room state, brings immense pressure to server, influences data processing real-time.
Summary of the invention
The disclosure provides method, apparatus, equipment and the system of a kind of data-pushing and data receiver, at least to solve correlation The excessive problem of individual server data processing pressure in technology.The technical solution of the disclosure is as follows:
According to the first aspect of the embodiments of the present disclosure, a kind of data push method, the method packet of the data-pushing are provided It includes:
In response to the request that client is sent, targeted packets are determined from the multiple groupings being pre-created, wherein each grouping In include multiple and different sources websocket Service Instance, each grouping has corresponding domain name addresses;
It determines the corresponding target domain name addresses of the targeted packets, and the target domain name addresses is returned into the client End, so that the client is asked based on websocket Service Instance of the target domain name addresses into the targeted packets The long connection of foundation is asked, and receives the data of the websocket Service Instance push after the long connection is established.
According to the second aspect of an embodiment of the present disclosure, a kind of method of data receiver is provided, the method is applied to client In end, the method for the data receiver includes:
After sending request to background server, the target domain name that the background server is returned according to the request is received Address, the target domain name addresses are the domain name addresses of targeted packets, and the targeted packets are based on institute for the background server State the grouping that request is selected from multiple groupings, wherein include the websocket Service Instance of separate sources in each grouping, respectively Grouping has corresponding domain name addresses;
Long connect is established in websocket Service Instance request based on from the target domain name addresses to the targeted packets It connects, and receives the data of the websocket Service Instance push after the long connection is established.
According to the third aspect of an embodiment of the present disclosure, a kind of data-pushing device, the device packet of the data-pushing are provided It includes:
Targeted packets determining module is configured to respond to the request of client transmission, from the multiple groupings being pre-created Middle determining targeted packets, wherein include the websocket Service Instance in multiple and different sources in each grouping, each grouping has pair The domain name addresses answered;
Target domain name address determination module is configured to determine that the corresponding target domain name addresses of the targeted packets;
Target domain name addresses sending module is configured as and the target domain name addresses is returned to the client, so that It obtains the client and length is established based on websocket Service Instance request of the target domain name addresses into the targeted packets It connects, and receives the data of the websocket Service Instance push after the long connection is established.
According to a fourth aspect of embodiments of the present disclosure, a kind of device of data receiver is provided, described device is applied to client In end, the device of the data receiver includes:
Target domain name addresses receiving module is configured as after sending request to background server, receives the backstage clothes Device be engaged according to the target domain name addresses of the request return, the target domain name addresses is the domain name addresses of targeted packets, described Targeted packets are the background server based on the grouping for requesting to select from multiple groupings, wherein include in each grouping The websocket Service Instance of separate sources, each grouping have corresponding domain name addresses;
Long connection request module is configured as based on the target domain name addresses into the targeted packets Long connection is established in the request of websocket Service Instance;
Data reception module, is configured as receiving the websocket Service Instance after the long connection is established and pushes away The data sent.
According to a fifth aspect of the embodiments of the present disclosure, a kind of data processing system is provided, the data processing system includes: Client, background server and websocket Service Instance cluster, wherein the websocket Service Instance cluster is divided Into multiple groupings, the websocket Service Instance including multiple and different sources in each grouping, each grouping has corresponding domain name Address;
The client is configured as after sending request to background server, receives the background server according to The target domain name addresses returned is requested, the websocket service based on the target domain name addresses into corresponding targeted packets Example request establishes long connection, and the data of the websocket Service Instance push are received after the long connection is established;
The background server is configured to respond to the request of client transmission, from the multiple groupings being pre-created really Set the goal grouping;It determines the corresponding target domain name addresses of the targeted packets, and the target domain name addresses is returned into the visitor Family end;
The websocket Service Instance is configured as the request of the long connection of the foundation sent based on the client, builds It is vertical to be connected with the long of the client, and connected by the length to the client push data.
According to a sixth aspect of an embodiment of the present disclosure, a kind of equipment is provided, comprising:
Processor;
For storing the memory of the processor-executable instruction;
Wherein, the processor is configured to described instruction is executed, to realize above-mentioned method.
According to the 7th of embodiment of the present disclosure aspect, provide a kind of storage medium, when the instruction in the storage medium by When the processor of the equipment executes, so that the equipment is able to carry out above-mentioned method.
According to the eighth aspect of the embodiment of the present disclosure, a kind of computer program product, including executable program code are provided, Wherein, said program code implements above-mentioned method when executing by above-mentioned apparatus.
The technical scheme provided by this disclosed embodiment at least bring it is following the utility model has the advantages that
In the present embodiment, the request sent in response to client, the present embodiment can be multiple from what is be pre-created first Targeted packets are determined in grouping, and determine the corresponding target domain name addresses of the targeted packets, then return the target domain name addresses The client is returned, so that client orients the service of the websocket into the corresponding targeted packets of target domain name addresses Example request establishes long connection, and the data of websocket Service Instance push are received after long connection is established.It avoids using Family request concentrates on the situation that same websocket Service Instance causes the Service Instance pressure excessive, reaches load balancing Purpose.For websocket Service Instance, without handling the request of all clients, the straight of single service is alleviated Quantity is broadcast, to alleviate server stress.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not The disclosure can be limited.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows the implementation for meeting the disclosure Example, and together with specification for explaining the principles of this disclosure, do not constitute the improper restriction to the disclosure.
Fig. 1 is the configuration diagram of the data processing referred in the background technique of the disclosure.
Fig. 2 is a kind of flow chart of the embodiment of the method for data-pushing shown according to an exemplary embodiment.
Fig. 3 is the configuration diagram of the data processing of the disclosure shown according to an exemplary embodiment.
Fig. 4 is a kind of flow chart of the embodiment of the method for data receiver shown according to an exemplary embodiment.
Fig. 5 is a kind of data-pushing device block diagram shown according to an exemplary embodiment.
Fig. 6 is a kind of device block diagram of data receiver shown according to an exemplary embodiment.
Fig. 7 is a kind of block diagram of data processing system shown according to an exemplary embodiment.
Fig. 8 is shown according to an exemplary embodiment a kind of for executing the block diagram of the device of above method embodiment.
Specific embodiment
In order to make ordinary people in the field more fully understand the technical solution of the disclosure, below in conjunction with attached drawing, to this public affairs The technical solution opened in embodiment is clearly and completely described.
It should be noted that the specification and claims of the disclosure and term " first " in above-mentioned attached drawing, " Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this way Data be interchangeable under appropriate circumstances, so as to embodiment of the disclosure described herein can in addition to illustrating herein or Sequence other than those of description is implemented.Embodiment described in following exemplary embodiment does not represent and disclosure phase Consistent all embodiments.On the contrary, they are only and as detailed in the attached claim, the disclosure some aspects The example of consistent device and method.
Fig. 2 is a kind of flow chart of the embodiment of the method for data-pushing shown according to an exemplary embodiment, this implementation Example can be applied in background server, may comprise steps of.
In step s 11, the request sent in response to client determines target point from the multiple groupings being pre-created Group, wherein include the websocket Service Instance in multiple and different sources in each grouping, each grouping has corresponding domain name addresses.
In a kind of example, can according to preset grouping strategy by websocket Service Instance assemblage classification to difference Grouping in, to obtain multiple groupings.It wherein, may include the websocket service reality in multiple and different sources in each grouping Example.As an example, the websocket Service Instance of separate sources may include from different computer room different machines Websocket Service Instance.
The present embodiment is not construed as limiting specific grouping strategy, as long as the websocket in same grouping can be made to take The source of pragmatic example is different, for example, it is same that the different websocket Service Instances of uniform machinery can be made not enter Grouping, each grouping include the machine example of each computer room.
For example, it is assumed that having Group1 and Group2 two groupings, includes machine 1 and machine 2 in computer room 1, include in computer room 2 Machine 3 and machine 4, every machine are separately installed with websocket Service Instance 1 and websocket Service Instance 2, then are dividing Grouping as described in Table 1 can be carried out when group:
Group1 Group2
1. machine 1.websocket Service Instance 1 of computer room 1. machine 1.websocket Service Instance 2 of computer room
1. machine 2.websocket Service Instance 1 of computer room 1. machine 2.websocket Service Instance 2 of computer room
2. machine 3.websocket Service Instance 1 of computer room 2. machine 3.websocket Service Instance 2 of computer room
2. machine 4.websocket Service Instance 1 of computer room 2. machine 4.websocket Service Instance 2 of computer room
Table 1
For another example, as shown in figure 3, websocket 1 and websocket 3 be located at first grouping, websocket 2 and Websocket 4 is located at second packet, wherein websocket 1 and websocket 3 from different computer rooms, Websocket2 is from websocket 4 from different computer room
It should be noted that the quantity of grouping can be according to the pressure or specific industry of each websocket Service Instance Business determines, if the pressure of single websocket Service Instance is larger, can increase number of packet.For example, starting to be grouped When can first be divided into two groups, if in two groups there are the pressure of some websocket Service Instance is still bigger, can increase Add a grouping, and so on balance the pressure of different websocket Service Instances.It can certainly be empirically disposable Determine need number of packet simultaneously be grouped, the present embodiment to this with no restriction.
It in one embodiment, can also be respectively that each grouping application configures corresponding domain name addresses, as one kind Example, the domain name addresses can be wss domain name.It can be the first grouping application configuration wss domain name for example, being directed to the example of Fig. 3 It is second packet application configuration wss domain name is Host 2 for Host 1, i.e., external exposure 1 domain name of Host of the first grouping, second Grouping externally exposes 2 domain name of Host.
In a kind of possible embodiment of the disclosure, step S11 be may include steps of: extract in the request Signature identification;It is grouped division to the signature identification according to preset grouping partition strategy to calculate, and by the calculating Result hit grouping as targeted packets.
In a kind of possible embodiment, signature identification may include user identifier.It is above-mentioned to be drawn according to preset grouping Divide strategy to be grouped division to the signature identification to calculate, and using the grouping of the result of calculating hit as targeted packets The step of may include steps of: to the user identifier carry out Hash calculation, obtain the first cryptographic Hash;Described first is breathed out Uncommon value and the number of packet of the multiple grouping carry out complementation, by being grouped into as target for obtained remainder result hit Grouping.
For example, calculating the value of hash (userId) %groupSize, and the corresponding grouping of packet identification that the value is hit As targeted packets, wherein userId is user identifier, and groupSize is number of packet.
In a kind of possible implement scene, when the present embodiment is applied to live scene, then above-mentioned request can be to add Enter the request of specified direct broadcasting room;Signature identification can also include direct broadcasting room mark or main broadcaster's mark.It is above-mentioned according to preset division Strategy is grouped division to the signature identification and calculates, and step of the grouping that the calculated result is hit as targeted packets Suddenly it may include steps of:
Judge the specified direct broadcasting room for big direct broadcasting room or small direct broadcasting room;If the direct broadcasting room is small direct broadcasting room, to institute It states direct broadcasting room mark or main broadcaster identifies and carries out Hash calculation, obtain the second cryptographic Hash;By second cryptographic Hash with it is the multiple The number of packet of grouping carries out complementation, by being grouped into as targeted packets for obtained remainder result hit;If described straight Be big direct broadcasting room between broadcasting, then to the user identifier carry out Hash calculation, obtain the first cryptographic Hash, will first cryptographic Hash and The number of packet of the multiple grouping carries out complementation, by being grouped into as targeted packets for obtained remainder result hit.
In this embodiment it is possible to first determine whether that the specified direct broadcasting room is big direct broadcasting room or small direct broadcasting room, wherein work as live streaming Between in spectators user quantity be greater than or equal to preset quantity threshold value when, then the direct broadcasting room be big direct broadcasting room;If in direct broadcasting room Spectators user quantity be less than preset quantity threshold value when, then the direct broadcasting room be small direct broadcasting room.
If specified direct broadcasting room is big direct broadcasting room, Hash calculation can be carried out to user identifier, and according to being calculated The first cryptographic Hash and the number of packet of multiple groupings carry out complementation, and point that the operation result of complementation is hit Group is used as targeted packets, for example, calculating the value of hash (userId) %groupSize, and the packet identification pair that the value is hit The grouping answered is as targeted packets, wherein userId is user identifier, and groupSize is number of packet.Due to big direct broadcasting room Attendance is relatively more, carries out processing to the Service Instance of grouping by same grouping in order to avoid the user of the direct broadcasting room concentrates The case where excessive pressure, then determines the targeted packets of each user using user identifier, to shunt the customer flow of big direct broadcasting room Load balancing is carried out into each grouping.For example, it is assumed that some big direct broadcasting room there are 1,000,000 people to watch live streaming, 10 groupings are shared, then UserId 1 can be distributed to grouping 1 processing, userId 2 distribute to grouping 2 processing ..., userId 10 distribute to grouping 10 processing, userId 11 distribute to 1 processing of grouping etc., so that being respectively each responsible for the request at 10 general-purpose families, greatly reduce The pressure of Service Instance.
If specified direct broadcasting room is small direct broadcasting room, direct broadcasting room can be identified and carry out Hash calculation, and according to calculating The number of packet of the second cryptographic Hash and multiple groupings that arrive carries out complementation, and the operation result of complementation is hit Grouping is used as targeted packets, for example, calculating the value of hash (authorId) %groupSize, and the grouping mark that the value is hit Corresponding grouping is known as targeted packets, wherein authorId is direct broadcasting room mark, and groupSize is number of packet.Due to small The attendance of direct broadcasting room is fewer, therefore is identified with direct broadcasting room and determine targeted packets, can make the user of same direct broadcasting room It is all handled by the same grouping, is handled for example, the spectators user for entering direct broadcasting room 1 is distributed on Group1.
Certainly, if specified direct broadcasting room is small direct broadcasting room, other than direct broadcasting room mark can be used and carry out Hash calculation, also Can be used main broadcaster identify carry out Hash calculation, the present embodiment to this with no restriction.
In step s 12, it determines the corresponding target domain name addresses of the targeted packets, and the target domain name addresses is returned The client is returned, so that websocket of the client based on the target domain name addresses into the targeted packets Long connection is established in Service Instance request, and receives the websocket Service Instance push after the long connection is established Data.
In this step, after determining targeted packets, then it is corresponding that the targeted packets can be searched according to the targeted packets Target domain name addresses, then will the target domain name addresses return client in.For example, in Fig. 3, for user 1 and user 2 Domain name addresses Host 1 can be distributed for it, domain name addresses Host 2 can be distributed for user 3 for it.
It, can be according to the target domain name addresses to right after it receives target domain name addresses for client Long connection is established in websocket Service Instance request in the targeted packets answered.For example, in live streaming field, client can be with The request that specified direct broadcasting room is added is sent to targeted packets based on target domain name addresses.In the targeted packets, it can choose In websocket Service Instance handle the request.When realizing, select websocket service real from targeted packets The mode of example can load few websocket Service Instance, this reality for random selection or according to the selection of load balancing principle Example is applied to this with no restriction.
Be responsible for processing active user request websocket Service Instance, can be based on above-mentioned request, can establish with Long connection between the corresponding client of user, wherein can be used based on the websocket mode for establishing long connection general Mode, the present embodiment to this with no restriction.
According to the long connection of foundation, websocket Service Instance can carry out the data-pushing of active, example to client Such as, when direct broadcasting room generates new data, which is pushed in client.
For example, user 1 can be connected to reverse proxy nginx by wss domain name Host 1, and nginx should in Fig. 3 The request into direct broadcasting room that user 1 sends is sent to the grouping of Host 1 corresponding first, then by the first grouping Websocket, if websocket 1 handles the request of client, the client corresponding with user 1 first of websocket 1 is built Vertical long connection, then connects to the client push live data according to the length, by the client terminal playing live data.
In the present embodiment, the request sent in response to client, the present embodiment can be multiple from what is be pre-created first Targeted packets are determined in grouping, and determine the corresponding target domain name addresses of the targeted packets, then return the target domain name addresses The client is returned, so that client orients the service of the websocket into the corresponding targeted packets of target domain name addresses Example request establishes long connection, and the data of websocket Service Instance push are received after long connection is established.It avoids using Family request concentrates on the situation that same websocket Service Instance causes the Service Instance pressure excessive, reaches load balancing Purpose.For websocket Service Instance, without handling the request of all clients, the straight of single service is alleviated Quantity is broadcast, to alleviate server stress.
Fig. 4 is a kind of flow chart of the embodiment of the method for data receiver shown according to an exemplary embodiment, this implementation Example can be applied in client, may comprise steps of.
In the step s 21, it after sending request to background server, receives the background server and is returned according to the request The target domain name addresses returned, the target domain name addresses are the domain name addresses of targeted packets, and the targeted packets are the backstage Server is based on the grouping for requesting to select from multiple groupings, wherein includes the websocket of separate sources in each grouping Service Instance, each grouping have corresponding domain name addresses.
In the present embodiment, the effect for the request that client is sent to background server is that request background server is this visitor Targeted packets are distributed at family end.After client sends request to background server, background server is waited to return to target domain name Address.
In step S22, the websocket Service Instance based on the target domain name addresses into the targeted packets is asked The long connection of foundation is asked, and receives the data of the websocket Service Instance push after the long connection is established.
In a kind of possible embodiment of the disclosure, step S22 can further include following steps: based on described Target domain name addresses sends the request that specified direct broadcasting room is added to the targeted packets, by wherein one in the targeted packets A websocket Service Instance is established according to the request and is connected with the long of this client.
It, can be according to the target domain name addresses into corresponding targeted packets after it receives target domain name addresses Long connection is established in the request of websocket Service Instance.For example, client can be based on target domain name addresses in live streaming field The request that specified direct broadcasting room is added is sent to targeted packets.In the targeted packets, it can choose one of websocket clothes Pragmatic example handles the request.When realizing, it can be random that the mode of websocket Service Instance is selected from targeted packets Selection loads few websocket Service Instance according to the selection of load balancing principle, the present embodiment to this with no restriction.
In a kind of possible embodiment of the disclosure, the data for the push that client receives may include live streaming number According to then client can play the live data after receiving the data.
In the present embodiment, client, can the background service based on the received after sending request to background server Length is established in the target domain name addresses that device is returned according to above-mentioned request, the websocket Service Instance request into the targeted packets It connects, and receives the data of the websocket Service Instance push after long connection is established, to realize client request Directive sending avoids user's request from concentrating on the situation that same websocket Service Instance causes the Service Instance pressure excessive, Achieve the purpose that load balancing.
Fig. 5 is a kind of data-pushing device block diagram shown according to an exemplary embodiment.Referring to Fig. 5, which includes Targeted packets determining module 501, target domain name address determination module 502 and target domain name addresses sending module 503.
Targeted packets determining module 501 is configured to respond to the request of client transmission, from multiple points be pre-created Targeted packets are determined in group, wherein include the websocket Service Instance in multiple and different sources in each grouping, each grouping has Corresponding domain name addresses;
Target domain name address determination module 502 is configured to determine that the corresponding target domain name addresses of the targeted packets;
Target domain name addresses sending module 503 is configured as and the target domain name addresses is returned to the client, with So that the client requests to establish based on websocket Service Instance of the target domain name addresses into the targeted packets Long connection, and receive after the long connection is established the data of the websocket Service Instance push.
In a kind of possible embodiment of the disclosure, the targeted packets determining module 501 may include:
Signature identification extracting sub-module is configured as extracting the signature identification in the request;
Grouping divides submodule, is configured as being grouped the signature identification according to preset grouping partition strategy and draw Divide and calculate, and using the grouping of the result of calculating hit as targeted packets.
In a kind of possible embodiment of the disclosure, the signature identification includes user identifier;
The grouping divides submodule and is specifically configured to:
Hash calculation is carried out to the user identifier, obtains the first cryptographic Hash;
First cryptographic Hash and the number of packet of the multiple grouping are subjected to complementation, the remainder result that will be obtained Hit is grouped into as targeted packets.
In a kind of possible embodiment of the disclosure, the request includes that the request of specified direct broadcasting room is added;It is described Signature identification further includes direct broadcasting room mark or main broadcaster's mark;
The grouping divides submodule and is specifically configured to:
Judge the specified direct broadcasting room for big direct broadcasting room or small direct broadcasting room, wherein when the number of the spectators user in direct broadcasting room When amount is greater than or equal to preset quantity threshold value, then the direct broadcasting room is big direct broadcasting room;If the quantity is less than preset quantity threshold value When, then the direct broadcasting room is small direct broadcasting room;
If the direct broadcasting room is small direct broadcasting room, direct broadcasting room mark or main broadcaster are identified and carry out Hash calculation, is obtained Second cryptographic Hash;Second cryptographic Hash and the number of packet of the multiple grouping are subjected to complementation, the remainder that will be obtained That as a result hits is grouped into as targeted packets;
If the direct broadcasting room is big direct broadcasting room, Hash calculation is carried out to the user identifier, obtains the first cryptographic Hash, it will First cryptographic Hash and the number of packet of the multiple grouping carry out complementation, the grouping that obtained remainder result is hit For as targeted packets.
In a kind of possible embodiment of the disclosure, the data-pushing device further include:
Grouping module, be configured as according to preset grouping strategy by websocket Service Instance assemblage classification to difference Grouping in;
Domain name addresses configuration module is configured to as the corresponding domain name addresses of the packet configuration.
Fig. 6 is a kind of device block diagram of data receiver shown according to an exemplary embodiment, and described device is applied to visitor In the end of family, referring to Fig. 6, which includes target domain name addresses receiving module 601, long connection request module 602 and data receiver Module 603.
Target domain name addresses receiving module 601 is configured as after sending request to background server, receives the backstage The target domain name addresses that server is returned according to the request, the target domain name addresses are the domain name addresses of targeted packets, institute Stating targeted packets is the background server based on the grouping for requesting to select from multiple groupings, wherein is wrapped in each grouping The websocket Service Instance of separate sources is included, each grouping has corresponding domain name addresses;
Long connection request module 602 is configured as based on the target domain name addresses into the targeted packets Long connection is established in the request of websocket Service Instance;
Data reception module 603 is configured as receiving the websocket Service Instance after the long connection is established The data of push.
In a kind of possible embodiment of the disclosure, the long connection request module 602 is specifically configured to:
The request that specified direct broadcasting room is added is sent to the targeted packets based on the target domain name addresses, by the mesh One of websocket Service Instance in mark grouping is established according to the request to be connected with the long of this client.
Fig. 7 is a kind of block diagram of data processing system shown according to an exemplary embodiment, as shown in fig. 7, the number It include: client 10, background server 20 and websocket Service Instance cluster 30 according to processing system, wherein described Websocket Service Instance cluster is divided into multiple groupings, includes the websocket clothes in multiple and different sources in each grouping Pragmatic example, each grouping have corresponding domain name addresses;
The client 10 is configured as after sending request to background server, receives the background server according to institute The target domain name addresses that request returns is stated, the websocket clothes based on the target domain name addresses into corresponding targeted packets Example request of being engaged in establishes long connection, and the number of the websocket Service Instance push is received after the long connection is established According to;
The background server 20 is configured to respond to the request of client transmission, from the multiple groupings being pre-created Determine targeted packets;Determine the corresponding target domain name addresses of the targeted packets, and will be described in target domain name addresses return Client;
The websocket Service Instance 30 is configured as the request of the long connection of the foundation sent based on the client, It establishes and is connected with the long of the client, and connected by the length to the client push data.
About the apparatus and system in above-described embodiment, wherein modules execute the concrete mode of operation related It is described in detail in the embodiment of this method, no detailed explanation will be given here.
Fig. 8 is shown according to an exemplary embodiment a kind of for executing the block diagram of the device of above method embodiment.
In the exemplary embodiment, a kind of storage medium including instruction is additionally provided, the memory for example including instruction, Above-metioned instruction can be executed by the processor of device to complete the embodiment of the method for above-mentioned Fig. 2 or Fig. 4.Optionally, storage medium can To be non-transitorycomputer readable storage medium, for example, the non-transitorycomputer readable storage medium can be ROM, Random access memory (RAM), CD-ROM, tape, floppy disk and optical data storage devices etc..
The embodiment of the present disclosure also provides a kind of equipment, comprising: processor;For storing the processor-executable instruction Memory;Wherein, the processor is configured to executing described instruction, the method to realize above-mentioned Fig. 2 or Fig. 4.
The embodiment of the present disclosure also provides a kind of storage medium, when the instruction in the storage medium is by the processing of the equipment When device executes, so that the method that the equipment is able to carry out above-mentioned Fig. 2 or Fig. 4.
The embodiment of the present disclosure also provides a kind of computer program product, including executable program code, wherein described program Code is implemented according to fig. 2 or the embodiment of the method for Fig. 4 when being executed by above-mentioned apparatus.
Those skilled in the art after considering the specification and implementing the invention disclosed here, will readily occur to its of the disclosure Its embodiment.The disclosure is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes or Person's adaptive change follows the general principles of this disclosure and including the undocumented common knowledge in the art of the disclosure Or conventional techniques.The description and examples are only to be considered as illustrative, and the true scope and spirit of the disclosure are by following Claim is pointed out.
It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by the accompanying claims.

Claims (10)

1. a kind of data push method, which is characterized in that the method for the data-pushing includes:
In response to the request that client is sent, targeted packets are determined from the multiple groupings being pre-created, wherein wrap in each grouping The websocket Service Instance in multiple and different sources is included, each grouping has corresponding domain name addresses;
It determines the corresponding target domain name addresses of the targeted packets, and the target domain name addresses is returned into the client, with So that the client requests to establish based on websocket Service Instance of the target domain name addresses into the targeted packets Long connection, and receive after the long connection is established the data of the websocket Service Instance push.
2. data push method according to claim 1, which is characterized in that the request sent in response to client, It is determined from the multiple groupings being pre-created and includes: the step of targeted packets
Extract the signature identification in the request;
Division is grouped to the signature identification according to preset grouping partition strategy to calculate, and the result of the calculating is ordered In grouping as targeted packets.
3. data push method according to claim 2, which is characterized in that the signature identification includes user identifier;
It is described that division calculating is grouped to the signature identification according to preset partition strategy, and the calculated result is hit Grouping include: as the step of targeted packets
Hash calculation is carried out to the user identifier, obtains the first cryptographic Hash;
First cryptographic Hash and the number of packet of the multiple grouping are subjected to complementation, obtained remainder result is hit Be grouped into as targeted packets.
4. data push method according to claim 3, which is characterized in that the request includes that specified direct broadcasting room is added Request;The signature identification further includes direct broadcasting room mark or main broadcaster's mark;
It is described that division calculating is grouped to the signature identification according to preset partition strategy, and the calculated result is hit Grouping include: as the step of targeted packets
Judge the specified direct broadcasting room for big direct broadcasting room or small direct broadcasting room, wherein when the quantity of the spectators user in direct broadcasting room is big When preset quantity threshold value, then the direct broadcasting room is big direct broadcasting room;If the quantity is less than preset quantity threshold value, The direct broadcasting room is small direct broadcasting room;
If the direct broadcasting room is small direct broadcasting room, direct broadcasting room mark or main broadcaster are identified and carry out Hash calculation, obtains second Cryptographic Hash;Second cryptographic Hash and the number of packet of the multiple grouping are subjected to complementation, the remainder result that will be obtained Hit is grouped into as targeted packets;
If the direct broadcasting room is big direct broadcasting room, Hash calculation is carried out to the user identifier, obtains the first cryptographic Hash, it will be described First cryptographic Hash and the number of packet of the multiple grouping carry out complementation, and the hit of obtained remainder result is grouped into work For targeted packets.
5. a kind of method of data receiver, which is characterized in that the method is applied in client, the method for the data receiver Include:
After sending request to background server, with receiving the target domain name that the background server is returned according to the request Location, the target domain name addresses are the domain name addresses of targeted packets, and the targeted packets are described in the background server is based on Request the grouping selected from multiple groupings, wherein the websocket Service Instance including separate sources in each grouping, each point Group has corresponding domain name addresses;
Long connection is established in websocket Service Instance request based on from the target domain name addresses to the targeted packets, and The data of the websocket Service Instance push are received after the long connection is established.
6. a kind of data-pushing device, which is characterized in that the device of the data-pushing includes:
Targeted packets determining module is configured to respond to the request of client transmission, from the multiple groupings being pre-created really Set the goal grouping, wherein includes the websocket Service Instance in multiple and different sources in each grouping, each grouping has corresponding Domain name addresses;
Target domain name address determination module is configured to determine that the corresponding target domain name addresses of the targeted packets;
Target domain name addresses sending module is configured as and the target domain name addresses is returned to the client, so that institute It states client and long connect is established based on websocket Service Instance request of the target domain name addresses into the targeted packets It connects, and receives the data of the websocket Service Instance push after the long connection is established.
7. a kind of device of data receiver, which is characterized in that described device is applied in client, the device of the data receiver Include:
Target domain name addresses receiving module is configured as after sending request to background server, receives the background server According to the target domain name addresses that the request returns, the target domain name addresses is the domain name addresses of targeted packets, the target The background server is grouped into based on the grouping for requesting to select from multiple groupings, wherein include difference in each grouping The websocket Service Instance in source, each grouping have corresponding domain name addresses;
Long connection request module is configured as the websocket clothes based on the target domain name addresses into the targeted packets Example request of being engaged in establishes long connection;
Data reception module is configured as receiving the websocket Service Instance push after the long connection is established Data.
8. a kind of data processing system, which is characterized in that the data processing system include: client, background server and Websocket Service Instance cluster, wherein the websocket Service Instance cluster is divided into multiple groupings, each to be grouped In include multiple and different sources websocket Service Instance, each grouping has corresponding domain name addresses;
The client is configured as after sending request to background server, receives the background server according to the request The target domain name addresses of return, the websocket Service Instance based on the target domain name addresses into corresponding targeted packets Long connection is established in request, and the data of the websocket Service Instance push are received after the long connection is established;
The background server is configured to respond to the request of client transmission, and mesh is determined from the multiple groupings being pre-created Mark grouping;It determines the corresponding target domain name addresses of the targeted packets, and the target domain name addresses is returned into the client;
The websocket Service Instance is configured as the request of the long connection of the foundation sent based on the client, establish with The long connection of the client, and connected by the length to the client push data.
9. a kind of equipment characterized by comprising
Processor;
For storing the memory of the processor-executable instruction;
Wherein, the processor is configured to executing described instruction, to realize as described in any one of claim 1-4 or 5 Method.
10. a kind of storage medium, when the instruction in the storage medium is executed by the processor of the equipment, so that described set The standby method being able to carry out as described in any one of claim 1-4 or 5.
CN201910555370.4A 2019-06-25 2019-06-25 Method, device, equipment and system for pushing data and receiving data Active CN110311967B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910555370.4A CN110311967B (en) 2019-06-25 2019-06-25 Method, device, equipment and system for pushing data and receiving data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910555370.4A CN110311967B (en) 2019-06-25 2019-06-25 Method, device, equipment and system for pushing data and receiving data

Publications (2)

Publication Number Publication Date
CN110311967A true CN110311967A (en) 2019-10-08
CN110311967B CN110311967B (en) 2022-06-10

Family

ID=68076115

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910555370.4A Active CN110311967B (en) 2019-06-25 2019-06-25 Method, device, equipment and system for pushing data and receiving data

Country Status (1)

Country Link
CN (1) CN110311967B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110933181A (en) * 2019-12-11 2020-03-27 中国银联股份有限公司 Routing method, device and system and electronic equipment
CN110968409A (en) * 2019-11-28 2020-04-07 广州欢聊网络科技有限公司 Data processing method and device
CN111555963A (en) * 2020-04-30 2020-08-18 北京思特奇信息技术股份有限公司 Message pushing method and device, electronic equipment and storage medium
CN111770355A (en) * 2020-07-09 2020-10-13 北京达佳互联信息技术有限公司 Media server determination method, device, server and storage medium
CN112968975A (en) * 2021-03-31 2021-06-15 中国建设银行股份有限公司 Service request processing method and device
CN113836428A (en) * 2021-10-12 2021-12-24 平安资产管理有限责任公司 Business pushing method and device, computer equipment and storage medium
CN114189493A (en) * 2021-11-08 2022-03-15 深圳市酷开网络科技股份有限公司 Distributed signaling communication method, computer device, signaling system, and storage medium
CN114189493B (en) * 2021-11-08 2024-04-12 深圳市酷开网络科技股份有限公司 Distributed signaling communication method, computer device, signaling system and storage medium

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103580988A (en) * 2012-07-31 2014-02-12 阿里巴巴集团控股有限公司 Method for message receiving, pushing and transmitting, device, server group and system
CN105051715A (en) * 2013-03-15 2015-11-11 光明测量公司 Systems and methods for establishing cloud-based instances with independent permissions
CN105577852A (en) * 2007-10-24 2016-05-11 爱立信电话股份有限公司 System and method for generating functional addresses
CN105791443A (en) * 2016-05-13 2016-07-20 武汉斗鱼网络科技有限公司 Distributed cluster-based user service providing system and method applied to live broadcast websites
CN105872082A (en) * 2016-05-18 2016-08-17 上海交通大学 Fine-grained resource response system based on load balancing algorithm of container cluster
CN107070989A (en) * 2017-03-06 2017-08-18 北京潘达互娱科技有限公司 Communication means and system
CN107071584A (en) * 2017-03-14 2017-08-18 北京潘达互娱科技有限公司 Live even wheat method and device
CN107241418A (en) * 2017-06-13 2017-10-10 腾讯科技(深圳)有限公司 A kind of load-balancing method, device, equipment and computer-readable recording medium
CN107846457A (en) * 2017-10-26 2018-03-27 广州市雷军游乐设备有限公司 Load-balancing method, device, storage medium and the system of server cluster

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105577852A (en) * 2007-10-24 2016-05-11 爱立信电话股份有限公司 System and method for generating functional addresses
CN103580988A (en) * 2012-07-31 2014-02-12 阿里巴巴集团控股有限公司 Method for message receiving, pushing and transmitting, device, server group and system
CN105051715A (en) * 2013-03-15 2015-11-11 光明测量公司 Systems and methods for establishing cloud-based instances with independent permissions
CN105791443A (en) * 2016-05-13 2016-07-20 武汉斗鱼网络科技有限公司 Distributed cluster-based user service providing system and method applied to live broadcast websites
CN105872082A (en) * 2016-05-18 2016-08-17 上海交通大学 Fine-grained resource response system based on load balancing algorithm of container cluster
CN107070989A (en) * 2017-03-06 2017-08-18 北京潘达互娱科技有限公司 Communication means and system
CN107071584A (en) * 2017-03-14 2017-08-18 北京潘达互娱科技有限公司 Live even wheat method and device
CN107241418A (en) * 2017-06-13 2017-10-10 腾讯科技(深圳)有限公司 A kind of load-balancing method, device, equipment and computer-readable recording medium
CN107846457A (en) * 2017-10-26 2018-03-27 广州市雷军游乐设备有限公司 Load-balancing method, device, storage medium and the system of server cluster

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110968409A (en) * 2019-11-28 2020-04-07 广州欢聊网络科技有限公司 Data processing method and device
CN110933181A (en) * 2019-12-11 2020-03-27 中国银联股份有限公司 Routing method, device and system and electronic equipment
CN110933181B (en) * 2019-12-11 2024-03-15 中国银联股份有限公司 Routing method, device and system and electronic equipment
CN111555963A (en) * 2020-04-30 2020-08-18 北京思特奇信息技术股份有限公司 Message pushing method and device, electronic equipment and storage medium
CN111770355A (en) * 2020-07-09 2020-10-13 北京达佳互联信息技术有限公司 Media server determination method, device, server and storage medium
US11425180B2 (en) 2020-07-09 2022-08-23 Beijing Dajia Internet Information Technology Co., Ltd. Method for server selection based on live streaming account type
CN112968975A (en) * 2021-03-31 2021-06-15 中国建设银行股份有限公司 Service request processing method and device
CN113836428A (en) * 2021-10-12 2021-12-24 平安资产管理有限责任公司 Business pushing method and device, computer equipment and storage medium
CN114189493A (en) * 2021-11-08 2022-03-15 深圳市酷开网络科技股份有限公司 Distributed signaling communication method, computer device, signaling system, and storage medium
CN114189493B (en) * 2021-11-08 2024-04-12 深圳市酷开网络科技股份有限公司 Distributed signaling communication method, computer device, signaling system and storage medium

Also Published As

Publication number Publication date
CN110311967B (en) 2022-06-10

Similar Documents

Publication Publication Date Title
CN110311967A (en) The method, apparatus of data-pushing and data receiver, equipment and system
CN105553977B (en) Processing, sending method and the device of request message
CN107948324B (en) Request Transmission system, method, apparatus and storage medium
CN104253814B (en) A kind of Streaming Media processing method, server and browser
CN106549878B (en) Service distribution method and device
CN108377671B (en) Method and computer equipment for processing message
US10924457B2 (en) Packet cleaning method and apparatus
CN110086886B (en) Dynamic session holding method and device
US10924533B2 (en) System, apparatus and method for load balancing
CN112311684B (en) Burst traffic processing method, computer device and readable storage medium
CN101997822A (en) Streaming media content delivery method, system and equipment
CN106533932A (en) Method and device for pushing instant message
CN111294664A (en) Audio and video data transmission method, electronic equipment and storage medium
CN106612196B (en) Obtain the method and device of resource
CN108924609A (en) Method, electronic equipment, device and the storage medium of transmission of flow media data
CN104606884A (en) Matching method and device in game battle
EP3917084A1 (en) Network as service service cross-domain orchestration method, orchestration device, and control device
CN106716974B (en) Access distribution method, device and system
CN113453025A (en) Data acquisition method and device
CN112565385B (en) Server address information configuration method and device and electronic equipment
US10523619B2 (en) Stateless message routing
CN105743788A (en) Data packet forwarding method and device
CN102222096B (en) Method and device for providing multi-media resource access service
WO2019071857A1 (en) Method and device preventing gift giving on live streaming platform
CN109040199A (en) A kind of method, system and storage medium for distributing resource data

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