Data pushing method and device, equipment, medium and program product

By identifying the business model of the requesting end and determining the target node, diversified data push mode is achieved, and the problem of single data push method in the existing technology is solved, which improves the flexibility of data push.

CN119629229APending Publication Date: 2025-03-14GUOTAI JUNAN SECURITIES CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510119323.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-24
Publication Date
2025-03-14

AI Technical Summary

Technical Problem

The existing data push method relies on the Kafka platform, and its business model is single and cannot meet the needs of diversified business scenarios.

Method used

提供一种数据推送方法,通过接收请求端的数据推送请求并识别其业务模式,支持同步应答模式、异步应答模式、同步转发模式、异步转发模式和批量推送模式,并根据推送模式确定目标节点,实现数据推送。

Benefits of technology

It realizes the data push mode for diversified business scenarios, improves the flexibility of data push, and can meet the data delivery strategies that can meet different business needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119629229A_ABST
    Figure CN119629229A_ABST
Patent Text Reader

Abstract

The invention provides a data pushing method and device, equipment, a medium and a program product, and relates to the field of big data. The method comprises the following steps: receiving a data push request sent by a request end, determining a service mode of the data push request, returning a service response to the request end after performing service processing on the data push request under the condition that the service mode is a synchronous response mode, and returning a request response to the request end under the condition that the service mode is an asynchronous response mode. Performing asynchronous service processing on the data push request, returning a service response to the request end, determining a push mode corresponding to the data push request according to a request number in the data push request when the service mode is a synchronous forwarding mode, an asynchronous forwarding mode or a batch push mode, and determining a target node according to the push mode, processing the data push request according to the business mode and the target node; according to the method, a data pushing mode of diversified business scenes is realized, and the data pushing flexibility is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data, and in particular to a data push method, device, equipment, medium and program product. Background Art

[0002] Currently, data push is usually implemented using the Kafka platform through a publish-subscribe model, in which the requester publishes data to partitions of specific topics, and the target nodes subscribe to these topics to receive message sequences. Kafka uses distributed coordination to ensure high availability and persistence of messages, and supports horizontal expansion, data push, and real-time processing.

[0003] However, existing data push methods usually rely on the Kafka platform, but the data push business model of the Kafka platform is single and cannot meet the needs of diversified business scenarios. Summary of the invention

[0004] The present application provides a data push method, device, equipment, medium and program product, which are used to solve the technical problem that the existing data push method cannot meet the needs of diversified business scenarios.

[0005] In a first aspect, the present application provides a data push method, comprising:

[0006] Receive a data push request sent by a requesting end, and determine a service mode of the data push request, wherein the service mode is any one of a synchronous response mode, a synchronous forwarding mode, an asynchronous response mode, an asynchronous forwarding mode or a batch push mode;

[0007] When the business mode is the synchronous response mode, after performing business processing on the data push request, a business response is returned to the requesting end;

[0008] In the case where the business mode is the asynchronous response mode, after returning the request response to the request end, performing asynchronous business processing on the data push request, and returning a business response to the request end;

[0009] When the business mode is the synchronous forwarding mode, the asynchronous forwarding mode or the batch push mode, the push mode corresponding to the data push request is determined according to the request number in the data push request, and the target node is determined according to the push mode, and the data push request is processed according to the business mode and the target node, wherein the push mode is any one of broadcast, multicast or unicast.

[0010] In a second aspect, the present application provides a data push device, comprising:

[0011] A receiving module, used to receive a data push request sent by a requesting end;

[0012] A determination module, used to determine the service mode of the data push request, wherein the service mode is any one of a synchronous response mode, a synchronous forwarding mode, an asynchronous response mode, an asynchronous forwarding mode or a batch push mode;

[0013] A processing module, configured to return a service response to the requesting end after performing service processing on the data push request when the service mode is the synchronous response mode;

[0014] The processing module is further configured to, when the business mode is the asynchronous response mode, perform asynchronous business processing on the data push request after returning a request response to the request end, and return a business response to the request end;

[0015] The determination module is further configured to determine, when the business mode is the synchronous forwarding mode, the asynchronous forwarding mode or the batch push mode, a push mode corresponding to the data push request according to a request number in the data push request, and determine a target node according to the push mode;

[0016] The processing module is further used to process the data push request according to the business mode and the target node, wherein the push mode is any one of broadcast, multicast or unicast.

[0017] In a third aspect, an embodiment of the present application provides a data push device, including: a memory, a processor;

[0018] The memory stores computer-executable instructions;

[0019] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.

[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.

[0021] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.

[0022] The data push method provided in the present application receives a data push request sent by a requesting end and determines a business mode of the data push request, wherein the business mode is any one of a synchronous response mode, a synchronous forwarding mode, an asynchronous response mode, an asynchronous forwarding mode or a batch push mode. When the business mode is the synchronous response mode, after business processing is performed on the data push request, a business response is returned to the requesting end. When the business mode is the asynchronous response mode, after returning the request response to the requesting end, asynchronous business processing is performed on the data push request, and a business response is returned to the requesting end. When the business mode is the synchronous forwarding mode, the asynchronous forwarding mode or the batch push mode, the push mode corresponding to the data push request is determined according to the request number in the data push request, and the target node is determined according to the push mode, and the data push request is processed according to the business mode and the target node, wherein the push mode is any one of broadcast, multicast or unicast. The method realizes data push modes for diversified business scenarios and improves the flexibility of data push. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] 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.

[0024] Figure 1 A flowchart of the data push method provided in this application;

[0025] Figure 2 A schematic diagram of the structure of the data push device provided in this application;

[0026] Figure 3 This is a schematic diagram of the structure of the data push device provided in this application.

[0027] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0028] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0029] It should be noted that the data push method, device, equipment, medium and program product provided by the present application can be used in the field of big data, and can also be used in any field other than the field of big data. The present application does not limit the application field of the data push method, device, equipment, medium and program product.

[0030] Currently, data push usually uses the Kafka platform, which operates through a publish-subscribe model, allowing the requester to publish data to partitions of specific topics, and the target node subscribes to these topics to receive continuous messages. Kafka uses a distributed coordination mechanism to ensure high availability and persistent storage of messages, while supporting horizontal expansion of the system, thereby achieving data push and real-time processing capabilities.

[0031] However, existing data push methods usually rely on the Kafka platform, but the data push business model of the Kafka platform is single and cannot meet the needs of diversified business scenarios.

[0032] In response to the above problems, the data push method provided by the present application is that the data push platform flexibly responds to different needs by receiving the data push request from the requesting end and identifying its business mode (synchronous response, synchronous forwarding, asynchronous response, asynchronous forwarding or batch push). In the synchronous response mode, the request is directly processed and the response is returned immediately; while the asynchronous response mode first returns the request acceptance confirmation, and then asynchronously processes and feeds back the business results. For synchronous forwarding, asynchronous forwarding or batch push mode, the push mode (broadcast, multicast or unicast) is identified according to the request number. After the target node is selected, the push request is processed according to the business mode and target node. This method realizes the data push mode of diversified business scenarios and improves the flexibility of data push.

[0033] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0034] Figure 1 This is a flow chart of the data push method provided by this application. The execution subject of this embodiment is, for example, a data push platform. Figure 1 As shown, the method includes:

[0035] S101: Receive a data push request sent by a requesting end, and determine a service mode of the data push request, wherein the service mode is any one of a synchronous response mode, a synchronous forwarding mode, an asynchronous response mode, an asynchronous forwarding mode or a batch push mode.

[0036] Among them, the synchronous response mode is a communication method in which the requesting end waits for the response from the data push platform after sending the request. Only when the data push platform processes the request and returns the response will the requesting end continue to perform subsequent operations. This mode ensures a one-to-one correspondence between requests and responses and is suitable for scenarios that require immediate responses.

[0037] Synchronous forwarding mode means that during the data transmission process, after sending the data, the requesting end forwards the data to the target node through the push platform, and waits for the confirmation or response of the target node to ensure that the data is received correctly. Once the target node confirms that the data has been received, the requesting end will continue to send subsequent data. This mode ensures the integrity and consistency of the data and is suitable for scenarios where accurate data transmission needs to be ensured.

[0038] The asynchronous response mode means that during the communication process, the requesting end will not wait for the response from the data push platform immediately after sending the request, but will continue to perform other operations. After processing the request, the data push platform will return the response to the requesting end at an appropriate time. This mode improves the response speed of the system and is particularly suitable for scenarios that do not require immediate response or take a long time to process.

[0039] In the asynchronous forwarding mode, data is transmitted asynchronously between the requester and the target node, that is, after sending data, the requester does not immediately wait for the target node's response or confirmation, but continues to perform other tasks or operations. After receiving the data, the target node will process it at an appropriate time and feedback the processing results to the requester.

[0040] Batch push mode is a way to push multiple pieces of data together. The requester packages multiple pieces of data into a batch and sends them to the target node at one time. After receiving the data, the target node processes it according to the predetermined logic. This mode improves the efficiency of data push, reduces network load and bandwidth usage, and is suitable for scenarios that need to process large amounts of data and do not require high real-time performance.

[0041] It is understandable that after receiving the data push request sent by the requesting end, the request needs to be parsed and identified first, including the extraction and analysis of the request header, request body, parameters, etc. Then, according to the request content and the preset business model rules, the business model corresponding to the request is determined.

[0042] Determining the business model of data push requests is crucial for the data push platform. First, different business models mean different data processing logic and response mechanisms. Correct business model identification can ensure that data is processed and responded to correctly, thereby improving the stability and reliability of the data push platform. Secondly, the choice of business model also directly affects the performance and resource utilization of the data push platform. By optimizing the business model, the efficiency of data processing can be improved, and the load and response time of the data push platform can be reduced. Finally, the choice of business model also reflects the characteristics of business needs and scenarios. Reasonable business model design can better meet business needs and improve user experience.

[0043] S102: When the service mode is the synchronous response mode, after service processing is performed on the data push request, a service response is returned to the requesting end.

[0044] When the business mode is synchronous response mode, when the request end sends a data push request to the data push platform, the data push platform will immediately process the data push request. This processing involves a series of background logical operations, data queries or operations, etc., aiming to perform corresponding business functions according to the request content. After the processing is completed, the data push platform will not end the interaction immediately, but will generate a business response, which contains information such as the processing result, status code, possible data return, etc., and directly return this response to the request end that initiated the request.

[0045] The synchronous response mode provides instant feedback. In this mode, the requester can get a response from the data push platform immediately after sending a data push request, without polling or waiting for asynchronous notifications. This helps improve the user experience and also helps simplify the logical processing of the requester, because all interactions are completed synchronously. In addition, the synchronous response mode also helps ensure data consistency and integrity, because the request and response are completed in the same session or transaction.

[0046] Assuming that the data push platform is an online shopping platform and the data push request is an order submission request, when the business mode is the synchronous response mode, when the online shopping platform receives the order submission request sent by the request end, it will immediately perform business processing on the request, which includes a series of operations such as verifying user information, checking inventory, calculating prices, and generating order details. Once all these processing steps are completed, the online shopping platform directly returns a clear business response to the request end, such as "the order has been successfully submitted."

[0047] S103: When the service mode is the asynchronous response mode, after returning the request response to the request end, asynchronous service processing is performed on the data push request, and a service response is returned to the request end.

[0048] When the business mode is the asynchronous response mode, when the data push platform receives a data push request, it will first return a request response to the requesting end, indicating that the data push request has been successfully received. Subsequently, the data push platform will asynchronously process the data push request in the background, rather than processing it immediately and waiting for the result. After the processing is completed, the data push platform will generate a business response containing the processing result and business status, and asynchronously send this response to the requesting end. This means that the requesting end will not get the processing result immediately after sending the data push request, but will receive the business response from the data push platform at a later point in time.

[0049] In asynchronous response mode, the data push platform can receive and process the next data push request without waiting for the completion of a data push request. In addition, the asynchronous response mode also helps to optimize the user experience because the requesting end can continue to perform other operations after sending a data push request without waiting for the response of the data push platform.

[0050] Assuming that the data push platform is a bank application, and the data push request is a transfer request, when the business mode is the asynchronous response mode, when the request end initiates a transfer request, the bank application will first return a preliminary response to the request end that the transfer request has been received, such as "Your transfer request has been received and is being processed." Subsequently, the bank application asynchronously processes the transfer request in the background, including verifying the account balance, executing the transfer operation, and updating the account information of both parties. Once the processing is completed, whether successful or not, the bank application will asynchronously return the final business response to the request end through notification, SMS or email, such as "Transfer successful" or "Transfer failed due to insufficient account balance."

[0051] S104: When the business mode is synchronous forwarding mode, asynchronous forwarding mode or batch push mode, the push mode corresponding to the data push request is determined according to the request number in the data push request, and the target node is determined according to the push mode, and the data push request is processed according to the business mode and the target node, wherein the push mode is any one of broadcast, multicast or unicast.

[0052] Broadcasting refers to the process in which data is sent to all target nodes in the network (or all target nodes in a broadcast domain) in network communication. This transmission method does not specify a specific recipient, but sends data to all target nodes that may receive it. Broadcasting is usually used in scenarios where the same data needs to be sent to a large number of devices at the same time, such as notifications or commands in the network.

[0053] Multicast (also called multicast) is a network communication technology that allows a device to transmit data to multiple designated receivers at one time. In this mode, data is sent to a specific multicast address, and only the target nodes that join the group can receive the data. Multicast greatly improves the efficiency of data transmission because it reduces the consumption of network bandwidth. It is especially suitable for scenarios where the same data needs to be sent to multiple target nodes at the same time, such as video conferencing, live streaming, etc.

[0054] Unicast refers to the situation in which data is sent to a single destination node in network communication. This transmission mode is the most common network communication mode, which ensures that the data can be accurately received by the designated recipient. Unicast is usually used in scenarios that require customized data transmission, such as point-to-point connection between the requester and the data push platform, where the data push platform sends specific data according to the requester's request.

[0055] In the case where the business mode covers synchronous forwarding mode, asynchronous forwarding mode or batch push mode, the data push platform will identify the specific push mode corresponding to the request based on the request number contained in the data push request. Push modes mainly include broadcast (sending data to all nodes), multicast (sending data to a specific group of nodes) and unicast (sending data to a single target node). Once the push mode is determined, the data push platform will further determine the target node to which the data should be sent. Subsequently, the data push platform will process the data push request in accordance with the determined business mode and target node to ensure that the data can be accurately delivered in the expected manner.

[0056] This flexible business model is used to handle data push requests because different application scenarios may require different data delivery strategies. The synchronous forwarding mode is suitable for scenarios that require immediate feedback, ensuring that the data is processed immediately after being sent; the asynchronous forwarding mode is suitable for scenarios that do not require high real-time performance, allowing the data push platform to process data in the background and improve the throughput of the data push platform; the batch push mode is suitable for scenarios where a large amount of data needs to be transmitted at one time, reducing network overhead by merging requests. In addition, different push modes of broadcast, multicast, and unicast can meet different ranges of data delivery needs, from a single user to the entire user group, to achieve accurate data distribution. This flexibility ensures that the data push platform can adapt to a variety of application scenarios and provide efficient and reliable data delivery services.

[0057] The data push method provided in this embodiment receives a data push request sent by a requesting end and determines a business mode of the data push request, wherein the business mode is any one of a synchronous response mode, a synchronous forwarding mode, an asynchronous response mode, an asynchronous forwarding mode or a batch push mode. When the business mode is the synchronous response mode, after business processing is performed on the data push request, a business response is returned to the requesting end. When the business mode is the asynchronous response mode, after returning the request response to the requesting end, asynchronous business processing is performed on the data push request, and a business response is returned to the requesting end. When the business mode is the synchronous forwarding mode, the asynchronous forwarding mode or the batch push mode, the push mode corresponding to the data push request is determined according to the request number in the data push request, and the target node is determined according to the push mode, and the data push request is processed according to the business mode and the target node, wherein the push mode is any one of broadcast, multicast or unicast. The method realizes data push modes for diversified business scenarios and improves the flexibility of data push.

[0058] In a possible implementation manner, the specific implementation method of determining the target node according to the push mode is: when the push mode is unicast, the target node is determined according to the business elements in the data push request; when the push mode is broadcast or multicast, the target node is determined according to the request number.

[0059] If the push mode is broadcast or multicast, the data push platform will obtain a set of node numbers, all of which are target nodes; if the push mode is unicast, the data push platform will find and determine the unique node number based on the business elements in the data push request (such as user ID, device ID, etc.). Subsequently, the data push platform will further match or assign a function number based on the determined node number, which is usually associated with the task performed by the node. Finally, combining the request number and the function number, the data push platform can determine the target node and ensure that the data can be accurately pushed to the node.

[0060] Assume that the data push platform is an online music platform, the data push request is to push a new song release message, and the requesting end is user A. There is an online music platform, and user A requests to push a new song release message to all fans who follow him. At this time, the push mode is broadcast, and the online music platform will obtain the node number set of all fans who follow user A as the target node. If user A only wants to push the new song release message to his friend B, then the push mode becomes unicast, and the online music platform will find and determine the node number of user B as the target node based on the business elements of B in user A's friend list (such as user ID). After determining the target node, the online music platform will also assign a corresponding function number to it according to the type of message (such as new song release) to ensure that the message can be correctly processed by the target node.

[0061] In a possible implementation manner, when the service mode is the synchronous forwarding mode, the data push request is processed according to the service mode and the target node, and the specific implementation manner includes:

[0062] When the service mode is the synchronous forwarding mode, storing the data push request in a database, and forwarding the data push request to the target node;

[0063] Parse the service processing response returned by the target node, store the push status data in the database, and return the service response to the requesting end.

[0064] It can be understood that in business operations, when the synchronous forwarding mode is adopted as the data processing strategy, the data push platform is first responsible for receiving the data push request from the request end and parsing its message format.

[0065] Next, the data push platform will perform a validity check on the parsed message. If the message does not meet the established specifications or contains errors, the data push platform will immediately send an error response to the requesting end to notify it of a problem with the request. However, if the message passes the validity check and is judged to be legal, the data push platform will further determine the applicable push mode based on the request number carried in the request.

[0066] The push mode will guide the data push platform to locate the target node. Once the target node is accurately identified, the data push request will be stored in the database to ensure the traceability and persistence of the data. Subsequently, the data push request will be synchronously forwarded to the target node for subsequent business processing.

[0067] After receiving the data push request, the target node will process it according to its own business logic. After the processing is completed, the target node will update its local database to reflect the latest business status. At the same time, the target node will also generate a business processing response and return it to the data push platform.

[0068] After receiving the response, the data push platform will parse it and extract key information such as the push status. This information will then be stored in the database. Finally, the data push platform will build a business response package based on the parsed information and send it back to the requesting end to notify it of the processing result and status of the data push request.

[0069] Assume that in the operation of e-commerce business, when the synchronous forwarding mode is used to process order data, the data push platform will first receive the data push request from the e-commerce website (such as the order information submitted by the user), parse it into the JSON message format, and then perform a legality check. If the order information is missing key fields or the format is wrong, an error response will be immediately returned to the e-commerce website. Once the message passes the verification, the data push platform will identify the applicable real-time push mode according to the order number, quickly locate the order processing system as the target node, and store the order information in the database for future reference. Then, the order information is synchronously forwarded to the order processing system for payment verification, inventory inspection and other business processes. After processing, the order processing system updates the local inventory status and generates a processing completion response and returns it to the data push platform. The platform parses the response, records the order processing status to the database, and finally builds a business response package containing the processing results, which is fed back to the e-commerce website in real time to notify it that the order has been successfully processed or the specific reason for failure.

[0070] In a possible implementation manner, when the service mode is the asynchronous forwarding mode, the data push request is processed according to the service mode and the target node, and the specific implementation manner includes:

[0071] When the business mode is the asynchronous forwarding mode, returning a request response to the request end, and storing the data push request in a database;

[0072] Asynchronously forwarding the data push request to the target node;

[0073] The service processing response returned by the target node is parsed, and the push status data is stored in the database.

[0074] Understandably, in the business scenario of asynchronous forwarding mode, the data push platform first receives the data push request from the requesting end. After receiving the data push request, the data push platform will unpack the data, parse it into the message format, and then perform a validity check. If the message is not legal, the platform will immediately reply an error response to the requesting end. On the contrary, if the message is legal, the platform will perform a duplicate filtering operation on the business primary key to ensure the uniqueness of the data.

[0075] At the same time, the data push platform will generate a request response and send it back to the requesting end, indicating that the data push request has been successfully received. Subsequently, the data push platform will also determine the specific push mode based on the request number and determine the target node accordingly. Then the data push platform will convert the message into a string format and store the original data push request in the database.

[0076] Next, the data push platform will poll the push messages in the database and convert the string back into the form of a report. If the push process exceeds the preset number of retries, the data push platform will store the current push status data in the database; otherwise, the request will be pushed to the previously determined target node asynchronously. After receiving the request, the target node will perform specific business processing on it and send the processed response back to the data push platform.

[0077] After receiving the data processing response from the target node, the data push platform will parse it and update the latest push status data to the database, thus completing the entire asynchronous data push process.

[0078] Assume that e-commerce order processing is used as an example. In the asynchronous forwarding mode, when a consumer submits an order through the request end, the data push platform first receives the order request, parses its message format, and checks its legitimacy. If the order information is incorrect, the data push platform immediately replies with an error message to the consumer. If the information is correct, the platform ensures that the order number is unique, processes the order data (such as inventory deduction, payment verification, etc.), and stores the processing results securely in the database. At the same time, the platform generates order processing confirmation information and feeds it back to the consumer, and determines the push mode and target processing system (such as the logistics system) based on the order number. Subsequently, the data push platform converts the message into a string for storage for traceability. If the push to the logistics system fails and the retry limit is exceeded, the data push platform records the failure status and continues to try asynchronous push. After receiving the order, the logistics system performs business processing such as distribution and packaging, and returns the processing results to the data push platform. The data push platform parses the response and updates the order status to the database, marking the end of the entire asynchronous order processing process.

[0079] In a possible implementation manner, when the business mode is the batch push mode, the processing of the data push request according to the business mode and the target node includes:

[0080] When the business mode is the batch push mode, obtaining batch data corresponding to the data push request, and storing the batch data in a file;

[0081] The batch processing data is pushed to the target node according to the login status of the target node.

[0082] It can be understood that, first, the data push platform will receive the data push request from the requesting end. After receiving the data push request, the data push platform will unpack it.

[0083] Next, the data push platform will verify the legitimacy of the unpacked data push request message. If the message is judged to be illegal, the data push platform will immediately send an error response to the requesting end. If the message is verified to be legal, the data push platform will further extract the data that needs to be pushed in batches from the preset batch file or database. These data will determine the push mode based on the request number, and the push mode will determine the target node to which the data will be pushed. In order to optimize data transmission efficiency, the data push platform will compress the data push request message and perform other processing.

[0084] The processed batch data will be stored in the file middleware for subsequent push. At this time, the data push platform will determine the push strategy based on the login status of the target node. If the target node is already logged in, the data push platform will immediately push the data to the target node in an incremental manner. If the target node is not logged in, the data push platform will first persist the batch data, then require the target node to log in, and after processing the login request, push the data incrementally.

[0085] In addition, the data push platform also has the functions of scheduled polling and balance synchronization push to ensure the real-time and accuracy of the data. Regardless of whether the target node is online or not, the data push platform can ensure that the data can be pushed to the target node correctly and in a timely manner. After receiving the pushed data, the target node will perform business processing and update its local database to complete the entire data push process.

[0086] Assume that an e-commerce system needs to synchronize product inventory information to multiple branches in real time. First, the data push platform will receive a product inventory data push request from the e-commerce system request end. After receiving the request, the data push platform immediately unpacks the request to extract the product inventory data. Then, the data push platform verifies the legitimacy of the message. If the message is illegal, it will immediately feedback the error to the e-commerce system. If it is legal, the data push platform will extract the latest product inventory data from the pre-set batch file or database, determine each branch (target node) according to the request number, and push the latest extracted product inventory data. In order to improve efficiency, the data push platform will compress these data messages. After that, the data is stored in the file for push. When the branch system (target node) is logged in, the data push platform will directly push the inventory update in an incremental manner; if the branch system is not logged in, the data push platform will first persist the batch data, then require it to log in, and then push the data after the login is successful. In addition, the data push platform will regularly poll the status of the branch system, and ensure that the inventory information in the branch system database is consistent with the e-commerce system through difference synchronization. After receiving the pushed data, the branch system will update its local database, thus completing the data push process for the entire product inventory.

[0087] In a possible implementation manner, the pushing of the batch processing data to the target node according to the login status of the target node may be specifically implemented by:

[0088] When the target node is logged in, the batch data is pushed to the target node in an incremental push manner according to the stream synchronization sequence number of the target node;

[0089] When the target node is not logged in, the batch data is first persisted, and then the login request of the target node is responded to. After the login response is returned to the target node, the batch data is pushed to the target node in an incremental push manner according to the stream synchronization sequence number of the target node.

[0090] It is understandable that when the target node has logged in, the data push platform will push data based on the stream synchronization sequence number provided by the target node. The stream synchronization sequence number records the location of the last successful data received by the target node. Using the stream synchronization sequence number, the data push platform can determine the part of the data that the target node has not yet received, thereby realizing incremental push. Incremental push only pushes new data that the target node does not yet have, avoiding the transmission of duplicate data.

[0091] However, if the target node has not logged in, the data push platform will not push data immediately. At this time, the data push platform will first persist the batch data, and then wait for the target node to initiate a login request. Once the login request is received, the data push platform will first verify the identity of the target node, and return a login response to it after the verification is passed, confirming that its login is successful. Then, the data push platform will push the batch data to the target node in an incremental push manner according to the latest stream synchronization sequence number obtained by the target node when logging in. This method ensures that even if the target node misses some data during the offline period, it can be quickly supplemented through incremental push after it comes back online.

[0092] In a possible implementation, in addition to pushing the batch data to the target node according to the login status of the target node, the method for the target node to push the batch data further includes:

[0093] The stream synchronization sequence number of the logged-in target node is polled periodically, and the batch processing data is pushed to the target node in an incremental push manner.

[0094] It is understandable that for the logged-in target node, in order to ensure that it can receive the latest data in a timely and accurate manner, the data push platform adopts a strategy of periodically polling its stream synchronization sequence number. This is because the stream synchronization sequence number not only records the location of the target node's last successful data reception, but also ensures that the data can be transmitted in order and without omission during the data push process.

[0095] The scheduled polling mechanism means that the data push platform will regularly query the stream synchronization sequence number of the target node at a preset time interval. This mechanism ensures that the data push platform can grasp the data reception status of the target node in real time, so as to respond and push new data in a timely manner. Whenever the stream synchronization sequence number of the target node is updated (that is, the target node has new data reception requirements), the data push platform will immediately start the incremental push process.

[0096] Incremental push is an efficient data transmission method. It only pushes the data that the target node has not received yet, avoiding the transmission of duplicate data and the waste of resources. After starting incremental push, the data push platform will calculate the data range to be pushed according to the stream synchronization sequence number of the target node, and send this data to the target node in the form of the smallest data packet. This method not only improves the efficiency of data push, but also ensures the integrity and accuracy of the data.

[0097] In a possible implementation manner, when the service mode is the asynchronous response mode, the method further includes:

[0098] Determine a push mode corresponding to the data push request according to the request number in the data push request, and determine a target node according to the push mode;

[0099] Asynchronously return the business response to the client and asynchronously push the business processing results to the target node;

[0100] The service processing response returned by the target node is parsed, and the push status data is stored in the database.

[0101] It is understandable that in the data push process, firstly, according to the request number in the received data push request, the push mode corresponding to the request will be identified and determined. Once the push mode is determined, the data push platform can determine the target node according to the push mode.

[0102] Next, the data push platform performs a series of technical operations to prepare for data push. It first converts the data push request message into a string format, which is usually done to facilitate storage and transmission. Subsequently, the data push request is stored in the database to ensure data persistence and traceability.

[0103] Subsequently, the data push platform adopts asynchronous communication to return the business response information to the requesting end, and sends the business processing results to the previously determined target node. Asynchronous push means that the platform can immediately continue to process other tasks without waiting for the response of the target node. After receiving the business response, the target node will perform corresponding processing according to its business logic, such as data verification, business rule application, etc., and finally generate a business processing response.

[0104] After the processing is completed, the target node returns the business processing response to the data push platform. After receiving these responses, the data push platform will parse them to understand the results of the target node processing. As the last step of the process, the data push platform also stores the push status data in the database.

[0105] Figure 2 This is a schematic diagram of the structure of the data push device provided by this application. Figure 2 As shown, the data push device 200 provided in this embodiment includes:

[0106] Receiving module 201, used to receive a data push request sent by a requesting end;

[0107] A determination module 202, configured to determine a service mode of the data push request, wherein the service mode is any one of a synchronous response mode, a synchronous forwarding mode, an asynchronous response mode, an asynchronous forwarding mode or a batch push mode;

[0108] The processing module 203 is used for returning a service response to the requesting end after performing service processing on the data push request when the service mode is the synchronous response mode;

[0109] The processing module 203 is further configured to, when the business mode is the asynchronous response mode, perform asynchronous business processing on the data push request after returning a request response to the request end, and return a business response to the request end;

[0110] The determination module 202 is further configured to determine, when the business mode is the synchronous forwarding mode, the asynchronous forwarding mode or the batch push mode, a push mode corresponding to the data push request according to the request number in the data push request, and determine a target node according to the push mode;

[0111] The processing module 203 is further configured to process the data push request according to the service mode and the target node, wherein the push mode is any one of broadcast, multicast or unicast.

[0112] In a possible implementation manner, the determination module 202 is further configured to determine the target node according to the service element in the data push request when the push mode is unicast;

[0113] The determination module 202 is further configured to determine the target node according to the request number when the push mode is broadcast or multicast.

[0114] In a possible implementation manner, the processing module 203 is further configured to store the data push request in a database and forward the data push request to the target node when the service mode is the synchronous forwarding mode;

[0115] The processing module 203 is further used to parse the service processing response returned by the target node, store the push status data in the database, and return the service response to the requesting end.

[0116] In a possible implementation manner, the processing module 203 is further configured to return a request response to the request end when the service mode is the asynchronous forwarding mode, and store the data push request in a database;

[0117] The processing module 203 is further configured to asynchronously forward the data push request to the target node;

[0118] The processing module 203 is further used to parse the service processing response returned by the target node and store the push status data into the database.

[0119] In a possible implementation manner, the processing module 203 is further configured to, when the business mode is the batch push mode, obtain batch processing data corresponding to the data push request, and store the batch processing data in a file;

[0120] The processing module 203 is further configured to push the batch processing data to the target node according to the login status of the target node.

[0121] In a possible implementation manner, the processing module 203 is further configured to push the batch data to the target node in an incremental push manner according to the stream synchronization sequence number of the target node when the target node logs in;

[0122] The processing module 203 is also used to persist the batch data first when the target node is not logged in, and then respond to the login request of the target node. After returning the login response to the target node, the batch data is pushed to the target node in an incremental push manner according to the stream synchronization sequence number of the target node.

[0123] In a possible implementation, the processing module 203 is further configured to periodically poll the stream synchronization sequence number of the logged-in target node, and push the batch data to the target node in an incremental push manner.

[0124] In a possible implementation manner, the determination module 202 is further configured to determine a push mode corresponding to the data push request according to a request number in the data push request, and determine a target node according to the push mode;

[0125] The processing module 203 is also used to asynchronously return the service response to the client and asynchronously push the service processing result to the target node;

[0126] The processing module 203 is further used to parse the service processing response returned by the target node and store the push status data into the database.

[0127] The data push device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.

[0128] Figure 3 This is a schematic diagram of the structure of the data push device provided by this application. Figure 3 As shown, the electronic device 300 provided in this embodiment includes: at least one processor 301 and a memory 302. Optionally, the device 300 also includes a communication component 303. The processor 301, the memory 302 and the communication component 303 are connected via a bus 304.

[0129] In a specific implementation process, at least one processor 301 executes the computer-executable instructions stored in the memory 302, so that at least one processor 301 executes the above method.

[0130] The specific implementation process of the processor 301 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0131] In the above embodiments, it should be understood that the processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the invention can be directly implemented as a hardware processor, or can be implemented by a combination of hardware and software modules in the processor.

[0132] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.

[0133] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of this application is not limited to only one bus or one type of bus.

[0134] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0135] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0136] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0137] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0138] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0139] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0140] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0141] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0142] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0143] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.

[0144] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0145] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.

[0146] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.

[0147] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. Unless otherwise specified, the processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. Unless otherwise specified, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory (RRAM), a dynamic random access memory (DRAM), a static random access memory (SRAM), an enhanced dynamic random access memory (EDRAM), a high-bandwidth memory (HBM), a hybrid memory cube (HMC), etc.

[0148] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0149] In the above embodiments, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0150] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0151] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.

Claims

1. A data push method, characterized in that: include: Receive a data push request sent by a requesting end, and determine a service mode of the data push request, wherein the service mode is any one of a synchronous response mode, a synchronous forwarding mode, an asynchronous response mode, an asynchronous forwarding mode or a batch push mode; When the business mode is the synchronous response mode, after performing business processing on the data push request, a business response is returned to the requesting end; In the case where the business mode is the asynchronous response mode, after returning the request response to the request end, performing asynchronous business processing on the data push request, and returning a business response to the request end; When the business mode is the synchronous forwarding mode, the asynchronous forwarding mode or the batch push mode, the push mode corresponding to the data push request is determined according to the request number in the data push request, and the target node is determined according to the push mode, and the data push request is processed according to the business mode and the target node, wherein the push mode is any one of broadcast, multicast or unicast.

2. The method according to claim 1, characterized in that The determining the target node according to the push mode includes: When the push mode is unicast, determining the target node according to the service element in the data push request; When the push mode is broadcast or multicast, the target node is determined according to the request number.

3. The method according to claim 2, characterized in that The processing of the data push request according to the business model and the target node includes: When the service mode is the synchronous forwarding mode, storing the data push request in a database, and forwarding the data push request to the target node; Parse the service processing response returned by the target node, store the push status data in the database, and return the service response to the requesting end.

4. The method according to claim 2, characterized in that: The processing of the data push request according to the business model and the target node includes: When the business mode is the asynchronous forwarding mode, returning a request response to the request end, and storing the data push request in a database; Asynchronously forwarding the data push request to the target node; The service processing response returned by the target node is parsed, and the push status data is stored in the database.

5. The method according to claim 2, characterized in that: The processing of the data push request according to the business model and the target node includes: When the business mode is the batch push mode, obtaining batch data corresponding to the data push request, and storing the batch data in a file; The batch processing data is pushed to the target node according to the login status of the target node.

6. The method according to claim 5, characterized in that The step of pushing the batch processing data to the target node according to the login status of the target node comprises: When the target node is logged in, the batch data is pushed to the target node in an incremental push manner according to the stream synchronization sequence number of the target node; When the target node is not logged in, the batch data is first persisted, and then the login request of the target node is responded to. After the login response is returned to the target node, the batch data is pushed to the target node in an incremental push manner according to the stream synchronization sequence number of the target node.

7. The method according to claim 6, characterized in that Also includes: The stream synchronization sequence number of the logged-in target node is polled periodically, and the batch processing data is pushed to the target node in an incremental push manner.

8. The method according to claim 1, characterized in that In the case where the business mode is the asynchronous response mode, the method further includes: Determine a push mode corresponding to the data push request according to the request number in the data push request, and determine a target node according to the push mode; Asynchronously returning the service response to the client, and asynchronously pushing the service processing result to the target node; The service processing response returned by the target node is parsed, and the push status data is stored in the database.

9. A data push device, characterized in that: include: A receiving module, used to receive a data push request sent by a requesting end; A determination module, used to determine the service mode of the data push request, wherein the service mode is any one of a synchronous response mode, a synchronous forwarding mode, an asynchronous response mode, an asynchronous forwarding mode or a batch push mode; A processing module, configured to return a service response to the requesting end after performing service processing on the data push request when the service mode is the synchronous response mode; The processing module is further configured to, when the business mode is the asynchronous response mode, perform asynchronous business processing on the data push request after returning a request response to the request end, and return a business response to the request end; The determination module is further configured to determine, when the business mode is the synchronous forwarding mode, the asynchronous forwarding mode or the batch push mode, a push mode corresponding to the data push request according to a request number in the data push request, and determine a target node according to the push mode; The processing module is further used to process the data push request according to the business mode and the target node, wherein the push mode is any one of broadcast, multicast or unicast.

10. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 8.

11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 8 when executed by a processor.

12. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 8 when being executed by a processor.