Data push method, electronic device and storage medium
The client obtains configuration files from the content distribution network node and parses configuration information to determine whether to initiate data requests to the server, which solves the problems of long-link resource consumption and invalid push, and achieves resource conservation and data accuracy improvement.
Patent Information
- Application Number
- CN202211405818.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-10
- Publication Date
- 2025-09-02
- Estimated Expiration
- 2042-11-10
AI Technical Summary
In the prior art, the method of data pushing by establishing long links leads to high resource consumption, and the server blindly pushes data, resulting in invalid data push.
The client obtains configuration files from the content distribution network node, parses the configuration information to determine whether to initiate a data request to the server, and establishes a data link for pushing data acquisition only if necessary.
Reduces resource consumption, improves the accuracy of data push, and ensures that the client only obtains the push data that is really needed.
Smart Images

Figure CN115834675B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of network technology, and in particular to a data push method, electronic device, and storage medium. Background Art
[0002] With the rapid development of network technology, various data can be obtained from the server through the client, and the obtained data can be displayed on the client for client users to view.
[0003] Currently, a common data acquisition method is to push data from the server to the client. In the prior art, a long link is generally established between the client and the server. During the long link process, the server can push data to the client at any time through the long link.
[0004] However, when pushing data by establishing a long link, the server and the client need to maintain a long data link, which consumes a lot of resources. In addition, the server blindly pushes data to the client, which also results in invalid data push. Summary of the Invention
[0005] In view of the above problems, the embodiments of the present application propose a data push method, electronic device and storage medium, which can reduce resource consumption and improve the accuracy of data push.
[0006] According to one aspect of an embodiment of the present application, a data push method is provided, which is applied to a client, and the method includes: initiating a first request to a content distribution network node to obtain a configuration file, the configuration file including configuration information corresponding to each push data; receiving the configuration file returned by the content distribution network node, saving the configuration file locally on the client, the configuration file being returned to the client by the content distribution network node in response to an update to the configuration file; parsing the configuration file to obtain the configuration information; and determining whether to initiate a second request to a server based on a first preset push condition included in the configuration information, the second request being used to obtain the push data corresponding to the configuration information.
[0007] Optionally, determining whether to initiate a second request to the server based on a first preset push condition included in the configuration information includes: determining the validity of the configuration information based on the first preset push condition; and determining to initiate the second request to the server in response to the configuration information being valid.
[0008] Optionally, the first preset push condition includes a first push deadline condition and / or a first push restriction condition; determining the validity of the configuration information based on the first preset push condition includes: in a case where the first preset push condition includes the first push deadline condition, obtaining the current time, and determining that the configuration information is valid in response to the current time satisfying the first push deadline condition; in a case where the first preset push condition includes the first push restriction condition, obtaining client information, and determining that the configuration information is valid in response to the client information satisfying the first push restriction condition.
[0009] Optionally, the first push restriction condition includes a client user level restriction condition, and obtaining the client information and determining that the configuration information is valid in response to the client information satisfying the first push restriction condition includes: obtaining the client user level and determining that the configuration information is valid in response to the client user level satisfying the client user level restriction condition; wherein the client user level restriction condition is used to limit the configuration of different push data for different client user levels to achieve accurate push of push data.
[0010] Optionally, the first push restriction condition includes a client user type restriction condition, and obtaining the client information and determining that the configuration information is valid in response to the client information satisfying the first push restriction condition includes: obtaining the client user type and determining that the configuration information is valid in response to the client user type satisfying the client user type restriction condition; wherein the client user type restriction condition is used to limit the configuration of push data to authorized client user types to achieve secure push of push data.
[0011] Optionally, the first push restriction condition includes a client user location restriction condition, and obtaining the client information and determining that the configuration information is valid in response to the client information satisfying the first push restriction condition includes: obtaining the client user location and determining that the configuration information is valid in response to the client user location satisfying the client user location restriction condition; wherein the client user location restriction condition is used to limit the configuration of different push data for different client user locations to achieve regional push of push data.
[0012] Optionally, the method further includes: in response to determining to initiate the second request to the server, calculating an initiation time of the second request; and initiating the second request to the server according to the initiation time.
[0013] Optionally, calculating the initiation time of the second request includes: calculating a random time in a target time interval, and using the random time as the initiation time of the second request; wherein, the target time interval represents the time interval from the current time to the target time, and the target time represents the time that is a preset time length away from the current time.
[0014] According to another aspect of an embodiment of the present application, a data push method is provided, which is applied to a content distribution network node, the method comprising: in response to receiving a first request for obtaining a configuration file initiated by a client, determining whether the configuration file has been updated; in response to the existence of an update to the configuration file, returning the configuration file to the client, the configuration file including configuration information corresponding to each push data; so that the client receives the configuration file, saves the configuration file locally on the client, parses the configuration file to obtain the configuration information, and determines whether to initiate a second request to the server based on a first preset push condition included in the configuration information, the second request being used to obtain the push data corresponding to the configuration information.
[0015] Optionally, determining whether the configuration file has been updated includes: determining whether the configuration file has been updated with at least one of the following: newly added configuration information for push data, deleted configuration information for push data, and modified configuration information for push data.
[0016] According to another aspect of an embodiment of the present application, a data push method is provided, which is applied to a server, the method comprising: generating a configuration file, sending the configuration file to a content distribution network node, the configuration file including configuration information corresponding to each push data; enabling a client to initiate a first request to the content distribution network node to obtain the configuration file; receiving the configuration file returned by the content distribution network node, saving the configuration file locally on the client, the configuration file being returned to the client by the content distribution network node in response to an update to the configuration file; parsing the configuration file to obtain the configuration information; determining whether to initiate a second request to the server based on a first preset push condition included in the configuration information, the second request being used to obtain push data corresponding to the configuration information; and pushing the push data corresponding to the configuration information to the client in response to receiving the second request initiated by the client.
[0017] Optionally, pushing the push data corresponding to the configuration information to the client includes: obtaining a second preset push condition corresponding to the push data, and determining whether to push the push data to the client based on the second preset push condition; in response to determining to push the push data to the client, pushing the push data to the client.
[0018] Optionally, the second preset push condition includes a second push deadline condition and / or a second push restriction condition; determining whether to push the push data to the client based on the second preset push condition includes: in the case where the second preset push condition includes the second push deadline condition, obtaining the current time, and in response to the current time satisfying the second push deadline condition, determining to push the push data to the client; in the case where the second preset push condition includes the second push restriction condition, obtaining the client information contained in the second request, and in response to the client information satisfying the second push restriction condition, determining to push the push data to the client.
[0019] According to another aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; and one or more computer-readable storage media having instructions stored thereon; when the instructions are executed by the one or more processors, the processors execute the data push method as described in any of the above items performed by the client, or execute the data push method as described in any of the above items performed by the content distribution network node, or execute the data push method as described in any of the above items performed by the server.
[0020] According to another aspect of an embodiment of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the processor executes any of the data push methods performed by the client, or executes any of the data push methods performed by the content distribution network node, or executes any of the data push methods performed by the server.
[0021] In the embodiment of the present application, configuration information is established for push data, and the configuration information is integrated into a configuration file and saved to a content distribution network node. The client obtains the configuration file from the content distribution network node and saves the configuration file locally on the client. The client can then analyze the configuration information of the push data locally to determine whether to obtain the push data corresponding to the configuration information from the server. Therefore, on the one hand, there is no need to establish a long connection between the client and the server. The client only needs to establish a data connection with the server after determining to obtain push data from the server, thereby reducing resource consumption. On the other hand, the server no longer blindly pushes data to the client. Instead, the client analyzes the configuration information corresponding to the push data and obtains the push data that the client actually needs from the server, thereby improving the accuracy of data push. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are only some drawings of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0023] Figure 1 This is a system structure diagram of an embodiment of the present application.
[0024] Figure 2 This is a flowchart of the steps of a data push method in an embodiment of the present application.
[0025] Figure 3 This is a flowchart of the steps of another data push method according to an embodiment of the present application.
[0026] Figure 4 This is a step flow chart of another data push method according to an embodiment of the present application.
[0027] Figure 5 It is a flow chart of a data push method according to an embodiment of the present application.
[0028] Figure 6 It is a structural diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0029] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, rather than all the embodiments of this application. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0030] It should be noted that all actions of acquiring signals, information or data in this application are carried out in compliance with the relevant data protection laws and policies of the country where they are located and with the authorization given by the owner of the corresponding device.
[0031] Reference Figure 1 , shows a system architecture diagram of an embodiment of the present application. Figure 1 As shown, the system architecture includes clients, content delivery network (CDN) nodes and servers. Among them, a server can perform two-way communication with multiple content delivery network nodes, and a content delivery network node can perform two-way communication with multiple clients.
[0032] The server manages the push data that needs to be pushed to the client. The server analyzes the push data, establishes configuration information corresponding to each push data, and generates a configuration file containing the configuration information corresponding to each push data. The server communicates with the content distribution network nodes and sends the configuration file to each content distribution network node.
[0033] Content delivery network nodes manage configuration files sent by servers. They communicate with clients and, when a client requests a configuration file, return the latest one to the requesting client. By storing configuration files on the CDN nodes, clients can access them from them, reducing server access pressure.
[0034] The client is used to obtain the configuration file from the content distribution network node, save the configuration file locally on the client, and analyze the configuration file locally on the client to determine whether to initiate a request to the server to obtain push data corresponding to the relevant configuration information.
[0035] In the embodiment of the present application, configuration information is established for push data, and the configuration information is integrated into a configuration file and saved to a content distribution network node. The client obtains the configuration file from the content distribution network node and saves the configuration file locally on the client. The client can then analyze the configuration information of the push data locally to determine whether to obtain the push data corresponding to the configuration information from the server. Therefore, on the one hand, there is no need to establish a long connection between the client and the server. The client only needs to establish a data connection with the server after determining to obtain push data from the server, thereby reducing resource consumption. On the other hand, the server no longer blindly pushes data to the client. Instead, the client analyzes the configuration information corresponding to the push data and obtains the push data that the client actually needs from the server, thereby improving the accuracy of data push.
[0036] The data push method of the embodiment of the present application will be described in detail below.
[0037] Reference Figure 2 , shows a step flow chart of a data push method in an embodiment of the present application. Figure 2 The data push method shown is applied to the client.
[0038] like Figure 2 As shown, the data push method may include the following steps:
[0039] Step 201: The client initiates a first request to a content distribution network node to obtain a configuration file, where the configuration file includes configuration information corresponding to each push data.
[0040] The server is used to manage push data that needs to be pushed to each client.
[0041] In the embodiment of the present application, the server can establish configuration information corresponding to each push data, and generate a configuration file containing the configuration information corresponding to each push data.
[0042] For example, the configuration information corresponding to the push data may include, but is not limited to, at least one of the following: an identifier (ID) of the push data, a first preset push condition for the push data, and the like. The first preset push condition for the push data represents a condition that the client must meet in order to obtain the push data. This will be described in detail later.
[0043] After generating the configuration file, the server sends the configuration file to each content distribution network node connected thereto.
[0044] Exemplarily, a long link can be established between the server and the content distribution network node, and the server sends the configuration file to the content distribution network node through the long link; the server can also establish a data link with the content distribution network node when it needs to send data to the content distribution network node, and send the configuration file to the content distribution network node through the data link. The embodiments of the present application do not limit this.
[0045] After receiving the configuration file sent by the server, the content distribution network node saves the configuration file locally in the content distribution network node so that the client can subsequently obtain the configuration file from the content distribution network node.
[0046] The client can obtain the configuration file from the content distribution network node according to preset rules. The preset rules can be regular acquisition (such as obtaining the configuration file every 15 minutes), or acquisition during a preset time period (such as obtaining during a relatively idle time period of the client), etc., and the present embodiment does not impose any restrictions on this.
[0047] When obtaining a configuration file, the client initiates a first request to a content delivery network node.
[0048] For example, a long link can be established between the client and the content distribution network node, and the client initiates a first request to the content distribution network node through the long link; the client can also establish a data link with the content distribution network node when it needs to initiate a first request to the content distribution network node, and initiate the first request to the content distribution network node through the data link. The embodiments of the present application do not limit this.
[0049] The first request is used to obtain the configuration file. Exemplarily, the first request may include but is not limited to the following information: an identifier of the client, first instruction information for instructing to obtain the configuration file, and the like.
[0050] Step 202: The client receives the configuration file returned by the content distribution network node and saves the configuration file locally on the client.
[0051] After receiving the first request sent by the client, the content distribution network node parses the first request to obtain the client identifier and first instruction information for instructing to obtain the configuration file.
[0052] The content delivery network node determines whether the configuration file has been updated based on the first indication information. The specific update determination process will be described in detail in the following embodiments. If the configuration file has been updated, the content delivery network node returns the configuration file to the client based on the client's identifier. If the configuration file has not been updated, the content delivery network node does not need to return the configuration file to the client because the client has already obtained the current configuration file when initiating the first request and has stored the current configuration file locally on the client.
[0053] After receiving the configuration file returned by the content distribution network node, the client can save the configuration file locally on the client.
[0054] It is understandable that if the client has currently saved a configuration file, it means that the configuration file received this time is updated relative to the configuration file currently saved by the client, so the client can use the configuration file received this time to replace the currently saved configuration file.
[0055] Step 203: The client parses the configuration file to obtain the configuration information.
[0056] After saving the received configuration file locally on the client, the client parses the configuration file locally on the client to obtain configuration information corresponding to each push data contained in the configuration file.
[0057] Step 204: The client determines whether to initiate a second request to the server according to the first preset push condition included in the configuration information.
[0058] The client determines whether to initiate a second request to the server based on the configuration information corresponding to each piece of push data and the first preset push condition included in the configuration information, wherein the second request is used to obtain the push data corresponding to the configuration information.
[0059] Exemplarily, the second request may include but is not limited to the following information: an identifier of the client, an identifier of the push data corresponding to the configuration information, second indication information for instructing to obtain the push data corresponding to the configuration information, and the like.
[0060] In an optional embodiment, the process of determining whether to initiate a second request to the server based on a first preset push condition included in the configuration information may include: determining the validity of the configuration information based on the first preset push condition; and, in response to the configuration information being valid, determining to initiate the second request to the server. In this manner, when the configuration information is valid, it indicates that the client meets the conditions for obtaining the push data corresponding to the configuration information, i.e., the push data corresponding to the configuration information is valid data for the client, thereby ensuring that the client obtains the push data it truly needs.
[0061] Exemplarily, the first preset push condition may include but is not limited to at least one of the following: a first push deadline condition, a first push restriction condition, and the like.
[0062] The first push deadline condition is used to limit the validity period for the client to obtain the push data.
[0063] In the case where the first preset push condition includes the first push deadline condition, the process of determining the validity of the configuration information based on the first preset push condition may include: obtaining the current time, and determining that the configuration information is valid in response to the current time satisfying the first push deadline condition.
[0064] Exemplarily, the first push deadline restriction condition may be in the form of a time interval, etc. After the client obtains the current time, it may determine whether the current time is within the time interval of the first push deadline restriction condition. If the current time is within the time interval, it is determined that the configuration information is valid. For example, for push data related to the Double Eleven event, the first push deadline condition corresponding to the push data may be a time interval from November 1 to November 11, etc., indicating that the push data is valid within the time interval from November 1 to November 11. If the current time is within the time interval from November 1 to November 11, it is determined that the configuration information is valid.
[0065] The first push restriction condition is used to restrict the effective conditions for the client to obtain the push data.
[0066] In the case where the first preset push condition includes the first push restriction condition, the process of determining the validity of the configuration information based on the first preset push condition may include: obtaining client information, and determining that the configuration information is valid in response to the client information satisfying the first push restriction condition.
[0067] Exemplarily, the first push restriction condition may include but is not limited to at least one of the following: client user level restriction condition, client user type restriction condition, client user location restriction condition, client user attribute restriction condition, client terminal type restriction condition, etc.
[0068] Client user level restriction conditions are used to configure different push data for different client user levels to make the push data more targeted, thereby achieving accurate push of push data.
[0069] In the case where the first push restriction condition includes a client user level restriction condition, the process of obtaining client information and determining that the configuration information is valid in response to the client information satisfying the first push restriction condition may include: obtaining the client user level and determining that the configuration information is valid in response to the client user level satisfying the client user level restriction condition.
[0070] For example, client users are pre-classified into levels, such as advanced, intermediate, and low, though this embodiment does not limit the specific level classification. The client user level to which the push data is adapted is configured in the configuration information corresponding to the push data as a client user level restriction condition. After obtaining its own client user level, the client determines whether the obtained client user level falls within the client user level to which the push data is adapted, as configured in the configuration information. If so, the obtained client user level satisfies the client user level restriction condition, and thus the configuration information can be determined to be valid.
[0071] The client user type restriction condition is used to limit the configuration of push data to the client user types with permission, so as to push the corresponding push data to the client user types with permission, thereby achieving the safe push of push data.
[0072] In the case where the first push restriction condition includes a client user type restriction condition, the process of obtaining client information and determining that the configuration information is valid in response to the client information satisfying the first push restriction condition may include: obtaining the client user type and determining that the configuration information is valid in response to the client user type satisfying the client user type restriction condition.
[0073] For example, client users are pre-classified into categories, such as members and non-members, though this embodiment does not limit the specific classification. The client user type for which the push data is adapted is configured in the configuration information corresponding to the push data as a client user type restriction condition. After obtaining its own client user type, the client determines whether the obtained client user type belongs to the client user type for which the push data is adapted, as configured in the configuration information. If so, the obtained client user type satisfies the client user type restriction condition, and thus the configuration information can be determined to be valid.
[0074] The client user location restriction condition is used to configure different push data for different client user locations to achieve regional push of push data.
[0075] In the case where the first push restriction condition includes a client user location restriction condition, the process of obtaining client information and determining that the configuration information is valid in response to the client information satisfying the first push restriction condition may include: obtaining the client user location and determining that the configuration information is valid in response to the client user location satisfying the client user location restriction condition.
[0076] For example, the client user is pre-classified into locations, for example, by province, city, district, county, etc., and this embodiment does not limit the specific location classification. The client user location (in the form of a region) to which the push data is adapted is configured in the configuration information corresponding to the push data as a client user location restriction condition. After obtaining its own client user location, the client determines whether the obtained client user location belongs to the client user location to which the push data is adapted configured in the configuration information. If so, it indicates that the obtained client user location meets the client user location restriction condition, and therefore the configuration information can be determined to be valid.
[0077] Client user attribute restriction conditions are used to configure different push data for different client user attributes to make the push data more targeted, thereby achieving accurate push of push data.
[0078] In the case where the first push restriction condition includes a client user level attribute condition, the process of obtaining client information and determining that the configuration information is valid in response to the client information satisfying the first push restriction condition may include: obtaining client user attributes and determining that the configuration information is valid in response to the client user attributes satisfying the client user attribute restriction condition.
[0079] For example, client users are pre-classified into attributes, such as male, female, teenager, young adult, middle-aged, etc., though this embodiment does not limit the specific attribute classification. The client user attributes adapted to the push data are configured in the configuration information corresponding to the push data as client user attribute restriction conditions. After obtaining its own client user attributes, the client determines whether the obtained client user attributes belong to the client user attributes adapted to the push data configured in the configuration information. If so, it indicates that the obtained client user attributes meet the client user attribute restriction conditions, and therefore the configuration information can be determined to be valid.
[0080] The terminal type restriction condition of the client is used to configure different push data for different terminal types of the client, so as to make the push data more targeted and thus achieve accurate push of the push data.
[0081] In the case where the first push restriction condition includes a terminal type restriction condition, the process of obtaining client information and determining that the configuration information is valid in response to the client information satisfying the first push restriction condition may include: obtaining the terminal type to which the client belongs and determining that the configuration information is valid in response to the terminal type to which the client belongs satisfying the terminal type restriction condition.
[0082] Exemplarily, the terminal to which the client belongs is classified in advance, for example, the type classification can be performed based on the terminal model as a dimension, and this embodiment does not limit the specific level classification. Among them, the terminal can be a mobile terminal, a car terminal, and so on. The terminal type to which the push data is adapted is configured in the configuration information corresponding to the push data as a restriction condition for the terminal type to which the client belongs. After the client obtains its own terminal type, it determines whether the obtained terminal type to which the client belongs belongs to the terminal type to which the push data is adapted configured in the configuration information. If so, it means that the obtained terminal type to which the client belongs meets the restriction condition for the terminal type to which the client belongs, and therefore it can be determined that the configuration information is valid.
[0083] After the client determines to initiate the second request to the server, it can establish a data link with the server and initiate the second request to the server through the data link. After the client determines not to initiate the second request to the server, it does not need to establish a data link with the server.
[0084] In an optional implementation, considering the large number of clients, if a large number of clients initiate a second request to the server at the same time, it is easy to cause network congestion. Therefore, the clients are set to initiate the second request to the server at staggered times, thereby dispersing the initiation time of the second request, reducing the concurrency of the server, and reducing the pressure on the server.
[0085] Therefore, in response to determining to initiate the second request to the server, the client can calculate the initiation time of the second request and initiate the second request to the server according to the calculated initiation time. In this way, each client can initiate the second request to the server according to its own calculated initiation time, thereby distributing the initiation time of each client.
[0086] For example, to ensure the dispersion of initiation times, the client can calculate the initiation time of the second request in the following manner: calculate a random time within a target time interval and use the random time as the initiation time of the second request. The target time interval represents the time interval from the current time to the target time, and the target time represents the time that is a preset duration away from the current time. The specific value of the preset duration is not limited in this embodiment of the application; for example, the preset duration can be 10 minutes, etc.
[0087] For example, in an embodiment of the present application, a random time can be calculated within a target time interval based on a shuffling algorithm. The shuffling algorithm breaks up the original array so that a certain number in the original array appears with equal probability at each position in the broken array, thereby solving the problem of randomly selecting m non-repeating numbers from n different numbers. In implementation, a shuffling algorithm such as the Fisher-Yates Shuffle algorithm, the Knuth-Durstenfeld Shuffle algorithm, or the Inside-Out Algorithm algorithm can be used for calculation. The specific processing process will not be discussed in detail in this embodiment.
[0088] After receiving the second request initiated by the client, the server parses the second request to obtain the client's identifier and second indication information. The server obtains the push data corresponding to the configuration information according to the second indication information, and pushes the push data to the client according to the client's identifier.
[0089] After receiving the push data returned by the server, the client can display the push data so that the user of the client can view the push data.
[0090] Reference Figure 3 , shows a step flow chart of another data push method according to an embodiment of the present application. Figure 3 The data push method shown is applied to a content distribution network node.
[0091] like Figure 3 As shown, the data push method may include the following steps:
[0092] Step 301: In response to receiving a first request from a client to obtain a configuration file, a content delivery network node determines whether the configuration file has been updated.
[0093] After the server generates the configuration file, it may need to update the configuration file. After the server updates the configuration file, it will send the updated configuration file to the content distribution network node.
[0094] In response to receiving a first request for obtaining a configuration file initiated by a client, the content distribution network node first determines whether the configuration file has been updated.
[0095] Exemplarily, the content distribution network node may determine whether the configuration file has at least one of the following updates: newly added configuration information of push data, deleted configuration information of push data, and modified configuration information of push data.
[0096] Adding new push data configuration information means adding non-existent push data and then adding the configuration information corresponding to the push data. Deleting push data configuration information means deleting existing push data and then deleting the configuration information corresponding to the push data. Modifying push data configuration information means modifying the configuration information corresponding to existing push data, such as modifying the first push deadline condition, modifying the first push restriction condition, etc.
[0097] Step 302: In response to the configuration file being updated, the content distribution network node returns the configuration file to the client.
[0098] Reference Figure 4 , shows a step flow chart of another data push method according to an embodiment of the present application. Figure 4 The data push method shown is applied to the server.
[0099] like Figure 4 As shown, the data push method may include the following steps:
[0100] Step 401: The server generates a configuration file and sends the configuration file to a content distribution network node.
[0101] Step 402: In response to receiving the second request initiated by the client, the server pushes push data corresponding to the configuration information to the client.
[0102] In an optional implementation, the configuration file may contain misconfigurations, such as misconfigurations of the first push deadline condition, misconfigurations of the first push restriction condition, etc. Therefore, the server may also locally store target configuration information corresponding to each push data item. The target configuration information represents the accurate configuration information corresponding to the push data item. Upon receiving the second request, the server may determine whether to push the push data corresponding to the configuration information to the client based on the accurate configuration information corresponding to the push data item. It is understood that if the configuration file is correctly configured, the configuration information corresponding to each push data item contained in the configuration file is identical to the target configuration information corresponding to each push data item stored locally on the server.
[0103] Similar to the configuration information corresponding to the push data contained in the above-mentioned configuration file, the target configuration information corresponding to the push data may include, but is not limited to, at least one of the following: an identifier (ID) of the push data, a second preset push condition for the push data, etc. When the configuration file is correctly configured, the first preset condition corresponding to the push data is the same as the second preset condition.
[0104] Exemplarily, the process of the server pushing the push data corresponding to the configuration information to the client may include: obtaining a second preset push condition corresponding to the push data, determining whether to push the push data to the client based on the second preset push condition; and in response to determining to push the push data to the client, pushing the push data to the client. In response to determining not to push the push data to the client, the server may also return a notification to the client prohibiting the client from obtaining the push data.
[0105] Exemplarily, similar to the above-mentioned first preset push condition, the second preset push condition may include but is not limited to at least one of the following: a second push deadline condition, a second push restriction condition, and the like.
[0106] In the case where the second preset push condition includes the second push deadline condition, the process of determining whether to push the push data to the client according to the second preset push condition includes: obtaining the current time, and in response to the current time satisfying the second push deadline condition, determining to push the push data to the client.
[0107] If the second preset push condition includes the second push restriction condition, the process of determining whether to push the push data to the client based on the second preset push condition includes: obtaining client information included in the second request, and in response to the client information satisfying the second push restriction condition, determining to push the push data to the client. In this case, the second request initiated by the client to the server may include the client information for verification by the server.
[0108] For example, the second push restriction condition may include, but is not limited to, at least one of the following: a client user level restriction condition, a client user type restriction condition, a client user location restriction condition, a client user attribute restriction condition, a client terminal type restriction condition, etc. The specific processing process can be referred to the relevant description of the above embodiment, and will not be discussed in detail in this embodiment.
[0109] Next, we introduce the data push method based on the overall interaction process between the client, content distribution network node, and server.
[0110] Reference Figure 5 , which shows a flow chart of a data push method according to an embodiment of the present application.
[0111] like Figure 5 As shown, the data push method includes the following processes:
[0112] 1. The server sends the configuration file to the content delivery network node.
[0113] 2. The client initiates a first request to the content delivery network node to obtain the configuration file.
[0114] 3. In response to the configuration file being updated, the content delivery network node returns the configuration file to the client.
[0115] 4. The client receives the configuration file and saves it locally on the client.
[0116] 5. The client parses the configuration file to obtain configuration information, and determines whether to initiate a second request to the server to obtain push data corresponding to the configuration information based on the configuration information.
[0117] 6. In response to the determination, the client initiates a second request to the server and calculates the initiation time of the second request.
[0118] 7. The client initiates a second request to the server according to the initiation time of the second request.
[0119] 8. The server determines whether to return push data to the client.
[0120] 9. In response to determining to return the push data to the client, the server pushes the push data to the client.
[0121] 10. The client receives the pushed data and displays it.
[0122] In the embodiment of the present application, configuration information is established for push data, and the configuration information is integrated into a configuration file and saved to a content distribution network node. The client obtains the configuration file from the content distribution network node and saves the configuration file locally on the client. The client can then analyze the configuration information of the push data locally to determine whether to obtain the push data corresponding to the configuration information from the server. Therefore, on the one hand, there is no need to establish a long connection between the client and the server. The client only needs to establish a data connection with the server after determining to obtain push data from the server, thereby reducing resource consumption. On the other hand, the server no longer blindly pushes data to the client. Instead, the client analyzes the configuration information corresponding to the push data and obtains the push data that the client actually needs from the server, thereby improving the accuracy of data push.
[0123] In an embodiment of the present application, an electronic device is further provided. The electronic device may include one or more processors and one or more computer-readable storage media storing instructions, such as application programs. When the instructions are executed by the one or more processors, the processors execute any of the above methods for pushing data performed by a client, or any of the above methods for pushing data performed by a content distribution network node, or any of the above methods for pushing data performed by a server.
[0124] Figure 6 FIG. 6 is a schematic diagram showing the structure of an electronic device 600 according to an embodiment of the present application. Figure 6 As shown, the electronic device 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) 602 or computer program instructions loaded from a storage unit 608 into a random access memory (RAM) 603. Various programs and data required for the operation of the electronic device 600 can also be stored in the RAM 603. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0125] Multiple components in the electronic device 600 are connected to the I / O interface 605, including an input unit 606, such as a keyboard, a mouse, a microphone, etc.; an output unit 607, such as various types of displays, speakers, etc.; a storage unit 608, such as a magnetic disk, an optical disk, etc.; and a communication unit 609, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 609 allows the electronic device 600 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0126] The various processes and procedures described above may be executed by the processing unit 601. For example, the data push method of any of the above embodiments may be implemented as a computer software program, which is tangibly contained in a computer-readable medium, such as the storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 600 via the ROM 602 and / or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the CPU 601, one or more actions in the data push method described above may be performed.
[0127] In an embodiment of the present application, a computer-readable storage medium is further provided, on which a computer program is stored, which can be executed by a processor of an electronic device. When the computer program is executed by the processor, the processor executes the data push method as described in any of the above items performed by the client, or executes the data push method as described in any of the above items performed by the content distribution network node, or executes the data push method as described in any of the above items performed by the server.
[0128] The processors mentioned above may include but are not limited to: CPU, network processor (NP), digital signal processor (DSP), application specific integrated circuit (ASIC), field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
[0129] The computer-readable storage media mentioned above may include but are not limited to: ROM, RAM, Compact Disc Read Only Memory (CD-ROM), Electronic Erasable Programmable Read Only Memory (EEPROM), hard disk, floppy disk, flash memory, etc.
[0130] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0131] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device that includes 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 terminal device. In the absence of further restrictions, an element defined by the sentence "comprises a..." does not exclude the presence of other identical elements in the process, method, article or terminal device that includes the element.
[0132] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus the necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM, RAM, magnetic disk, optical disk), and includes a number of instructions for enabling a terminal (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0133] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of this application, ordinary technicians in this field can also make many forms without departing from the purpose of this application and the scope of protection of the claims, all of which are within the protection of this application.
[0134] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the embodiments of this application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0135] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0136] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, 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 through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0137] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0138] In addition, each functional unit in each embodiment of the present application 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.
[0139] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, 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 and includes several instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a ROM, a RAM, a magnetic disk, or an optical disk.
[0140] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present application should be included in the scope of protection of the present application. In summary, the contents of this specification should not be construed as limiting the present application.
Claims
1. A data push method, characterized in that: Applied to a client, the method includes: Initiate a first request to a content distribution network node to obtain a configuration file, where the configuration file includes configuration information corresponding to each push data; receiving the configuration file returned by the content distribution network node, and saving the configuration file locally on the client; the configuration file is returned to the client by the content distribution network node in response to an update of the configuration file; Parsing the configuration file to obtain the configuration information; Determine whether to initiate a second request to the server according to the first preset push condition included in the configuration information, where the second request is used to obtain push data corresponding to the configuration information.
2. The method according to claim 1, wherein determining whether to initiate a second request to the server based on the first preset push condition included in the configuration information comprises: Determining the validity of the configuration information according to the first preset push condition; In response to the configuration information being valid, determining to initiate the second request to the server.
3. The method according to claim 2, wherein the first preset push condition comprises a first push deadline condition and / or a first push restriction condition; and determining the validity of the configuration information according to the first preset push condition comprises: If the first preset push condition includes the first push deadline condition, obtaining a current time, and determining that the configuration information is valid in response to the current time satisfying the first push deadline condition; In a case where the first preset push condition includes the first push restriction condition, client information is acquired, and in response to the client information satisfying the first push restriction condition, it is determined that the configuration information is valid.
4. The method according to claim 3, wherein the first push restriction condition includes a client user level restriction condition, and the obtaining of client information and determining that the configuration information is valid in response to the client information satisfying the first push restriction condition comprises: Acquiring a client user level, and determining that the configuration information is valid in response to the client user level satisfying the client user level restriction condition; The client user level restriction condition is used to restrict different push data configurations for different client user levels, so as to achieve accurate push of push data.
5. The method according to claim 3, wherein the first push restriction condition includes a client user type restriction condition, and the obtaining of client information and determining that the configuration information is valid in response to the client information satisfying the first push restriction condition comprises: Acquiring a client user type, and determining that the configuration information is valid in response to the client user type satisfying the client user type restriction condition; The client user type restriction condition is used to restrict configuration of push data to authorized client user types, so as to achieve secure push of push data.
6. The method according to claim 3, wherein the first push restriction condition includes a client user location restriction condition, and the obtaining of client information and determining that the configuration information is valid in response to the client information satisfying the first push restriction condition comprises: Acquiring a client user location, and determining that the configuration information is valid in response to the client user location satisfying the client user location restriction condition; The client user location restriction condition is used to restrict the configuration of different push data for different client user locations, so as to achieve regional push of push data.
7. The method according to claim 1, further comprising: In response to determining to initiate the second request to the server, calculating an initiation time of the second request; Initiate the second request to the server according to the initiation time.
8. The method according to claim 7, wherein calculating the initiation time of the second request comprises: Calculating a random time in the target time interval, and using the random time as the initiation time of the second request; The target time interval represents a time interval from the current time to the target time, and the target time represents a time that is a preset time interval from the current time.
9. A data push method, characterized in that: Applied to a content distribution network node, the method includes: In response to receiving a first request for obtaining a configuration file initiated by a client, determining whether the configuration file has been updated; In response to an update to the configuration file, the configuration file is returned to the client, the configuration file including configuration information corresponding to each push data; so that the client receives the configuration file, saves the configuration file locally on the client, parses the configuration file to obtain the configuration information, and determines whether to initiate a second request to the server based on the first preset push condition included in the configuration information, the second request being used to obtain the push data corresponding to the configuration information.
10. The method according to claim 9, wherein determining whether the configuration file has been updated comprises: Determine whether the configuration file has at least one of the following updates: newly added configuration information of push data, deleted configuration information of push data, and modified configuration information of push data.
11. A data push method, characterized in that: Applied to a server, the method includes: Generate a configuration file, send the configuration file to a content distribution network node, the configuration file including configuration information corresponding to each push data; enable the client to initiate a first request to the content distribution network node to obtain the configuration file; receive the configuration file returned by the content distribution network node, save the configuration file locally on the client, and return the configuration file to the client by the content distribution network node in response to an update to the configuration file; parse the configuration file to obtain the configuration information; determine whether to initiate a second request to the server based on a first preset push condition included in the configuration information, the second request being used to obtain the push data corresponding to the configuration information; In response to receiving the second request initiated by the client, push data corresponding to the configuration information is pushed to the client.
12. The method according to claim 11, wherein pushing the push data corresponding to the configuration information to the client comprises: Acquire a second preset push condition corresponding to the push data, and determine whether to push the push data to the client according to the second preset push condition; In response to determining to push the push data to the client, the push data is pushed to the client.
13. The method according to claim 12, wherein the second preset push condition comprises a second push deadline condition and / or a second push restriction condition; and determining whether to push the push data to the client according to the second preset push condition comprises: When the second preset push condition includes the second push deadline condition, obtaining a current time, and in response to the current time satisfying the second push deadline condition, determining to push the push data to the client; In a case where the second preset push condition includes the second push restriction condition, the client information included in the second request is obtained, and in response to the client information satisfying the second push restriction condition, it is determined to push the push data to the client.
14. An electronic device, characterized in that: include: one or more processors; and one or more computer-readable storage media having instructions stored thereon; When the instruction is executed by the one or more processors, the processor executes the data push method as described in any one of claims 1 to 8, or executes the data push method as described in any one of claims 9 to 10, or executes the data push method as described in any one of claims 11 to 13.
15. A computer-readable storage medium, characterized in that A computer program is stored thereon, and when the computer program is executed by a processor, the processor executes the data push method as described in any one of claims 1 to 8, or executes the data push method as described in any one of claims 9 to 10, or executes the data push method as described in any one of claims 11 to 13.
Citation Information
Patent Citations
Distributor and distributing method for multiple servers
CN103024050A
Message polling method and server, and communication system
CN106161593A