Instant announcement pushing method and device, equipment and storage medium
By sending instant announcement requests and response headers between the client and the server, the client compares the announcement version number to determine whether there is a latest announcement, solving the problem of supporting the WebSocket protocol in the existing technology, and achieving low-cost and convenient announcement push.
Patent Information
- Application Number
- CN202411820158.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-11
- Publication Date
- 2025-03-11
AI Technical Summary
The existing announcement push method requires both the server and the client to support the WebSocket protocol, which leads to high deployment costs and inconvenient use.
By sending an instant announcement request to the server, the server returns the instant announcement response header. The client extracts the announcement version number from the response header and compares it with the locally stored version number to determine whether there is a latest announcement, and pushes the latest announcement to the client.
There is no need to set the communication protocol between the server and the client, which reduces deployment costs and server performance requirements, and improves the convenience and timeliness of push.
Smart Images

Figure CN119603263A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of instant announcement push, and in particular to a method, device, equipment and storage medium for pushing instant announcements. Background Art
[0002] With the popularization of the Internet and the development of Web applications, the real-time and timeliness of information are becoming more and more important. Traditional information publishing methods such as newspapers, television, and radio are gradually unable to meet the needs in terms of information dissemination and the timeliness of announcements. The timely update of information such as announcements, news, and notifications is crucial for enterprises and users. In the existing instant announcement push method, a persistent connection is usually established through the WebSocket protocol, so that the server pushes the latest announcement data to the client.
[0003] However, this method requires that both the server and the client support the WebSocket protocol, which will result in certain deployment costs and is not convenient. Summary of the invention
[0004] In view of this, the present application provides a method, apparatus, device and storage medium for pushing instant announcements, which are used to solve the problem that the existing announcement push method requires both the server and the client to support the WebSocket protocol, which will result in certain deployment costs and inconvenience.
[0005] To achieve the above objectives, the proposed solution is as follows:
[0006] In a first aspect, a method for pushing an instant announcement includes:
[0007] Sending an instant announcement request to a server, so that the server returns an instant announcement response header;
[0008] Determine the announcement version number from the instant announcement response header as the first announcement version number;
[0009] Extracting the version number of the announcement version stored most recently from the announcement version configuration item pre-established by the local client as the second announcement version number;
[0010] Compare the first announcement version number with the second announcement version number to obtain a comparison result;
[0011] Determine whether the comparison result is an announcement update, and if so, obtain the latest announcement;
[0012] The latest announcement is pushed to the local client.
[0013] Preferably, the sending of the instant announcement request to the server so that the server returns an instant announcement response header includes:
[0014] Sending an instant announcement request to a server, and when the server receives the instant announcement request, creating an HTTP response header;
[0015] Determine the target for immediate announcement;
[0016] Setting the field information of the target instant announcement;
[0017] Add the field information to the HTTP response header to obtain an instant announcement response header;
[0018] The instant announcement response header is returned.
[0019] Preferably, the field information of setting the target instant announcement includes:
[0020] Obtain the protocol version, status code and status description information of the server;
[0021] Combining the protocol version, status code and status description information to obtain protocol information;
[0022] Obtaining the HTTP header fields of the server;
[0023] Obtaining the current time, and generating a timestamp using the current time;
[0024] Randomly selecting a preset number of characters from a preset plurality of first characters, a plurality of second characters, and a plurality of third characters as each random character;
[0025] Concatenate the timestamp and the random characters to obtain the announcement version number;
[0026] The protocol information, HTTP header field and announcement version number are aggregated to obtain the field information of the target instant announcement.
[0027] Preferably, the process of establishing the announcement version configuration item includes:
[0028] Calling an application configuration center to create initial configuration items in the application configuration center;
[0029] Obtain all historical instant announcements published by the server;
[0030] Determine the version number of each of the historical instant announcements;
[0031] The version number of each of the historical instant announcements is stored in the initial configuration item to obtain an announcement version configuration item;
[0032] A configuration management list is set, and the announcement version configuration item is placed in the configuration management list.
[0033] Preferably, the comparing the first announcement version number with the second announcement version number to obtain a comparison result includes:
[0034] Extracting a timestamp from the first announcement version number as a first timestamp;
[0035] Extracting a timestamp from the second announcement version number as a second timestamp;
[0036] Performing format conversion on the first timestamp and the second timestamp respectively according to a preset format to obtain a first time code corresponding to the first timestamp and a second time code corresponding to the second timestamp;
[0037] Determining whether the first time code is the same as the second time code;
[0038] If they are the same, determining that the comparison result is an announcement update;
[0039] If they are not the same, it is determined that the comparison result is that there is no announcement update.
[0040] Preferably, pushing the latest announcement to the local client includes:
[0041] Get the emergency type of the latest announcement;
[0042] Setting a push time point based on the emergency type;
[0043] Obtaining a user account of a current user of the local client;
[0044] Collecting historical click records under the user account, and filtering one or more modules of interest to the current user from the historical click records;
[0045] Matching the latest announcement with each module of interest, and determining whether there is at least one module of interest matching the latest announcement;
[0046] If yes, push the latest announcement to the local client at the push time, and mark the latest announcement with a preset eye-catching label;
[0047] If not, the latest announcement is pushed to the local client at the push time point, and a preset common label is marked on the latest announcement.
[0048] Preferably, setting the push time point based on the emergency type includes:
[0049] If the emergency type is an emergency announcement type or an important announcement type, the current time is used as the push time point;
[0050] If the emergency type is a daily announcement type, multiple first time periods are set;
[0051] For each of the first time periods, analyzing the user activity of the local client in the first time period of each day within a preset historical time period;
[0052] Any moment in the first time period in which the user activity is the highest is used as the push time point.
[0053] In a second aspect, a push device for instant announcements includes:
[0054] A response header returning module, used for sending an instant announcement request to a server, so that the server returns an instant announcement response header;
[0055] A first announcement version number determination module, used to determine the announcement version number from the instant announcement response header as the first announcement version number;
[0056] A second announcement version number determination module, used to extract the version number of the most recently stored announcement version from the announcement version configuration item pre-established by the local client as the second announcement version number;
[0057] A comparison module, used to compare the first announcement version number with the second announcement version number to obtain a comparison result;
[0058] The latest announcement acquisition module is used to determine whether the comparison result is an announcement update, and if so, to obtain the latest announcement;
[0059] A push module is used to push the latest announcement to the local client.
[0060] In a third aspect, a push device for instant announcements includes a memory and a processor;
[0061] The memory is used to store programs;
[0062] The processor is used to execute the program to implement each step of the method for pushing instant announcements as described in any one of the first aspects.
[0063] In a fourth aspect, a storage medium stores a computer program, which, when executed by a processor, implements the steps of the method for pushing instant announcements as described in any one of the first aspects.
[0064] It can be seen from the above technical solution that the present application sends an instant announcement request to the server so that the server returns an instant announcement response header; determines the announcement version number from the instant announcement response header as the first announcement version number; extracts the version number of the most recently stored announcement version from the announcement version configuration item pre-established by the local client as the second announcement version number; compares the first announcement version number with the second announcement version number to obtain a comparison result; determines whether the comparison result is an announcement update, and if so, obtains the latest announcement; and pushes the latest announcement to the local client. In the present application, after sending the instant announcement request, the server returns the announcement response header, which contains the announcement version number. In addition, the local client stores the version number of the most recently stored announcement version. The two can be compared, and after comparison, it is concluded whether the current announcement version number is updated. If so, the latest announcement is obtained for push. The present application does not need to set the communication protocol between the server and the client, does not require high performance of the server, and does not consume deployment costs. It only needs to determine whether there is a latest announcement through the instant announcement request and the instant announcement response header, which greatly improves convenience. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.
[0066] Figure 1 An optional flow chart of a method for pushing instant announcements provided in an embodiment of the present application;
[0067] Figure 2 An example structure diagram of field information provided in an embodiment of the present application;
[0068] Figure 3 A schematic diagram of the structure of a push device for instant announcements provided in an embodiment of the present application;
[0069] Figure 4 A schematic diagram of the structure of an instant announcement push device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0070] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0071] With the popularization of the Internet and the development of Web applications, the real-time and timeliness of information are becoming more and more important. Traditional information publishing methods such as newspapers, television, and radio are gradually unable to meet the needs in terms of information dissemination and timeliness of announcements. The timely update of information such as announcements, news, and notifications is crucial for enterprises and users. In the existing instant announcement push method, a persistent connection is usually established through the WebSocket protocol, so that the server pushes the latest announcement data to the client. However, this method requires both the server and the client to support the WebSocket protocol, which will result in a certain deployment cost and is not convenient.
[0072] In order to solve the problems of the prior art, an embodiment of the present invention provides a method for pushing instant announcements, which can be used in many general or special computing device environments or configurations, such as personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor devices, and distributed computing environments including any of the above devices or equipment.
[0073] The method can also be applied to various clients, computer terminals or intelligent terminals, and its execution subject can be a processor or server of a computer terminal or intelligent terminal. The method flow chart of the method is as follows: Figure 1 As shown, specifically including:
[0074] S1: Send an instant announcement request to the server, so that the server returns an instant announcement response header.
[0075] It can be an instant announcement request sent by the client to the server. After receiving the instant announcement request, the server will return an instant announcement response header.
[0076] The instant announcement response header can be an HTTP response header, which is a set of header information located after the start line of the response message when the server sends a response message to the client. It can include various detailed information about the response, such as the detailed information related to the instant announcement in the instant announcement request of this application. The information can exist in the form of key-value pairs.
[0077] S2: Determine the announcement version number from the instant announcement response header as the first announcement version number.
[0078] When determining the announcement version number from the immediate announcement response header, it is necessary to ensure that the format of the response header is as expected and meets the basic requirements and format to ensure authenticity. This announcement version number may be the version number of the latest announcement version to be released, or it may be the version number of an announcement version that has already been released, and no new announcement version has been generated yet.
[0079] Use this announcement version number as the first announcement version number for subsequent comparisons.
[0080] The code flow corresponding to the above process is as follows:
[0081]
[0082] S3: Extract the version number of the most recently stored announcement version from the announcement version configuration item pre-established by the local client as the second announcement version number.
[0083] An announcement version configuration item is pre-established in the local storage (localStorage) of the local client. The announcement version configuration item is used to store and manage announcement versions, which includes information such as version numbers. The version number of the most recently stored announcement version is the version number of the announcement version that the local client was most recently notified of.
[0084] Among them, you can first open the josn file in the announcement version configuration item, and load the josn file content into a processable list form, that is, load the announcement version configuration item into a list form, and determine whether the loaded configuration item exists. If it exists, get the last element in the list, where each element contains relevant information such as the announcement version, and then extract the value of the attribute, which is the version number of the most recently stored announcement version.
[0085] In order to facilitate comparison with the first announcement version number, the announcement version number obtained in this step is used as the second announcement version number.
[0086] S4: Compare the first announcement version number with the second announcement version number to obtain a comparison result.
[0087] To compare whether two version numbers are consistent, you can look at multiple aspects, such as the position of characters from numbers to letters to decimal points, and the order of the entire version number. If these aspects remain consistent, you can determine that the two version numbers are consistent.
[0088] Whether the two version numbers are consistent can be used to determine whether the announcement version has been updated, that is, whether the announcement version corresponding to the second announcement version number is updated compared to the announcement version corresponding to the first announcement version number, and whether it is the latest announcement version.
[0089] There are two preset comparison results, namely, announcement update and non-existence of announcement update.
[0090] S5: Determine whether the comparison result is an announcement update, and if so, obtain the latest announcement.
[0091] Since the comparison result has been determined in step S4, it can be understood that if the comparison result is an announcement update, it is necessary to obtain the latest announcement and then push the latest announcement. If the comparison result is that there is no announcement update, it means that no latest announcement has been generated.
[0092] Obtaining the latest announcement mainly involves obtaining the topic, detailed content, release time, etc. of the announcement. In addition, after obtaining the latest announcement, the first announcement version number can be marked on the latest announcement to facilitate subsequent tracing or user records.
[0093] S6: Push the latest announcement to the local client.
[0094] When pushing, the content of the latest announcement can be organized and encoded in a preset or specific format so that it can be easily transmitted on the network. For example, if the latest announcement contains multimedia elements such as pictures and videos, these elements must be compressed and converted to ensure transmission efficiency. In addition, the type, model, business needs, etc. of the local client can be obtained, and the appropriate push method and channel can be selected based on this information, so that the local client can accurately and efficiently receive and display the latest announcement without complex configuration of the server and local client, and it is easy to deploy and use.
[0095] It can be seen from the above technical solution that the present application sends an instant announcement request to the server so that the server returns an instant announcement response header; determines the announcement version number from the instant announcement response header as the first announcement version number; extracts the version number of the most recently stored announcement version from the announcement version configuration item pre-established by the local client as the second announcement version number; compares the first announcement version number with the second announcement version number to obtain a comparison result; determines whether the comparison result is an announcement update, and if so, obtains the latest announcement; and pushes the latest announcement to the local client. In the present application, after sending the instant announcement request, the server returns the announcement response header, which contains the announcement version number. In addition, the local client stores the version number of the most recently stored announcement version. The two can be compared, and after comparison, it is concluded whether the current announcement version number is updated. If so, the latest announcement is obtained for push. The present application does not need to set the communication protocol between the server and the client, does not require high performance of the server, and does not consume deployment costs. It only needs to determine whether there is a latest announcement through the instant announcement request and the instant announcement response header, which greatly improves convenience.
[0096] In addition, the existing method also uses a long polling push mechanism, but this mechanism requires the server to wait for a period of time before responding, which will occupy a certain amount of network bandwidth and server resources. This application can solve this problem well and improve timeliness.
[0097] In the method provided in the embodiment of the present invention, the process of sending an instant announcement request to a server so that the server returns an instant announcement response header is specifically described as follows:
[0098] Sending an instant announcement request to a server, and when the server receives the instant announcement request, creating an HTTP response header;
[0099] Determine the target for immediate announcement;
[0100] Setting the field information of the target instant announcement;
[0101] Add the field information to the HTTP response header to obtain an instant announcement response header;
[0102] The instant announcement response header is returned.
[0103] Specifically, when establishing a connection between a server and a local client, the present application is implemented by setting an instant announcement response header in the server. First, an HTTP response header is created and the information to be returned is added to the response header. The target instant announcement can be an announcement pushed by the server to the local client, or it can be the server's current latest announcement. Then, the field information of the target instant announcement is set. The field information includes the announcement version number. Therefore, the field information is added to the HTTP response header as an instant announcement response header, and the instant announcement response header is returned.
[0104] The process of setting the field information of the target instant announcement may specifically include:
[0105] Obtain the protocol version, status code and status description information of the server;
[0106] Combining the protocol version, status code and status description information to obtain protocol information;
[0107] Obtaining the HTTP header fields of the server;
[0108] Obtaining the current time, and generating a timestamp using the current time;
[0109] Randomly selecting a preset number of characters from a preset plurality of first characters, a plurality of second characters, and a plurality of third characters as each random character;
[0110] Concatenate the timestamp and the random characters to obtain the announcement version number;
[0111] The protocol information, HTTP header field and announcement version number are aggregated to obtain the field information of the target instant announcement.
[0112] Specifically, the field information of the target instant announcement can be set as required, and the field information includes protocol information, HTTP header field and announcement version number, such as Figure 2 As shown in the figure, "HTTP / 1.1 200 OK" refers to the protocol information, "Content-Type: application / json" is the HTTP header field, and "Notice-Version: '1730880548HcNcOwBtzJChpJCyJjSBcND1azgdobG3'" is the announcement version number.
[0113] The protocol information consists of the server's protocol version, status code, and status description information, such as Figure 2 The protocol information in the message is as follows: "HTTP / 1.1" indicates that the HTTP protocol version used by the server is 1.1, which is used to regulate the communication method between the server and the client. "200" is the HTTP status code, and "OK" refers to the status description, which is used to inform the client of the processing result of the request. This constitutes the protocol information.
[0114] The HTTP header field is used to indicate the media type of data sent by the server to the local client, or by the local client to the server. It can help the receiver to correctly parse and process the data.
[0115] The announcement version number can be composed of a timestamp and random characters. The timestamp can be generated according to the current time. It is a relatively concise, unformatted digital mark. Using a timestamp to represent the generation time or production time of the announcement version can simplify the format and form of the announcement version number and efficiently obtain field information; in addition, characters are selected from a preset plurality of first characters, a plurality of second characters, and a plurality of third characters, such as selecting a few from a plurality of first characters according to a preset number, selecting a few from a plurality of second characters, and selecting a few from a plurality of third characters. The sum of the number of characters of the selected first characters, second characters, and third characters is a preset number, such as 32. This embodiment does not impose any restrictions on this, which can ensure randomness, and then splicing is performed to obtain the announcement version number, which can also improve security. In addition, encryption can be performed using an encryption algorithm, such as the jsSHA encryption method.
[0116] In one example, the plurality of first characters are "az", the plurality of second characters are "0-9", and the plurality of third characters are "AZ".
[0117] Next, the process of establishing the announcement version configuration item in this application is described in detail.
[0118] Calling an application configuration center to create initial configuration items in the application configuration center;
[0119] Obtain all historical instant announcements published by the server;
[0120] Determine the version number of each of the historical instant announcements;
[0121] The version number of each of the historical instant announcements is stored in the initial configuration item to obtain an announcement version configuration item;
[0122] A configuration management list is set, and the announcement version configuration item is placed in the configuration management list.
[0123] Specifically, the application configuration center can select the Apollo configuration center, which is a distributed configuration center that can centrally manage configuration information of different environments and different applications, and provide real-time update and version control functions of configuration information. In the process of establishing the announcement version configuration item, this application first calls the application configuration center, and then creates the initial configuration item in the application configuration center, such as notice-version, which is the configuration item corresponding to the announcement version. It can store the announcement version number, obtain all historical instant announcements issued by the server, and then store each historical instant announcement in it, thereby forming an announcement version configuration item.
[0124] In addition, when a new announcement is released, the announcement version configuration item can be updated. A configuration list can also be set to place the announcement version configuration item in the configuration management list, which can facilitate management and facilitate local clients to find corresponding version numbers, thereby improving the efficiency of local clients.
[0125] The code flow for storing the announcement version number is as follows:
[0126] localStorage.setItem('noticeVersion', noticeVersion);
[0127] Optionally, the process of comparing the first announcement version number with the second announcement version number to obtain a comparison result is specifically described as follows:
[0128] Extracting a timestamp from the first announcement version number as a first timestamp;
[0129] Extracting a timestamp from the second announcement version number as a second timestamp;
[0130] Performing format conversion on the first timestamp and the second timestamp respectively according to a preset format to obtain a first time code corresponding to the first timestamp and a second time code corresponding to the second timestamp;
[0131] Determining whether the first time code is the same as the second time code;
[0132] If they are the same, determining that the comparison result is an announcement update;
[0133] If they are not the same, it is determined that the comparison result is that there is no announcement update.
[0134] Specifically, since the composition of the announcement version number may be different, or the formation process of the announcement version number may change, it is only necessary to compare the timestamp in the announcement version number. The timestamp is used to indicate information such as the release time of the announcement. Therefore, the first timestamp and the second timestamp are compared. Considering that the formats of the first timestamp and the second timestamp may be different, they are converted according to a preset format before comparison. The preset format can be a character string format, etc. This embodiment does not impose any restrictions on this. Then, compare whether the first time code and the second time code obtained after the conversion are the same.
[0135] Furthermore, the step of pushing the latest announcement to the local client may specifically include:
[0136] Get the emergency type of the latest announcement;
[0137] Setting a push time point based on the emergency type;
[0138] Obtaining a user account of a current user of the local client;
[0139] Collecting historical click records under the user account, and filtering one or more modules of interest to the current user from the historical click records;
[0140] Matching the latest announcement with each module of interest, and determining whether there is at least one module of interest matching the latest announcement;
[0141] If yes, push the latest announcement to the local client at the push time, and mark the latest announcement with a preset eye-catching label;
[0142] If not, the latest announcement is pushed to the local client at the push time point, and a preset common label is marked on the latest announcement.
[0143] In order to improve the flexibility of instant announcement push, this application has made the above settings in the process of pushing the latest announcement to the local client, considering the push time, push method, etc. from multiple aspects, which can improve the user experience in the local client.
[0144] According to the emergency type of the latest announcement, set a dedicated push time point, for example: if the emergency type is an emergency announcement type or an important announcement type, use the current moment as the push time point; if the emergency type is a daily announcement type, set multiple first time periods; for each first time period, analyze the user activity of the local client in the first time period of each day within the preset historical time period; use any moment in the first time period with the highest user activity as the push time point. In this way, it can be best matched with the current user of the local client.
[0145] In addition, personalized push notifications are performed based on the user's preferences and interests. Specifically, historical click records are obtained from the current user's user account to filter one or more modules of interest to the current user. If the latest announcement to be pushed is in line with the user's preferences and interests, the set eye-catching label can be combined with the push time to push the latest announcement to the user. If it is not the latest announcement that the user likes, the set ordinary label can be combined with the push time to push the latest announcement to the user.
[0146] Furthermore, the current user's geographic location can also be considered. If the latest announcement is related to the current user's geographic location, it can be pushed with a striking tag; if the latest announcement is not related to the current user's geographic location, it can be set to be pushed with a normal tag. If the user does not like to receive announcements, it can also not be pushed. This further improves flexibility and intelligence.
[0147] and Figure 1 Corresponding to the method described above, the embodiment of the present invention also provides a push device for instant announcements, which is used to Figure 1 In the specific implementation of the method, the push device for instant announcements provided in the embodiment of the present invention can be used in a computer terminal or various mobile devices, combined with Figure 3 , introduce the push device of instant announcement, such as Figure 3 As shown, the device may include:
[0148] A response header returning module 10 is used to send an instant announcement request to a server so that the server returns an instant announcement response header;
[0149] A first announcement version number determination module 20, configured to determine an announcement version number from the instant announcement response header as the first announcement version number;
[0150] A second announcement version number determination module 30 is used to extract the version number of the most recently stored announcement version from the announcement version configuration item pre-established by the local client as the second announcement version number;
[0151] A comparison module 40, configured to compare the first announcement version number with the second announcement version number to obtain a comparison result;
[0152] The latest announcement acquisition module 50 is used to determine whether the comparison result is an announcement update, and if so, to acquire the latest announcement;
[0153] The push module 60 is used to push the latest announcement to the local client.
[0154] It can be seen from the above technical solution that the present application sends an instant announcement request to the server so that the server returns an instant announcement response header; determines the announcement version number from the instant announcement response header as the first announcement version number; extracts the version number of the most recently stored announcement version from the announcement version configuration item pre-established by the local client as the second announcement version number; compares the first announcement version number with the second announcement version number to obtain a comparison result; determines whether the comparison result is an announcement update, and if so, obtains the latest announcement; and pushes the latest announcement to the local client. In the present application, after sending the instant announcement request, the server returns the announcement response header, which contains the announcement version number. In addition, the local client stores the version number of the most recently stored announcement version. The two can be compared, and after comparison, it is concluded whether the current announcement version number is updated. If so, the latest announcement is obtained for push. The present application does not need to set the communication protocol between the server and the client, does not require high performance of the server, and does not consume deployment costs. It only needs to determine whether there is a latest announcement through the instant announcement request and the instant announcement response header, which greatly improves convenience.
[0155] Furthermore, the embodiment of the present application provides a push device for instant announcements. Figure 4 The hardware structure diagram of the push device for instant announcements is shown in FIG. Figure 4 The hardware structure of the instant bulletin push device may include: at least one processor 01, at least one communication interface 02, at least one memory 03 and at least one communication bus 04.
[0156] In the embodiment of the present application, the number of the processor 01 , the communication interface 02 , the memory 03 , and the communication bus 04 is at least one, and the processor 01 , the communication interface 02 , and the memory 03 communicate with each other through the communication bus 04 .
[0157] The processor 01 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention.
[0158] The memory 03 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), etc., such as at least one disk memory.
[0159] The memory stores a program, and the processor can call the program stored in the memory, and the program is used to execute the following method for pushing instant announcements, including:
[0160] Sending an instant announcement request to a server, so that the server returns an instant announcement response header;
[0161] Determine the announcement version number from the instant announcement response header as the first announcement version number;
[0162] Extracting the version number of the announcement version stored most recently from the announcement version configuration item pre-established by the local client as the second announcement version number;
[0163] Compare the first announcement version number with the second announcement version number to obtain a comparison result;
[0164] Determine whether the comparison result is an announcement update, and if so, obtain the latest announcement;
[0165] The latest announcement is pushed to the local client.
[0166] Optionally, the detailed functions and extended functions of the program may refer to the description of the method for pushing instant announcements in the method embodiment.
[0167] The embodiment of the present application further provides a storage medium, which may store a program suitable for execution by a processor, and when the program is executed, controls the device where the storage medium is located to execute the following instant announcement push method, including:
[0168] Sending an instant announcement request to a server, so that the server returns an instant announcement response header;
[0169] Determine the announcement version number from the instant announcement response header as the first announcement version number;
[0170] Extracting the version number of the announcement version stored most recently from the announcement version configuration item pre-established by the local client as the second announcement version number;
[0171] Compare the first announcement version number with the second announcement version number to obtain a comparison result;
[0172] Determine whether the comparison result is an announcement update, and if so, obtain the latest announcement;
[0173] The latest announcement is pushed to the local client.
[0174] Specifically, the storage medium may be a computer-readable storage medium, and the computer-readable storage medium may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk or a ROM.
[0175] Optionally, the detailed functions and extended functions of the program may refer to the description of the method for pushing instant announcements in the method embodiment.
[0176] In addition, the functional modules in the various embodiments of the present disclosure can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. If the function is implemented in the form of a software functional module 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 disclosure is essentially 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, which is stored in a storage medium and includes a number of instructions for a computer device (which can be a personal computer, a live broadcast device, or a network device, etc.) to perform all or part of the steps of the methods of the various embodiments of the present disclosure.
[0177] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0178] 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.
[0179] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for pushing instant announcements, characterized in that: include: Sending an instant announcement request to a server, so that the server returns an instant announcement response header; Determine the announcement version number from the instant announcement response header as the first announcement version number; Extracting the version number of the announcement version stored most recently from the announcement version configuration item pre-established by the local client as the second announcement version number; Compare the first announcement version number with the second announcement version number to obtain a comparison result; Determine whether the comparison result is an announcement update, and if so, obtain the latest announcement; The latest announcement is pushed to the local client.
2. The method according to claim 1, characterized in that The sending of the instant announcement request to the server so that the server returns an instant announcement response header includes: Sending an instant announcement request to a server, and when the server receives the instant announcement request, creating an HTTP response header; Determine the target for immediate announcement; Setting the field information of the target instant announcement; Add the field information to the HTTP response header to obtain an instant announcement response header; The instant announcement response header is returned.
3. The method according to claim 2, characterized in that The field information of setting the target instant announcement includes: Obtain the protocol version, status code and status description information of the server; Combining the protocol version, status code and status description information to obtain protocol information; Obtaining the HTTP header fields of the server; Obtaining the current time, and generating a timestamp using the current time; Randomly selecting a preset number of characters from a preset plurality of first characters, a plurality of second characters, and a plurality of third characters as each random character; Concatenate the timestamp and the random characters to obtain the announcement version number; The protocol information, HTTP header field and announcement version number are aggregated to obtain the field information of the target instant announcement.
4. The method according to claim 1, characterized in that The process of establishing the announcement version configuration item includes: Calling an application configuration center to create initial configuration items in the application configuration center; Obtain all historical instant announcements published by the server; Determine the version number of each of the historical instant announcements; The version number of each of the historical instant announcements is stored in the initial configuration item to obtain an announcement version configuration item; A configuration management list is set, and the announcement version configuration item is placed in the configuration management list.
5. The method according to claim 1, characterized in that The comparing the first announcement version number with the second announcement version number to obtain a comparison result includes: Extracting a timestamp from the first announcement version number as a first timestamp; Extracting a timestamp from the second announcement version number as a second timestamp; Performing format conversion on the first timestamp and the second timestamp respectively according to a preset format to obtain a first time code corresponding to the first timestamp and a second time code corresponding to the second timestamp; Determining whether the first time code is the same as the second time code; If they are the same, determining that the comparison result is an announcement update; If they are not the same, it is determined that the comparison result is that there is no announcement update.
6. The method according to any one of claims 1 to 5, characterized in that The pushing the latest announcement to the local client includes: Get the emergency type of the latest announcement; Setting a push time point based on the emergency type; Obtaining a user account of a current user of the local client; Collecting historical click records under the user account, and filtering one or more modules of interest to the current user from the historical click records; Matching the latest announcement with each module of interest, and determining whether there is at least one module of interest matching the latest announcement; If yes, push the latest announcement to the local client at the push time, and mark the latest announcement with a preset eye-catching label; If not, the latest announcement is pushed to the local client at the push time point, and a preset common label is marked on the latest announcement.
7. The method according to claim 6, characterized in that The setting of the push time point based on the emergency type includes: If the emergency type is an emergency announcement type or an important announcement type, the current time is used as the push time point; If the emergency type is a daily announcement type, multiple first time periods are set; For each of the first time periods, analyzing the user activity of the local client in the first time period of each day within a preset historical time period; Any moment in the first time period in which the user activity is the highest is used as the push time point.
8. A push device for instant announcements, characterized in that: include: A response header returning module, used for sending an instant announcement request to a server, so that the server returns an instant announcement response header; A first announcement version number determination module, used to determine the announcement version number from the instant announcement response header as the first announcement version number; A second announcement version number determination module, used to extract the version number of the most recently stored announcement version from the announcement version configuration item pre-established by the local client as the second announcement version number; A comparison module, used to compare the first announcement version number with the second announcement version number to obtain a comparison result; The latest announcement acquisition module is used to determine whether the comparison result is an announcement update, and if so, to obtain the latest announcement; A push module is used to push the latest announcement to the local client.
9. A push device for instant announcements, characterized in that: including memory and processor; The memory is used to store programs; The processor is used to execute the program to implement the various steps of the method for pushing instant announcements as described in any one of claims 1-7.
10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, each step of the method for pushing instant announcements as described in any one of claims 1 to 7 is implemented.