A message push method, device and equipment
By scheduling the center cluster according to the scheduling level of the message push request and selecting a healthy push service center, the problem of message push unavailability caused by the failure of a single service center is solved, and the reliability of push services is improved.
Patent Information
- Application Number
- CN202211720687.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2024-11-22
- Estimated Expiration
- 2042-12-30
AI Technical Summary
Existing message push technology is prone to unavailability due to a single service center failure and lacks high reliability.
By determining the number of scheduling centers of the target center cluster based on the scheduling level of the message push request, performing central cluster scheduling, selecting a healthy push service center to achieve message push, and avoiding failure of a single service center.
Improves the reliability of the message push service and ensures that messages can still be pushed normally in the event of a single-center resource or network failure.
Smart Images

Figure CN116016656B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a message push method, device and equipment. Background Art
[0002] Currently, in many scenarios of Internet applications, messages are pushed to clients through servers, such as hot events, online information of dramas subscribed by users, etc.
[0003] However, Internet applications generally have a large number of users, and the amount of messages pushed daily is huge, which poses a great challenge to the reliability of push services. Existing message push technologies use a single message push center to push messages, which is prone to problems such as machine failure or network failure, resulting in message push failure. Summary of the invention
[0004] The present application provides a message push method, apparatus and equipment, which can perform central cluster scheduling according to the scheduling levels corresponding to different message push requests, and then through the central cluster scheduling push service center, it is possible to reasonably schedule the push service center, avoid the situation where the service is unavailable due to the failure of a single service center, solve the problem of the entire push service being unavailable due to the failure of a single center resource or network, and improve the reliability of the push service.
[0005] In a first aspect, the present application provides a message push method, comprising:
[0006] Get the message push request from the business server;
[0007] Determine the number of dispatch centers corresponding to the target center cluster based on the dispatch level corresponding to the message push request;
[0008] For the target center cluster, scheduling service processing is performed based on the number of scheduling centers to obtain the target push service center;
[0009] The target push service center pushes the target push information corresponding to the message push request to the client corresponding to the business service end.
[0010] Optionally, determining the number of scheduling centers corresponding to the target center cluster based on the scheduling level corresponding to the message push request includes:
[0011] Determine service attribute information for the message push request;
[0012] Based on the service attribute information, determining a scheduling level corresponding to the message push request;
[0013] Determine a cluster scheduling strategy corresponding to the scheduling level;
[0014] The central cluster included in the cluster scheduling strategy is determined as the target central cluster, and the number of scheduling centers is determined based on the cluster scheduling strategy.
[0015] Optionally, performing scheduling service processing based on the number of scheduling centers to obtain a target push service center includes:
[0016] Determining a target scheduling method for the message push request;
[0017] Based on the number of dispatch centers, determining at least one dispatch service center;
[0018] Selecting at least one candidate push service center from a preset push service cluster according to a scheduling strategy corresponding to the target scheduling mode by the scheduling service center;
[0019] A target push service center is determined based on the at least one candidate push service center.
[0020] Optionally, the method is applied to a push service system, the push service system includes at least two central clusters, and before pushing the target push information corresponding to the message push request to the client corresponding to the business service end, the method further includes:
[0021] Determining any target service center in the at least two center clusters;
[0022] Writing the data into the database corresponding to the target service center into a data synchronization queue;
[0023] A synchronization message is sent to a synchronization service center through a data synchronization queue. The synchronization service center is a non-target service center in the at least two central clusters. The synchronization service center is used to write the database data into a central database according to the synchronization message. The central database is the database of the synchronization service center.
[0024] Optionally, the pushing, through the target push service center, the target push information corresponding to the message push request to the client corresponding to the business server includes:
[0025] Processing the message through the target push service center to obtain target push information corresponding to the message push request;
[0026] The target push information is pushed to the client corresponding to the business server.
[0027] Optionally, the scheduling strategy corresponding to the target scheduling mode includes a polling scheduling strategy, and selecting at least one candidate push service center from a preset push service cluster according to the scheduling strategy corresponding to the target scheduling mode includes:
[0028] According to the polling scheduling strategy, polling scheduling is performed on each push service center in the push service cluster to obtain load information corresponding to each push service center;
[0029] At least one candidate push service center is selected from the push service cluster based on the load information corresponding to each push service center.
[0030] Optionally, the scheduling strategy corresponding to the target scheduling mode includes a business scheduling strategy, and selecting at least one candidate push service center from a preset push service cluster according to the scheduling strategy corresponding to the target scheduling mode includes:
[0031] According to the service scheduling strategy, selecting a push service center corresponding to the service scheduling strategy from the push service cluster;
[0032] The push service center corresponding to the business scheduling strategy is determined as the candidate push service center.
[0033] Optionally, determining a target push service center based on the at least one candidate push service center includes:
[0034] Obtaining service attribute information corresponding to the candidate push service center;
[0035] Determine the service status according to the service attribute information;
[0036] The candidate push service center corresponding to the service status being a non-disabled state is determined as the target push service center.
[0037] Optionally, before determining the service status according to the service attribute information, the method further includes:
[0038] Obtaining a service status setting operation submitted by a user for each push service center in the push service cluster;
[0039] For each of the push service centers, determining the service status of the push service center according to the service status setting operation;
[0040] Based on the service status of the push service center, service attribute information of the push service center is generated.
[0041] Optionally, after pushing the target push information corresponding to the message push request to the client corresponding to the business server, the method further includes:
[0042] Get the message push results;
[0043] If the message push result is a message push failure result, the message push request is written into the database as a push failure request;
[0044] Scanning the database through a failure processing service center to obtain a target push failure request;
[0045] Rescheduling service processing is performed based on the target push failure request to obtain a failure processing result corresponding to the message push request.
[0046] In a second aspect, the present application provides a message push device, comprising:
[0047] The acquisition module is used to obtain the message push request from the business server;
[0048] A scheduling center quantity determination module, used to determine the number of scheduling centers corresponding to the target center cluster based on the scheduling level corresponding to the message push request;
[0049] A scheduling service processing module, used for performing scheduling service processing on the target center cluster based on the number of scheduling centers to obtain a target push service center;
[0050] The push module is used to push the target push information corresponding to the message push request to the client corresponding to the business service end through the target push service center.
[0051] In a third aspect, the present application provides a message push device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus;
[0052] Memory, used to store computer programs;
[0053] The processor is used to implement the steps of the message push method as described in any embodiment of the first aspect when executing the program stored in the memory.
[0054] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the message push method as described in any one of the embodiments of the first aspect are implemented.
[0055] In summary, the embodiment of the present application obtains the message push request of the business service end, determines the number of scheduling centers corresponding to the target center cluster based on the scheduling level corresponding to the message push request, performs scheduling service processing for the target center cluster based on the number of scheduling centers, obtains the target push service center, and pushes the target push information corresponding to the message push request to the client corresponding to the business service end through the target push service center, thereby being able to perform center cluster scheduling according to the scheduling levels corresponding to different message push requests, and then scheduling the push service center through the center cluster, which can reasonably schedule the push service center and avoid the situation where the service is unavailable due to the failure of a single service center, thereby solving the problem of the entire push service being unavailable due to the failure of a single center resource or network, and improving the reliability of the push service. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0057] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0058] Figure 1 A flowchart of a message push method provided in an embodiment of the present application;
[0059] Figure 2 This is a schematic diagram of the steps of a message push method provided by an optional embodiment of the present application;
[0060] Figure 3 This is a framework diagram of a message push service system provided by an optional embodiment of the present application;
[0061] Figure 4 It is a data synchronization framework diagram provided by an optional embodiment of the present application;
[0062] Figure 5 This is a push service scheduling framework diagram provided by an optional embodiment of the present application;
[0063] Figure 6 A structural block diagram of a message push device provided in an embodiment of the present application;
[0064] Figure 7 It is a structural diagram of a message push device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0066] In the related technology, the design method of existing message push technology is usually to deploy the message push service on a single center to deploy resources and machines together. When pushing messages, the corresponding push information is obtained according to the request of the business server, and the push information is sent directly to the client. However, such deployment is prone to system reliability problems. If there is a failure in the central resources or network, the entire message push service will be unavailable, resulting in message push failure.
[0067] One of the concepts of the embodiments of the present application is to propose a message push method, device and equipment, which obtains a message push request from a business service end, determines the number of dispatch centers corresponding to a target center cluster based on the dispatch level corresponding to the message push request, performs dispatch service processing for the target center cluster based on the number of dispatch centers, obtains a target push service center, and pushes the target push information corresponding to the message push request to a client corresponding to the business service end through the target push service center, thereby being able to perform center cluster scheduling according to the dispatch levels corresponding to different message push requests, and then scheduling the push service center through the center cluster, which can reasonably schedule the push service center and avoid the situation where a single service center failure causes service unavailability, solves the problem of the entire push service being unavailable due to failure of a single center resource or network, and improves the reliability of the push service.
[0068] To facilitate the understanding of the embodiments of the present application, further explanation will be given below in conjunction with the drawings and specific embodiments. The embodiments do not constitute a limitation on the embodiments of the present application.
[0069] Figure 1 A flow chart of a message push method provided in an embodiment of the present application. Figure 1 As shown, the message push method provided in the embodiment of the present application may specifically include the following steps:
[0070] Step 110: Obtain a message push request from the business server.
[0071] Specifically, the message push request can be used to determine the target push information, and the embodiments of the present application do not limit this. Specifically, the business service end can generate a message push request when a message push is required, such as when the business service end needs to push a message to the client, and then obtain the message push request so that the scheduling service processing can be performed based on the message push request, that is, step 120 is executed.
[0072] Step 120: Determine the number of scheduling centers corresponding to the target center cluster based on the scheduling level corresponding to the message push request.
[0073] Specifically, different message push requests may have corresponding scheduling levels, such as scheduling levels may include low, medium and high levels. The scheduling level can be used to reflect the importance of the message push request. For example, the importance corresponding to a high-level message push request may be the highest, and the embodiments of the present application do not impose any restrictions on this; the target center cluster may include one or more scheduling service centers, and the embodiments of the present application do not impose any restrictions on this; the number of scheduling centers can be used to determine the scheduling service centers that need to be scheduled, and the embodiments of the present application do not impose any restrictions on this.
[0074] Specifically, after obtaining the message push request, the embodiment of the present application can determine the scheduling level corresponding to the message push request, and then determine the importance of the message push request according to the scheduling level, and determine the cluster scheduling strategy of the message push request according to the importance of the message push request. Subsequently, the target center cluster can be determined according to the cluster scheduling strategy, and then the cluster scheduling strategy can be used to determine the number of scheduling service centers that need to be scheduled in the target center cluster, so that the scheduling service center that needs to be scheduled can be determined based on the number of scheduling centers, and then service scheduling processing can be performed through the scheduling service center to obtain the target push service center, that is, execute step 130.
[0075] In a specific implementation, the embodiment of the present application can pre-build a push cluster, which can include multiple push service centers, each of which can store push information, and each of which can be used for message push, and the embodiment of the present application does not limit this. Specifically, a scheduling service can be processed according to a message push request, such as a scheduling strategy can be preset, and a healthy push service center can be selected from multiple push service centers included in the push cluster according to the scheduling strategy as the target push service center, so that through multi-center deployment, when a message push is required, a target push service center can be selected from multiple push service centers for message push, and when a push service center fails, the message can also be pushed through the remaining push service centers, so as to provide a reliable push service for the message push request, and effectively improve the performance of the message push service, and solve the problem of the entire push service being unavailable due to failures in single-center resources or networks.
[0076] Step 130 , for the target center cluster, perform scheduling service processing based on the number of scheduling centers to obtain a target push service center.
[0077] Specifically, the target push service center can store the target push information corresponding to the message push request, and the target push service center can be used to push the target push message corresponding to the message push request to the client, and the embodiment of the present application does not limit this. Specifically, after determining the target center cluster and the number of dispatch centers, the embodiment of the present application can determine the dispatch service center that needs to be dispatched according to the number of dispatch centers, and then use the dispatch service center to perform dispatch service processing, such as the dispatch service center can select a certain number of push service centers that meet the push requirements from the push cluster according to the dispatch strategy as the target push service center.
[0078] In a specific implementation, the embodiment of the present application can pre-construct a scheduling cluster and a push cluster, wherein the scheduling cluster can be used as a target center cluster, and the target center cluster can include multiple scheduling service centers, which is not limited by the embodiment of the present application. The push cluster can include multiple push service centers, which is not limited by the embodiment of the present application. Specifically, each scheduling service center can be used to select a target push service center from the push service centers included in the push cluster according to the scheduling strategy, and each push service center can store the target push information corresponding to the message push request, and each push service center can be used to push messages, which is not limited by the embodiment of the present application. By utilizing a scheduling cluster including multiple centers, when a scheduling service center in the scheduling cluster fails, other scheduling service centers can be used to perform scheduling services and determine the target push center, and by utilizing a push cluster including multiple centers, when a push service center in the push cluster fails, messages can also be pushed through the remaining push service centers, so as to provide reliable push services for message push requests, and effectively improve the performance of message push services, and solve the problem that the entire push service is unavailable due to failures in single center resources or networks.
[0079] Step 140: Push the target push information corresponding to the message push request to the client corresponding to the business service end through the target push service center.
[0080] Specifically, the target push message may include hot event information, user subscription information, etc., which is not limited in the embodiments of the present application. Specifically, in the embodiments of the present application, after determining the target push service center, the dispatch service center may send a message push request to the target push service center. After the target push service center obtains the message push request, it may extract the push information corresponding to the message push request from the push information stored in itself according to the message push request as the target push information. Subsequently, the target push service center may push the target push information to the client corresponding to the business service end, thereby realizing message push and solving the problem that the entire push service is unavailable due to failures in single-center resources or networks.
[0081] It can be seen that the embodiment of the present application obtains the message push request of the business service end, determines the number of scheduling centers corresponding to the target center cluster based on the scheduling level corresponding to the message push request, performs scheduling service processing for the target center cluster based on the number of scheduling centers, obtains the target push service center, and pushes the target push information corresponding to the message push request to the client corresponding to the business service end through the target push service center, thereby being able to perform center cluster scheduling according to the scheduling levels corresponding to different message push requests, and then scheduling the push service center through the center cluster, which can reasonably schedule the push service center and avoid the situation where the service is unavailable due to the failure of a single service center, thereby solving the problem of the entire push service being unavailable due to the failure of a single center resource or network, and improving the reliability of the push service.
[0082] Reference Figure 2 , shows a schematic flow chart of a message push method provided by an optional embodiment of the present application, and the message push method may specifically include the following steps:
[0083] Step 210: Obtain a message push request from the business server.
[0084] As an example, see Figure 3 , a push service system can be built in advance, and the message push request of the business service end can be obtained through the push service system, and then the message push can be performed according to the message push request. The push service system can include a scheduling cluster, a push cluster, and a failure processing cluster, which is not limited in this example. Among them, each cluster can include multiple centers, such as a scheduling cluster can include scheduling service center 1 to scheduling service center N (N is an integer), so as to implement scheduling service processing through the scheduling service center; a push cluster can include message push service center 1 to message push service center N (N is an integer), so as to perform message push through the message push service center; a failure processing cluster can include failure processing service center 1 to failure processing service center N (N is an integer), so as to re-push the message push request that failed to be pushed through the failure processing service center, which is not limited in this example.
[0085] Step 220: Determine service attribute information for the message push request.
[0086] Specifically, the business attribute information can be used to determine the business attributes. Different message push requests can have different business attributes. For example, the business attributes corresponding to video message push requests can be video business attributes, and the business attributes corresponding to news message push requests can be news business attributes. Different business attribute information can correspond to different scheduling levels.
[0087] Step 230: Determine the scheduling level corresponding to the message push request based on the service attribute information.
[0088] Specifically, the embodiment of the present application can determine the scheduling level corresponding to the message push request based on the service attribute information.
[0089] For example, for a message push request for a popular TV series, it belongs to the video service attribute. Since the message push request is for a popular TV series, the scheduling level can be relatively higher than that of a message push request for an ordinary video. For another example, for a message push request for news, if the news corresponding to the message push request is hot news, the scheduling level corresponding to the message push request for the hot news can be higher than that of a message push request for ordinary news. This example does not limit this.
[0090] Step 240: Determine a cluster scheduling strategy corresponding to the scheduling level.
[0091] Specifically, the cluster scheduling strategy can be used to determine the target center cluster and the number of scheduling centers that need to be scheduled, and the embodiments of the present application do not limit this.
[0092] In a specific implementation, corresponding cluster scheduling strategies can be preset for different scheduling levels. For example, for message push requests with a higher degree of importance and a higher scheduling level, more scheduling service centers can be set up for service scheduling to ensure that the target push information corresponding to the message push requests with a higher scheduling level can be pushed quickly. For message push requests with a lower degree of importance and a lower scheduling level, fewer scheduling service centers can be set up for service scheduling, thereby saving the resources of the service center.
[0093] Step 250: determine the central cluster included in the cluster scheduling strategy as the target central cluster, and determine the number of scheduling centers based on the cluster scheduling strategy.
[0094] Specifically, the embodiment of the present application can extract the target center cluster and the number of scheduling centers from the cluster scheduling strategy, so that the number of scheduling centers can be used to schedule the corresponding scheduling service center later, that is, execute step 270.
[0095] Step 260: determine a target scheduling method for the message push request.
[0096] Specifically, the target scheduling method may include a polling scheduling method and a service scheduling method, and the embodiments of the present application do not limit this. Specifically, after determining the message push request, it can be determined whether the message push request contains push service information, wherein the push service information may be the service information carried by the message push request, and the push service information may be used to determine the message push service center specified by the message push request. When the message push request contains push service information, the service scheduling method corresponding to the push service information may be determined as the target scheduling method; when the message push request does not contain push service information, the polling scheduling method may be determined as the target scheduling method.
[0097] In an optional implementation, the embodiment of the present application determines the target scheduling method for the message push request, which may specifically include: extracting push service information from the message push request; based on the push service information, determining the service scheduling method corresponding to the service scheduling policy as the target scheduling method.
[0098] Step 270: Determine at least one dispatch service center based on the number of dispatch centers.
[0099] Specifically, the embodiment of the present application can determine how many scheduling service centers need to be scheduled from the target center cluster based on the number of scheduling centers. For example, all scheduling service centers in the target center cluster can be polled to determine the center health status and load condition of each scheduling service center. When the center health status and load condition of the scheduling service center meet the scheduling conditions, the scheduling service center is scheduled. When the center health status or load condition of the scheduling service center does not meet the scheduling conditions, the scheduling service center is not scheduled to avoid abnormalities. Thereby, the scheduling service centers in the scheduling cluster can be reasonably scheduled according to the importance of the message push request. When an abnormality or high load occurs in a scheduling service center, other scheduling service centers can be scheduled for subsequent service scheduling. And by scheduling the scheduling service centers that meet the scheduling conditions, the processing performance of the center can be improved.
[0100] In a specific implementation, when determining a dispatching service center that needs to be dispatched, the center health status and load conditions of the dispatching service center can be obtained. For a dispatching service center with a poor health status or a high load, it can be determined that the dispatching service center does not meet the dispatching conditions and the dispatching service center may not be dispatched. For a dispatching service center with a good health status and a low load, it can be determined that the dispatching service center meets the dispatching conditions and the dispatching service center can be dispatched.
[0101] In actual processing, for message push requests with lower scheduling levels, only the scheduling service centers that meet the scheduling conditions can be scheduled. For message push requests with higher scheduling levels, in order to ensure the effectiveness of the message push, the scheduling service centers that do not meet the scheduling conditions can also be scheduled to ensure that the message push can be completed. The embodiments of the present application do not impose any restrictions on this.
[0102] Step 280: At least one candidate push service center is selected from a preset push service cluster through the scheduling service center according to the scheduling strategy corresponding to the target scheduling mode.
[0103] Specifically, the push service cluster may include one or more push service centers for message push, which is not limited in the embodiments of the present application; the scheduling strategy may include a polling scheduling strategy and a business scheduling strategy, which is not limited in the embodiments of the present application. Specifically, after the embodiments of the present application determine the scheduling service center, the scheduling service center may select at least one push service center from the push service cluster according to the scheduling strategy corresponding to the target scheduling method as a candidate push service center.
[0104] In a specific implementation, a corresponding scheduling strategy can be preset for the target scheduling mode. For example, when the target scheduling mode is a polling scheduling mode, the scheduling strategy corresponding to the polling scheduling mode can be a polling scheduling strategy; when the target scheduling mode is a business scheduling mode, the scheduling strategy corresponding to the business scheduling mode can be a business scheduling strategy. After determining the target scheduling mode, the scheduling strategy corresponding to the target scheduling mode can be determined. For example, when the target scheduling mode is a polling scheduling mode, the scheduling strategy corresponding to the target scheduling mode can be determined to be a polling scheduling strategy; when the target scheduling mode is a business scheduling mode, the scheduling strategy corresponding to the target scheduling mode can be determined to be a business scheduling strategy. Subsequently, according to the scheduling strategy, at least one push service center can be selected from the preset push service cluster as a candidate push service center. By introducing a scheduling service, the scheduling service selects a suitable push service center from the preset push service cluster as a candidate push service center according to the scheduling strategy, and then determines the target push service center according to the candidate push service center, thereby improving the reliability of the message push service.
[0105] In actual processing, the polling scheduling strategy can be used as an automatic scheduling strategy, through which a suitable push service center is selected from the push service cluster as a candidate push service center; the business scheduling strategy can be used as a custom scheduling strategy, through which one or more push service centers are selected from the push service cluster as candidate push service centers.
[0106] As an example, see Figure 3Each dispatch service center in the dispatch cluster can have a corresponding dispatch service, and each dispatch service center can be used to obtain the message push request from the business server. Taking dispatch service center 1 in the dispatch cluster as an example, dispatch service center 1 obtains the message push request.
[0107] After the request, the scheduling service included in the scheduling service center 1 can be used to determine whether the message push request contains push business information, so that when the message push request contains push business information, the target scheduling mode is determined to be the business scheduling mode; when the message push request does not contain push business information, the target scheduling mode is determined to be the polling scheduling mode, and then according to the scheduling strategy corresponding to the target scheduling mode, a candidate push service center can be selected from the push service centers (i.e., message push service centers) included in the push cluster (i.e., push service cluster).
[0108] Optionally, the scheduling strategy corresponding to the target scheduling mode includes a polling scheduling strategy. The above-mentioned selecting at least one candidate push service center from a preset push service cluster according to the scheduling strategy corresponding to the target scheduling mode may specifically include the following sub-steps:
[0109] Sub-step 2801, according to the polling scheduling strategy, polling scheduling is performed on each push service center in the push service cluster to obtain the load information corresponding to each push service center.
[0110] Specifically, the load information may include the health status and load corresponding to the push service center, which is not limited in the present embodiment. Specifically, the push service centers in the push service cluster may be polled and scheduled according to the polling scheduling strategy to obtain the health status and load corresponding to each push service center as the load information, and then the candidate push service center may be selected from the push service cluster based on the load information.
[0111] Sub-step 2802: selecting at least one candidate push service center from the push service cluster based on the load information corresponding to each push service center.
[0112] Specifically, the embodiment of the present application can select at least one candidate push service center from the push service cluster based on the load information corresponding to each push service center.
[0113] As an example, see Figure 4, the scheduling service center can perform polling scheduling on each push service center in the push 5 service cluster according to the polling scheduling strategy to obtain the health status and load of each push service center as load information. Subsequently, it can be determined whether the push service center is in a healthy state according to the load information corresponding to each push service center, and the push service centers in a healthy state can be sorted from high to low according to the load corresponding to each push service center to obtain a sorting result. According to the sorting result, a certain number of push service centers are selected as candidate push service centers. For example, the 10 push service centers with the lowest load can be selected as candidate push service centers. This example does not limit this. Candidate push service centers are selected according to the load information corresponding to the push service center. The target push service center can be determined based on the candidate push service center later, so that a healthy and low-load push service center can be selected for message push, so as to achieve load balancing and improve the reliability of message push.
[0114] Optionally, the scheduling strategy corresponding to the target scheduling mode includes a business scheduling strategy. The above-mentioned selecting at least one candidate push service center from a preset push service cluster according to the scheduling strategy corresponding to the target scheduling mode may specifically include the following sub-steps:
[0115] Sub-step 2803: selecting a push service center corresponding to the service scheduling policy from the push service cluster according to the service scheduling policy.
[0116] Specifically, the service scheduling strategy may correspond to one push service center or multiple push service centers, which is not limited in the present application embodiment. Specifically, the push service center corresponding to the service scheduling strategy may be determined according to the service scheduling strategy, and then the push service center corresponding to the service scheduling strategy may be selected from the push service cluster.
[0117] Sub-step 2804: determining the push service center corresponding to the business scheduling policy as the candidate push service center.
[0118] Specifically, the push service center corresponding to the business scheduling strategy may be determined as the candidate push service center.
[0119] For example, refer to Figure 4 If the business scheduling policy specifies the push service center as message push service center 1 and message push service center 2, then message push service center 1 and message push service center 2 can be selected from the push cluster, and message push service center 1 and message push service center 2 can be used as candidate push service centers. This example does not limit this. Through the business scheduling policy, users can specify the push service center for message push from the push cluster, improve the customization, make message push more flexible, and improve the reliability of message push.
[0120] Step 290: Determine a target push service center based on the at least one candidate push service center.
[0121] Specifically, the embodiment of the present application can determine the target push service center from at least one candidate push service center.
[0122] For example, based on the loads of the candidate push service centers, the candidate push service center with the lowest load may be selected as the target recommended service center, which is not limited in this example.
[0123] In the specific implementation, users can configure manual scheduling policies, and can use manual scheduling policies to disable a recommendation service center, or set a priority for a recommendation service center, etc. Through different scheduling policies or scheduling policy combinations, the scheduling service processing is more diversified and the reliability of the message push service is improved.
[0124] In an optional embodiment, the embodiment of the present application determines the target push service center based on the at least one candidate push service center, which may specifically include: obtaining the service attribute information corresponding to the candidate push service center; determining the service status according to the service attribute information; and determining the candidate push service center corresponding to the non-disabled service status as the target push service center. Specifically, it can be determined whether the service status corresponding to the candidate push service center is a disabled state. If the candidate push service center is determined to be in a disabled state, the candidate push service center may not be determined as the target push service center; if the candidate push service center is determined to be in a non-disabled state, the candidate push service center with a lower load or a higher priority may be determined as the target push service center.
[0125] In an optional embodiment, before the embodiment of the present application determines the service status according to the service attribute information, it may also specifically include: obtaining the service status setting operation submitted by the user for each push service center in the push service cluster; for each of the push service centers, determining the service status of the push service center according to the service status setting operation; and generating the service attribute information of the push service center based on the service status of the push service center.
[0126] Step 300: Push the target push information corresponding to the message push request to the client corresponding to the business service end through the target push service center.
[0127] Specifically, the embodiment of the present application can process the message push request issued by the scheduling service center through the target push service center, extract the push information corresponding to the message push request from the database as the target push information, and then push the target push information to the client corresponding to the business service end to realize message push, and can reasonably schedule the push service center to avoid the situation where the service is unavailable due to the failure of a single service center, thereby improving the reliability of the push service.
[0128] In an optional embodiment, the embodiment of the present application pushes the target push information corresponding to the message push request to the client corresponding to the business service end through the target push service center, which may specifically include: performing message processing through the target push service center to obtain the target push information corresponding to the message push request; pushing the target push information to the client corresponding to the business service end.
[0129] In an optional embodiment, the message push method provided in the embodiment of the present application can be applied to a push service system, wherein the push service system includes at least two center clusters, and before the target push information corresponding to the message push request is pushed to the client corresponding to the business service end, it also includes: determining any target service center in the at least two center clusters; writing the database write data corresponding to the target service center into the data synchronization queue; sending a synchronization message to the synchronization service center through the data synchronization queue, wherein the synchronization service center is a non-target service center in the at least two center clusters, and the synchronization service center is used to write the database write data into the central database according to the synchronization message, and the central database is the database of the synchronization service center. Specifically, if the data between each push service center needs to be consistent, the database resources contained in each push service center can be synchronized, such as each push service center can send the data to be synchronized to the message queue, and synchronize the data to be synchronized to other push service centers through the message queue, so as to ensure that when the resources of a certain center are abnormal and cannot work normally, other centers can push the target push information corresponding to the message push request normally, thereby improving the processing performance of each center and thus improving the reliability of the message push service.
[0130] As an example, see Figure 3 Each push service center can include message push services and data resources, where database resources can include push information and message push services can be used to write data to the database. Figure 5, a message queue (MQ) can be built in advance. Taking message push service center 1 as an example, when the message push service of message push service center 1 writes data to the database, the data can be written to MQ at the same time. Then other push service centers can receive data synchronization messages from MQ, extract data from the data synchronization messages, and write them into their own databases to achieve data synchronization.
[0131] In an optional embodiment, after the embodiment of the present application pushes the target push information corresponding to the message push request to the client corresponding to the business service end, it can also specifically include: obtaining the message push result; if the message push result is a message push failure result, writing the message push request as a push failure request into the database; scanning and processing the database through the failure processing service center to obtain the target push failure request; rescheduling service processing based on the target push failure request to obtain the failure processing result corresponding to the message push request. Specifically, after the embodiment of the present application pushes the target push information to the client corresponding to the business service end, the message push result can be obtained, and then it can be determined whether the message push result is a message push failure result. If it is determined that the message push result is a message push success result, the message push request can be processed; if it is determined that the message push result is a message push failure result, the message push request can be written into the database as a push failure request. The database can then be scanned through the failure processing service center, and when a push failure request is scanned, the push failure request will be used as the target push failure request, and the service processing will be rescheduled based on the target push failure request to obtain the failure processing result corresponding to the message push request. By using the failure processing service, it can support automatic or manual reprocessing of failed push tasks, thereby improving the reliability of the message push service.
[0132] As an example, see Figure 3, the push failure request corresponding to the message push failure result can be written into the failure processing service center of the failure processing cluster, such as the push failure request can be written into the database resource of the failure processing center 1 (i.e., the failure processing service center 1), or into the database resource of other failure processing centers, which is not limited in this example. Each failure processing center can contain failure processing (i.e., failure processing service), and the failure processing service can periodically scan the database of the failure processing center. When the push failure request contained in the database is scanned, the push failure request can be used as the target push failure request. Subsequently, the failure processing service can redistribute the target push failure request to the scheduling service center. After the scheduling service center receives the target push failure request sent by the failure processing service, it can re-schedule the service according to the target push failure request, and schedule a suitable push service center for the target push failure request, so as to re-push the message through the push service center, thereby realizing automatic fault processing. Of course, the user can also manually schedule the service for the target push failure request and re-push the message, which is not limited in this example. By introducing the failure processing module, the failed message push request can be manually or automatically re-pushed.
[0133] In summary, the embodiment of the present application obtains a message push request from a business service end, determines business attribute information for the message push request, determines the scheduling level corresponding to the message push request based on the business attribute information, determines the cluster scheduling strategy corresponding to the scheduling level, determines the center cluster included in the cluster scheduling strategy as the target center cluster, and determines the number of scheduling centers based on the cluster scheduling strategy. Subsequently, the target scheduling method can be determined for the message push request, and at least one scheduling service center can be determined based on the number of scheduling centers. Through the scheduling service center, at least one candidate push service center is selected from the preset push service cluster according to the scheduling strategy corresponding to the target scheduling method as the target push service center. Then, through the target push service center, the target push information corresponding to the message push request is pushed to the client corresponding to the business service end, so that the center cluster scheduling can be performed according to the scheduling levels corresponding to different message push requests. Then, through the center cluster scheduling push service center, the push service center can be reasonably scheduled to avoid the situation where the service is unavailable due to the failure of a single service center, solves the problem of the entire push service being unavailable due to the failure of a single center resource or network, and improves the reliability of the push service.
[0134] It should be noted that, for the purpose of simple description, the method embodiments are expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited to the described order of actions, because according to the embodiments of the present application, certain steps may be performed in other orders or simultaneously.
[0135] like Figure 6 As shown, the embodiment of the present application further provides a message push device 600, including:
[0136] A dispatch center quantity determination module 610, configured to determine the number of dispatch centers corresponding to the target center cluster based on the dispatch level corresponding to the message push request;
[0137] The scheduling service processing module 620 is used to perform scheduling service processing on the target center cluster based on the number of scheduling centers to obtain a target push service center;
[0138] The push module 630 is used to push the target push information corresponding to the message push request to the client corresponding to the business service end through the target push service center.
[0139] Optionally, the dispatch center quantity determination module 610 includes:
[0140] A service attribute information determination submodule, used to determine the service attribute information for the message push request;
[0141] A scheduling level determination submodule, used to determine the scheduling level corresponding to the message push request based on the service attribute information;
[0142] The cluster scheduling strategy determination submodule is used to determine the cluster scheduling strategy corresponding to the scheduling level; determine the center cluster included in the cluster scheduling strategy as the target center cluster, and determine the number of scheduling centers based on the cluster scheduling strategy.
[0143] Optionally, the scheduling service processing module 620 includes:
[0144] A target scheduling mode determination submodule, used to determine a target scheduling mode for the message push request;
[0145] A dispatch service center determination submodule, configured to determine at least one dispatch service center based on the number of dispatch centers;
[0146] A candidate push service center selection submodule is used to select at least one candidate push service center from a preset push service cluster through the scheduling service center according to the scheduling strategy corresponding to the target scheduling mode;
[0147] The target push service center determination submodule is used to determine the target push service center based on the at least one candidate push service center.
[0148] Optionally, the method is applied to a push service system, the push service system includes at least two central clusters, and the message push device 600 further includes:
[0149] A target service center determination module, used to determine any target service center in the at least two center clusters;
[0150] A data writing module, used to write the data written into the database corresponding to the target service center into the data synchronization queue;
[0151] A synchronization message sending module is used to send synchronization messages to a synchronization service center through a data synchronization queue. The synchronization service center is a non-target service center in the at least two center clusters. The synchronization service center is used to write data into a central database based on the synchronization message. The central database is the database of the synchronization service center.
[0152] Optionally, the push module 630 includes:
[0153] The message push submodule is used to process the message through the target push service center to obtain the target push information corresponding to the message push request; and push the target push information to the client corresponding to the business service end.
[0154] Optionally, the scheduling strategy corresponding to the target scheduling method includes a polling scheduling strategy, and the candidate push service center selection submodule is specifically used to: perform polling scheduling on each push service center in the push service cluster according to the polling scheduling strategy to obtain load information corresponding to each push service center; based on the load information corresponding to each push service center, select at least one candidate push service center from the push service cluster.
[0155] Optionally, the scheduling strategy corresponding to the target scheduling method includes a business scheduling strategy, and the candidate push service center selection submodule is specifically used to: select the push service center corresponding to the business scheduling strategy from the push service cluster according to the business scheduling strategy; and determine the push service center corresponding to the business scheduling strategy as the candidate push service center.
[0156] Optionally, the target push service center determines a submodule including:
[0157] A service attribute information acquisition unit, used to acquire the service attribute information corresponding to the candidate push service center;
[0158] A service status determination unit, configured to determine a service status according to the service attribute information;
[0159] The target push service center determining unit is configured to determine the candidate push service center corresponding to the non-disabled service state as the target push service center.
[0160] Optionally, the message push device 600 further includes:
[0161] A service status setting operation acquisition module, used to acquire the service status setting operation submitted by the user for each push service center in the push service cluster;
[0162] A service status determination module, configured to determine the service status of each push service center according to the service status setting operation;
[0163] The service attribute information generating module is used to generate the service attribute information of the push service center based on the service status of the push service center.
[0164] Optionally, the message push device 600 further includes:
[0165] A message push result acquisition module is used to obtain message push results;
[0166] A database writing module, used for writing the message push request as a push failure request into the database when the message push result is a message push failure result;
[0167] A scanning and processing module, used to scan and process the database through a failure processing service center to obtain a target push failure request;
[0168] The rescheduling service processing module is used to perform rescheduling service processing based on the target push failure request and obtain the failure processing result corresponding to the message push request.
[0169] It should be noted that the message push device provided in the embodiments of the present application can execute the message push method provided in any embodiment of the present application, and has the corresponding functions and beneficial effects of executing the message push method.
[0170] In a specific implementation, the above-mentioned message push device can be integrated into a device, so that the device can perform scheduling service processing according to the message push request, and push the target push information corresponding to the message push request to the client through the target push service center, as a message push device, to implement message push. The message push device can be composed of two or more physical entities, or it can be composed of one physical entity, such as a message push device can be a personal computer (PC), a computer, a server, etc., and the embodiment of the present application does not make specific restrictions on this.
[0171] like Figure 7As shown, an embodiment of the present application provides a message push device, including a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114; the memory 113 is used to store computer programs; the processor 111 is used to implement the steps of the message push method provided by any of the aforementioned method embodiments when executing the program stored in the memory 113. Exemplarily, the steps of the message push method may include the following steps: obtaining a message push request from a business service end; determining the number of scheduling centers corresponding to a target center cluster based on the scheduling level corresponding to the message push request; performing scheduling service processing for the target center cluster based on the number of scheduling centers to obtain a target push service center; and pushing the target push information corresponding to the message push request to the client corresponding to the business service end through the target push service center.
[0172] An embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of the message push method provided in any of the aforementioned method embodiments are implemented.
[0173] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0174] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A message push method, characterized in that: include: Get the message push request from the business server; Determining the number of dispatch centers corresponding to the target center cluster based on the dispatch level corresponding to the message push request, including: determining business attribute information for the message push request; determining the dispatch level corresponding to the message push request based on the business attribute information; determining a cluster dispatching strategy corresponding to the dispatching level; determining the center cluster included in the cluster dispatching strategy as the target center cluster, and determining the number of dispatch centers based on the cluster dispatching strategy; For the target center cluster, a scheduling service process is performed based on the number of scheduling centers to obtain a target push service center, including: determining a target scheduling method for the message push request; determining at least one scheduling service center based on the number of scheduling centers; selecting at least one candidate push service center from a preset push service cluster through the scheduling service center according to a scheduling strategy corresponding to the target scheduling method; and determining a target push service center based on the at least one candidate push service center; The determining of the target push service center based on the at least one candidate push service center includes: acquiring service attribute information corresponding to the candidate push service center; determining a service state according to the service attribute information; and determining the candidate push service center corresponding to the non-disabled state as the target push service center; The target push service center pushes the target push information corresponding to the message push request to the client corresponding to the business service end.
2. The method according to claim 1, characterized in that: The method is applied to a push service system, the push service system includes at least two central clusters, and before pushing the target push information corresponding to the message push request to the client corresponding to the business service end, it also includes: Determining any target service center in the at least two center clusters; Writing the data into the database corresponding to the target service center into a data synchronization queue; A synchronization message is sent to a synchronization service center through a data synchronization queue. The synchronization service center is a non-target service center in the at least two central clusters. The synchronization service center is used to write the database data into a central database according to the synchronization message. The central database is the database of the synchronization service center.
3. The method according to claim 1, characterized in that The target push service center pushes the target push information corresponding to the message push request to the client corresponding to the business service end, including: Processing the message through the target push service center to obtain target push information corresponding to the message push request; The target push information is pushed to the client corresponding to the business server.
4. The method according to claim 1, characterized in that: The scheduling strategy corresponding to the target scheduling method includes a polling scheduling strategy, and selecting at least one candidate push service center from a preset push service cluster according to the scheduling strategy corresponding to the target scheduling method includes: According to the polling scheduling strategy, polling scheduling is performed on each push service center in the push service cluster to obtain load information corresponding to each push service center; At least one candidate push service center is selected from the push service cluster based on the load information corresponding to each push service center.
5. The method according to claim 1, characterized in that The scheduling strategy corresponding to the target scheduling method includes a business scheduling strategy, and selecting at least one candidate push service center from a preset push service cluster according to the scheduling strategy corresponding to the target scheduling method includes: According to the service scheduling strategy, selecting a push service center corresponding to the service scheduling strategy from the push service cluster; The push service center corresponding to the business scheduling strategy is determined as the candidate push service center.
6. The method according to claim 1, characterized in that Before determining the service status according to the service attribute information, the method further includes: Obtaining a service status setting operation submitted by a user for each push service center in the push service cluster; For each of the push service centers, determining the service status of the push service center according to the service status setting operation; Based on the service status of the push service center, service attribute information of the push service center is generated.
7. The method according to any one of claims 1 to 6, characterized in that: After pushing the target push information corresponding to the message push request to the client corresponding to the business server, the method further includes: Get the message push results; If the message push result is a message push failure result, the message push request is written into the database as a push failure request; Scanning the database through a failure processing service center to obtain a target push failure request; Rescheduling service processing is performed based on the target push failure request to obtain a failure processing result corresponding to the message push request.
8. A message push device, characterized in that: include: The acquisition module is used to obtain the message push request from the business server; A scheduling center quantity determination module, used to determine the number of scheduling centers corresponding to the target center cluster based on the scheduling level corresponding to the message push request, including: determining business attribute information for the message push request; determining the scheduling level corresponding to the message push request based on the business attribute information; determining the cluster scheduling strategy corresponding to the scheduling level; determining the center cluster included in the cluster scheduling strategy as the target center cluster, and determining the number of scheduling centers based on the cluster scheduling strategy; The scheduling service processing module is used to perform scheduling service processing for the target center cluster based on the number of scheduling centers to obtain a target push service center, including: determining a target scheduling method for the message push request; determining at least one scheduling service center based on the number of scheduling centers; selecting at least one candidate push service center from a preset push service cluster through the scheduling service center according to a scheduling strategy corresponding to the target scheduling method; and determining a target push service center based on the at least one candidate push service center; The determining of the target push service center based on the at least one candidate push service center includes: acquiring service attribute information corresponding to the candidate push service center; determining a service state according to the service attribute information; and determining the candidate push service center corresponding to the non-disabled state as the target push service center; The push module is used to push the target push information corresponding to the message push request to the client corresponding to the business service end through the target push service center.
9. A message push device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the steps of the message push method as described in any one of claims 1 to 7 when executing the program stored in the memory.
