Push record cleaning method, device and storage medium

By cleaning up the historical push records of the target device in the push server, the problem of push records occupying a large amount of storage space is solved, and the effect of reducing the storage pressure of the server is achieved.

CN116320005BActive Publication Date: 2025-05-23AISPEECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211405438.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-10
Publication Date
2025-05-23
Estimated Expiration
2042-11-10

AI Technical Summary

Technical Problem

Push records occupy a large amount of storage space, causing data scale to expand, thereby increasing server storage pressure.

Method used

By pushing the resource update message to the target device in response to receiving the resource update message of the software product, the resource update message is pushed to the target device, and after receiving the push confirmation message, the receiving timestamp of the current time is obtained, the product information set subscribed by the target device in the product alias is obtained, and the historical push record whose timestamp is earlier than the received timestamp is cleaned.

Benefits of technology

It effectively reduces the number of historical push records stored in the push server, reduces the storage pressure of the server, and increases the success rate of resource update message push.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116320005B_ABST
    Figure CN116320005B_ABST
Patent Text Reader

Abstract

The present application belongs to the field of data processing technology, and specifically relates to a method, device and storage medium for cleaning push records. The method includes: in response to receiving a resource update message of a software product, pushing the resource update message to the target device, so that the target device returns a push confirmation message when receiving the resource update message; when receiving the push confirmation message, obtaining the receiving timestamp of the current time; obtaining the product information set subscribed by the target device in at least one product alias; the product information set includes the first product alias; cleaning up the historical push records whose timestamps are earlier than the receiving timestamp and correspond to the target device and the product information set. It can solve the problem that push records occupy a large amount of storage, resulting in the expansion of data scale, and then causing greater storage pressure on the server. It can reduce the storage pressure of the server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of data processing technology, and specifically relates to a method, device and storage medium for cleaning push records. Background Art

[0002] When there are update resources for software products on the Internet, in order to ensure that the devices using the software products can obtain the update resources, it is necessary to generate a push message based on the relevant data of the update resources and push it to the device to be pushed. At the same time, a push record will be generated and stored in the server. However, as the number of pushes increases, the number of push records will also increase, resulting in greater storage pressure on the server. Therefore, it is necessary to clean up the push records stored in the server.

[0003] The traditional method for cleaning up push records includes: regularly cleaning up the push records stored in the server.

[0004] However, even if push records are regularly cleaned up, when faced with hundreds of millions of devices, if there are multiple message pushes before the next regular cleanup, the push records will still occupy a large amount of storage, causing the data scale to expand, which in turn leads to greater server storage pressure. Summary of the invention

[0005] This application provides a method, device and storage medium for cleaning push records, which can solve the problem that push records occupy a large amount of storage, resulting in data expansion and further causing greater storage pressure on the server. This application provides the following technical solutions:

[0006] In a first aspect, a method for cleaning push records is provided, the method comprising: in response to receiving a resource update message of a software product, pushing the resource update message to a target device, so that the target device returns a push confirmation message when the resource update message is received; the software product comprises a product identifier and at least one product alias corresponding to the product identifier, and the resource update message comprises the product identifier and a first product alias corresponding to the resource update message; when the push confirmation message is received, obtaining a reception timestamp of the current time; obtaining a product information set subscribed by the target device in the at least one product alias; the product information set comprises the first product alias; and cleaning up historical push records whose timestamps are earlier than the reception timestamp and correspond to the target device and the product information set.

[0007] Optionally, in response to receiving a resource update message of a software product, the resource update message is pushed to a target device, so that the target device returns a push confirmation message when the resource update message is received; the software product includes a product identifier and at least one product alias corresponding to the product identifier, and the resource update message includes the product identifier and a first product alias corresponding to the resource update message; when the push confirmation message is received, a reception timestamp of the current time is obtained; a product information set subscribed by the target device in the at least one product alias is obtained; the product information set includes the first product alias; and historical push records whose timestamps are earlier than the reception timestamp and correspond to the target device and the product information set are cleaned up.

[0008] Optionally, the number of product aliases in the product information set is K; K is a positive integer; the cleaning of historical push records whose timestamps are earlier than the receiving timestamp and corresponding to the target device and the product information set includes: initializing the timestamp variable corresponding to the target device to 0; obtaining the historical timestamp of the target device under the Ith product alias in the product information set; I is positive integers from 1 to K in sequence; when the historical timestamp is earlier than the timestamp variable, deleting the historical push record corresponding to the historical timestamp; when I is not equal to K, setting I=I+1, and triggering the step of obtaining the historical timestamp corresponding to the Ith product alias of the device to be pushed.

[0009] Optionally, when the historical timestamp is later than the current timestamp variable, the value of the timestamp variable is updated to the value of the historical timestamp; when the timestamp variable is updated and I is not equal to K, let I=I+1, and trigger the step of obtaining the historical timestamp of the target device under the Ith product alias in the product information set.

[0010] Optionally, after obtaining the receiving timestamp of the current time, it also includes: storing a first correspondence between the receiving timestamp and the device identifier of the target device, and a second correspondence between the first product alias, the product identifier and the resource update message, to obtain a historical push record corresponding to this message push.

[0011] Optionally, the product information set further includes other product identifiers of M other software products subscribed by the target device and a second product alias corresponding to each other product identifier; M is an integer greater than 0;

[0012] The method of cleaning up the push records corresponding to the target device based on the historical timestamp of the target device under the subscribed product information includes: initializing the timestamp variable corresponding to the target device to 0; obtaining the historical timestamp of the Ith product alias of the target device under the Nth product identification; N is a positive integer from 1 to K in sequence; when the historical timestamp is earlier than the timestamp variable, deleting the historical push record corresponding to the historical timestamp; when I is not equal to K, let I=I+1, and trigger the step of obtaining the historical timestamp of the Ith product alias of the target device under the Nth product identification; when N is not equal to M, let N=N+1, I=1, and trigger the step of obtaining the historical timestamp of the Ith product alias of the target device under the Nth product identification.

[0013] Optionally, when the historical timestamp is later than the timestamp variable, the value of the timestamp variable is updated to the value of the historical timestamp; when the timestamp variable is updated and I is not equal to K, let I=I+1, and trigger the step of obtaining the historical timestamp of the Ith product alias of the target device under the Nth product identification.

[0014] Optionally, before pushing the resource update message to the target device, it also includes: obtaining the current device identification of the currently connected device; determining the device identification corresponding to the first product alias in the preset relationship between the product alias and the device identification; determining the device identification of the target device that is the same as the device identification corresponding to the first product alias in the current device identification, and obtaining the target device.

[0015] Optionally, the resource update message also includes a publishing timestamp corresponding to the resource update message; the publishing timestamp is used to compare with the historical timestamp in the historical push record, and the resource update message is pushed when the publishing timestamp is later than the historical timestamp.

[0016] In a second aspect, an electronic device is provided, the device comprising a processor and a memory; a program is stored in the memory, and the program is loaded and executed by the processor to implement the method for clearing push records described in the first aspect.

[0017] According to a third aspect, a computer-readable storage medium is provided, wherein a program is stored in the storage medium, and when the program is executed by a processor, the program is used to implement the method for clearing push records provided in the first aspect.

[0018] The beneficial effects of the present application are as follows: the method for cleaning up push records provided by the present embodiment pushes the resource update message to the target device in response to receiving the resource update message of the software product, so that the target device returns a push confirmation message when receiving the resource update message; the software product includes a product identifier and at least one product alias corresponding to the product identifier, and the resource update message includes the product identifier and the first product alias corresponding to the resource update message; when receiving the push confirmation message, the receiving timestamp of the current time is obtained; the product information set subscribed by the target device in at least one product alias is obtained; the product information set includes the first product alias; the historical push records with a timestamp earlier than the receiving timestamp and corresponding to the target device and the product information set are cleaned up. This can solve the problem that push records occupy a large amount of storage, resulting in the expansion of data scale, and then causing greater storage pressure on the server. After the resource push message is sent to the target device and the target device returns a push confirmation message, the current time when the push confirmation message is received is obtained as the receiving timestamp, and the historical push records under each product alias in the subscribed product alias of the target device are cleaned up according to the receiving timestamp. In this way, it can be ensured that even if the target device subscribes to multiple product aliases, the push server will only save them, which can greatly reduce the number of historical push records stored in the push server, thereby reducing the storage pressure of the push service.

[0019] In addition, if the resources corresponding to the product alias subscribed by the client device are updated multiple times before the client device is connected to the push server, only the latest resource version needs to be pushed to the client device. Therefore, if the resources corresponding to the product alias are updated, only the original resource update message needs to be overwritten. In this way, each product alias only stores one resource update message at most, which can ensure the minimized storage of resource update messages and further reduce the storage pressure of the push server.

[0020] In addition, client devices that have subscribed to the same product alias of the same software product share the same resource version. Therefore, the resource update messages pushed to these client devices are also the same. In this way, there is no need to generate resource update messages separately for each client device to store the push, which can save the storage of the push server and further reduce the storage pressure of the push server.

[0021] In addition, when there is a client device that has subscribed to the first product alias and has not established a connection with the push server, after the client device establishes a connection with the push server, it will be regarded as the target device and a resource update message will be pushed. This can avoid the client device being unable to receive resource update messages due to the client device not being connected to the push server, thereby improving the success rate of resource update message push.

[0022] In addition, when the push server pushes a resource update message to the target device and does not receive a push confirmation message returned by the target device, the push server will push the message again after the target device establishes a connection with the push server next time. This can improve the fault tolerance of the push server in pushing resource update messages, thereby improving the success rate of pushing resource update messages. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the specific implementation methods of the present application or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0024] Figure 1 This is a flowchart of a method for cleaning push records provided by an embodiment of the present application;

[0025] Figure 2 is a flowchart of a method for cleaning push records provided by another embodiment of the present application;

[0026] Figure 3 is a block diagram of a self-mobile equipment device provided by an embodiment of the present application;

[0027] Figure 4 It is a block diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION

[0028] The technical solution of the present application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. The present application will be described in detail below with reference to the accompanying drawings and in conjunction with the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0029] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0030] In the present application, unless otherwise specified, the directional words used, such as "up, down, top, bottom", usually refer to the directions shown in the drawings, or to the components themselves in the vertical, perpendicular or gravity directions; similarly, for ease of understanding and description, "inside and outside" refer to the inside and outside relative to the outline of each component itself, but the above-mentioned directional words are not used to limit the present application.

[0031] The following is an introduction to the terms used in this application.

[0032] MetaInformation: MetaInformation is information about information. MetaInformation allows the server to provide information about the data being sent. For example, HTTP can improve the object language and objects being sent. MetaInformation can also be used to implement conditional requests and report transaction completion. The browser that receives the data can use the metaInformation to determine what the server has sent, what data is expected, whether the data is received completely, and whether there are any errors in the process. In this way, the client can know the type of the transmitted object.

[0033] The following is a detailed introduction to the method for cleaning up push records provided by this application.

[0034] like Figure 1 As shown, the embodiment of the present application provides a method for cleaning push records. The implementation of the method can rely on a computer program. The computer program can be run on a computer device such as a smart phone, a tablet computer, a personal computer, or a server. This embodiment does not limit the operating subject of the method. The method includes at least the following steps:

[0035] Step 101: in response to receiving a resource update message of a software product, push the resource update message to a target device, so that the target device returns a push confirmation message when receiving the resource update message.

[0036] The software product includes a product identifier and at least one product alias corresponding to the product identifier, and the resource update message includes the product identifier and a first product alias corresponding to the resource update message.

[0037] Accordingly, the resource update message includes the product identifier, the first product alias and the meta information.

[0038] The meta information includes, but is not limited to, description information of resource updates of software products, update versions, download addresses, and timestamps of resource update message releases.

[0039] In this embodiment, the product identifier of the software product is used to uniquely identify the software product, and different software products correspond to different product identifiers.

[0040] At the same time, the product identification of each software product corresponds to at least one product alias, wherein the product alias refers to a name other than the official name of the software product, and a software product can have one or at least two product aliases.

[0041] For the same software product, different product aliases are used to distinguish different versions of software updates. For example, if the software updates of the same software product include grayscale version resource updates, official version resource updates, and test version resource updates, different product aliases can be used to distinguish the grayscale version resource updates, official version resource updates, and test version resource updates.

[0042] Accordingly, the client device obtains the resource update message corresponding to the software update resource of the corresponding version by subscribing to the product alias of the software product.

[0043] For example, take the case where the same software product includes two product aliases, Test A and Official B; Test A is used to indicate resource updates of the test version, and Official B is used to indicate resource updates of the official version. If the client device subscribes to Test A, then when the test version releases new resources, the push server will push the resource update message of the test version to the client device; if the client device subscribes to Official B, then when the official version releases new resources, the push server will push the resource update message of the official version to the client device.

[0044] Based on this, in this embodiment, the target device refers to the client device that has subscribed to the first product alias of the software product. Therefore, before the push server pushes the resource update message to the target device, it is necessary to first determine the target device.

[0045] In this embodiment, the push server stores the current device identification of the currently connected device and the preset relationship between the device identification and the product alias of the software product. The push server determines the device identification of the target device in the current device identification based on the device identification of the currently connected device, the first product alias, and the preset relationship between the device identification and the product alias of the software product, and obtains the target device.

[0046] Specifically, before pushing the resource update message to the target device, it also includes: obtaining the current device identification of the currently connected device; determining the device identification corresponding to the first product alias in the preset relationship between the product alias and the device identification; determining the device identification of the target device that is the same as the device identification corresponding to the first product alias in the current device identification, and obtaining the target device.

[0047] In addition, if there is a client device that has subscribed to the first product alias and has not established a connection with the push server, after the client device establishes a connection with the push server, it is regarded as a target device and a resource update message is pushed.

[0048] When the target device receives the resource update message, the target device returns a push confirmation message to the push server.

[0049] When the push server pushes a resource update message to the target device and does not receive a push confirmation message returned by the target device, the push server will push the message again after the target device establishes a connection with the push server next time.

[0050] If the resource corresponding to the product alias subscribed by the client device has been updated multiple times before the client device connects to the push server, it is only necessary to ensure that the latest resource version is pushed to the client device. Therefore, if the resource corresponding to the product alias is updated, it is only necessary to overwrite the original resource update message. In this way, each product alias only stores one resource update message at most, which can ensure the minimum storage of resource update messages and reduce the storage pressure of the push server.

[0051] In addition, in this embodiment, the resource update message also includes a publishing timestamp corresponding to the resource update message; the publishing timestamp is used to compare with the historical timestamp in the historical push record, and the resource update message is pushed when the publishing timestamp is later than the historical timestamp.

[0052] Based on this, when the target device is connected to the push server, the push server will make a judgment based on the latest resource update message under the product alias and the historical timestamp of the target device, that is, the timestamp of the last push. If the historical timestamp is earlier than the release timestamp in the latest resource update message, it means that there is a new resource update after the last push, and the latest resource push message needs to be pushed to the target device. Otherwise, there is no need to push to the target device.

[0053] In actual implementation, each client device can subscribe to multiple different product aliases, but at the same time, each client device can only use one product alias, that is, at the same time, each client can only use the voluntary resource update message corresponding to one product alias and receive one product alias. When the client device needs to use other product aliases of the software product, the product alias can be switched to use the resources corresponding to the other product aliases after switching to other product aliases.

[0054] In addition, in this embodiment, client devices that have subscribed to the same product alias of the same software product share the same resource version. Therefore, the resource update messages pushed to these client devices are also the same. In this way, there is no need to generate a separate resource update message for each client device to store the push, which can save the storage of the push server and reduce the storage pressure of the push server.

[0055] Step 102: upon receiving the push confirmation message, obtain the receiving timestamp of the current time.

[0056] After the resource update message is successfully pushed to the target device, that is, when the push confirmation message returned by the target device is received, it is also necessary to generate a new historical push record for the target device under the first product alias based on the receiving timestamp, and overwrite the historical record of the previous resource update message, so as to compare the timestamp with the next resource update message when the next resource update message is pushed.

[0057] Specifically, after obtaining the receiving timestamp of the current time, it also includes: storing the first corresponding relationship between the receiving timestamp and the device identifier of the target device, and the second corresponding relationship between the first product alias, the product identifier and the resource update message, to obtain the historical push record corresponding to this message push.

[0058] The first corresponding relationship and the second corresponding relationship are both stored in the database in the form of data structures.

[0059] Optionally, the database may be a Redis database or a MySQL database, etc. This embodiment does not limit the database type of the memory database.

[0060] For example, taking the in-memory database Redis as an example, the first application relationship can be stored in the form of a data structure key-value, where the key is the device identifier and the value is the receiving timestamp. Accordingly, the first corresponding relationship can also be directly stored in the form of key-value, where the key consists of the product identifier and the first product alias, and the value is the resource update message.

[0061] In actual implementation, before the push server pushes the resource update message to the target device, the console may generate the second corresponding relationship and store it in the database.

[0062] The console is a control device that has established a communication connection with the push server, which may be a mobile phone, a platform computer, or a computer. This embodiment does not limit the device type of the console.

[0063] In this embodiment, the console is used to publish resource update messages and notify the push server to enter the push process. When the resource update message is published, the console is used to integrate the timestamp of the resource update message publication into the meta information and store it in the database; in addition, the console is also used to obtain the product identification and the first product alias of the software product, and determine whether the first product alias exists. If the first product alias does not exist, the first product alias is added to the product alias set corresponding to the product identification. The product alias set includes at least one product alias corresponding to the product identification.

[0064] Step 103: Obtain a set of product information subscribed by the target device in at least one product alias.

[0065] The product information set includes a first product alias.

[0066] Step 104: Clear the historical push records whose timestamps are earlier than the receiving timestamp and correspond to the target device and product information set.

[0067] After the push server pushes the resource update message to the target device, it triggers a check of the historical push records under all product aliases of the target device to remove obsolete historical push records and ensure that only one historical push record is retained for each target device. This can reduce the number of historical push records stored by the push server, thereby reducing the storage pressure on the push server.

[0068] In this embodiment, clearing the historical push records with a timestamp earlier than the receiving timestamp and corresponding to the target device and product information set includes but is not limited to the following situations:

[0069] In the first case, the target device subscribes to K different product aliases of a software product, that is, the number of product aliases in the product information set is K; wherein K is a positive integer.

[0070] At this time, the historical push records with timestamps earlier than the receiving timestamp and corresponding to the target device and product information set are cleared, which at least includes steps S11 to S16:

[0071] Step S11, initializing the timestamp variable corresponding to the target device to 0.

[0072] Among them, the timestamp variable is a pre-set custom variable.

[0073] Step S12, obtaining the historical timestamp of the target device under the I-th product alias in the product information set; wherein I is a positive integer ranging from 1 to K in sequence.

[0074] Step S13, when the historical timestamp is earlier than the current timestamp variable, the historical push record corresponding to the historical timestamp is deleted.

[0075] For example: take I as 2, and the time indicated by the current timestamp variable is 2:00 am on November 1, 2022; if the time indicated by the historical timestamp of the target device under the second product alias of the software product is 8:30 am on October 30, 2022, that is, the historical timestamp of the target device under the second product alias of the software product is earlier than the current timestamp variable, then the historical push record of the target device under the second product alias of the software product will be deleted.

[0076] Step S14, when I is not equal to K, set I=I+1, and trigger the step of obtaining the historical timestamp corresponding to the Ith product alias of the device to be pushed.

[0077] Step S15: When the historical timestamp is later than the current timestamp variable, update the value of the timestamp variable to the value of the historical timestamp.

[0078] For example: take I as 1, and the time indicated by the current timestamp variable is 2:00 a.m. on November 1, 2022; if the time indicated by the historical timestamp of the target device under the first product alias of the software product is 8:30 a.m. on November 2, 2022, that is, the historical timestamp of the target device under the first product alias of the software product is later than the current timestamp variable, then the value of the timestamp variable is updated to the value of the historical timestamp.

[0079] Step S16, when the timestamp variable is updated and I is not equal to K, set I=I+1, and trigger the step of obtaining the historical timestamp of the target device under the Ith product alias in the product information set.

[0080] The second type is that the target device also subscribes to M other software products, that is, the product information set also includes other product identifiers of the M other software products subscribed by the target device and the second product alias corresponding to each other product identifier; wherein M is an integer greater than 0.

[0081] At this time, based on the historical timestamp of the target device under the subscription product information, the push records corresponding to the target device are cleaned up, which at least includes steps S21 to S25:

[0082] Step S21, initializing the timestamp variable corresponding to the target device to 0.

[0083] Step S22, obtaining the historical timestamp of the I-th product alias of the target device under the N-th product identification; N is a positive integer from 1 to K in sequence.

[0084] Step S23, when the historical timestamp is earlier than the timestamp variable, the historical push record corresponding to the historical timestamp is deleted.

[0085] Step S24, when I is not equal to K, set I=I+1, and trigger the step of obtaining the historical timestamp of the Ith product alias under the Nth product identification of the target device.

[0086] Step S25, when N is not equal to M, set N=N+1, I=1, and trigger the step of obtaining the historical timestamp of the Ith product alias of the target device under the Nth product identification.

[0087] Step S26: When the historical timestamp is later than the timestamp variable, update the value of the timestamp variable to the value of the historical timestamp.

[0088] Step S27, when the timestamp variable is updated and I is not equal to K, set I=I+1, and trigger the step of obtaining the historical timestamp of the Ith product alias under the Nth product identification of the target device.

[0089] In summary, the method for cleaning up push records provided in this embodiment pushes the resource update message to the target device in response to receiving the resource update message of the software product, so that the target device returns a push confirmation message when receiving the resource update message; the software product includes a product identifier and at least one product alias corresponding to the product identifier, and the resource update message includes the product identifier and the first product alias corresponding to the resource update message; when receiving the push confirmation message, obtain the receiving timestamp of the current time; obtain the product information set subscribed by the target device in at least one product alias; the product information set includes the first product alias; clean up the historical push records whose timestamps are earlier than the receiving timestamp and correspond to the target device and the product information set. This can solve the problem that push records occupy a large amount of storage, resulting in the expansion of data scale, and then causing greater storage pressure on the server. After the resource push message is sent to the target device and the target device returns a push confirmation message, the current time when the push confirmation message is received is obtained as the receiving timestamp, and the historical push records under each product alias in the subscribed product alias of the target device are cleaned up according to the receiving timestamp. In this way, it can be ensured that even if the target device subscribes to multiple product aliases, the push server will only save them, which can greatly reduce the number of historical push records stored in the push server, thereby reducing the storage pressure of the push service.

[0090] In addition, if the resources corresponding to the product alias subscribed by the client device are updated multiple times before the client device connects to the push server, only the latest resource version needs to be pushed to the client device. Therefore, if the resources corresponding to the product alias are updated, only the original resource update message needs to be overwritten. In this way, each product alias only stores one resource update message at most, which can ensure the minimized storage of resource update messages and further reduce the storage pressure of the push server.

[0091] In addition, client devices that have subscribed to the same product alias of the same software product share the same resource version. Therefore, the resource update messages pushed to these client devices are also the same. In this way, there is no need to generate resource update messages separately for each client device to store the push, which can save the storage of the push server and further reduce the storage pressure of the push server.

[0092] In addition, when there is a client device that has subscribed to the first product alias and has not established a connection with the push server, after the client device establishes a connection with the push server, it will be regarded as the target device and a resource update message will be pushed. This can avoid the client device being unable to receive resource update messages due to the client device not being connected to the push server, thereby improving the success rate of resource update message push.

[0093] In addition, when the push server pushes a resource update message to the target device and does not receive a push confirmation message returned by the target device, the push server will push the message again after the target device establishes a connection with the push server next time. This can improve the fault tolerance of the push server in pushing resource update messages, thereby improving the success rate of pushing resource update messages.

[0094] In order to more clearly understand the method for cleaning up push messages provided by this application, an example is given below to illustrate the method. Figure 2 , the method includes the following steps:

[0095] Step 201, initialize the timestamp variable corresponding to the target device to 0.

[0096] Step 202, determine whether there is an uncleaned product alias. If there is an uncleaned product alias, execute step 203, otherwise end the step.

[0097] Step 203: Obtain the historical timestamp of the target device under the current product alias.

[0098] Step 204 , determining whether the timestamp variable is later than the historical timestamp. If the timestamp variable is later than the historical timestamp, executing step 205 ; otherwise, executing step 206 .

[0099] Step 205 , update the value of the timestamp variable to the value of the historical timestamp, and execute step 207 .

[0100] Step 206, delete the push record under the current product alias.

[0101] Step 207, obtain the next product alias and execute step 202.

[0102] In summary, by setting the timestamp variable, the push records under the product aliases subscribed by the target device are cleaned up in sequence, so that the target device only stores one push record, thereby reducing the number of push records stored in the push server, thereby reducing the storage pressure of the push server.

[0103] Figure 3It is a block diagram of a push record cleaning device provided by an embodiment of the present application, and the device includes at least the following modules: a message push module 310, a time acquisition module 320, a collection acquisition module 330 and a record cleaning module 340.

[0104] A message push module 310, configured to push the resource update message to the target device in response to receiving the resource update message of the software product, so that the target device returns a push confirmation message when receiving the resource update message;

[0105] The time acquisition module 320 is used to obtain the receiving timestamp of the current time when the push confirmation message is received;

[0106] A collection acquisition module 330, configured to acquire a product information collection subscribed by a target device in at least one product alias;

[0107] The record cleaning module 340 is used to clean up the historical push records whose timestamps are earlier than the receiving timestamp and correspond to the target device and product information set.

[0108] For relevant details, refer to the above embodiments.

[0109] It should be noted that: the push record cleaning device provided in the above embodiment only uses the division of the above functional modules as an example when cleaning the push records. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the push record cleaning device is divided into different functional modules to complete all or part of the functions described above. In addition, the push record cleaning device provided in the above embodiment and the push record cleaning method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0110] This embodiment provides an electronic device, such as Figure 4 As shown, the electronic device can be Figure 1 The electronic device at least includes a processor 401 and a memory 402.

[0111] The processor 401 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 401 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 401 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 401 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 401 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0112] The memory 402 may include one or more computer-readable storage media, which may be non-transitory. The memory 402 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 402 is used to store at least one instruction, which is used to be executed by the processor 401 to implement the method for cleaning the push records provided in the method embodiment of the present application.

[0113] In some embodiments, the electronic device may further optionally include: a peripheral device interface and at least one peripheral device. The processor 401, the memory 402 and the peripheral device interface may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface via a bus, a signal line or a circuit board. Schematically, the peripheral devices include but are not limited to: a radio frequency circuit, a touch display screen, an audio circuit, and a power supply.

[0114] Of course, the electronic device may also include fewer or more components, which is not limited in this embodiment.

[0115] Optionally, the present application also provides a computer-readable storage medium, in which a program is stored, and the program is loaded and executed by a processor to implement the push record cleaning method of the above method embodiment.

[0116] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0117] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for cleaning push records, It is characterized in that The method comprises: In response to receiving a resource update message of a software product, the resource update message is pushed to a target device, so that the target device returns a push confirmation message when receiving the resource update message; the software product includes a product identifier and at least one product alias corresponding to the product identifier, and the resource update message includes the product identifier and a first product alias corresponding to the resource update message; When the push confirmation message is received, obtaining the receiving timestamp of the current time; Acquire a product information set subscribed by the target device in the at least one product alias; the product information set includes the first product alias; The historical push records with timestamps earlier than the receiving timestamp and corresponding to the target device and product information set are cleared.

2. The method according to claim 1, It is characterized in that The number of product aliases in the product information set is K; K is a positive integer; The clearing of the historical push records having a timestamp earlier than the receiving timestamp and corresponding to the target device and product information set includes: Initialize the timestamp variable corresponding to the target device to 0; Obtaining a historical timestamp of the target device under the I-th product alias of the product information set; I is a positive integer ranging from 1 to K in sequence; If the historical timestamp is earlier than the timestamp variable, the historical push record corresponding to the historical timestamp is deleted; In the case that I is not equal to K, I=I+1 is set, and the step of obtaining the historical timestamp corresponding to the I-th product alias of the target device is triggered.

3. The method according to claim 2, It is characterized in that The method further comprises: In the case where the historical timestamp is later than the received timestamp variable of the current time, updating the value of the timestamp variable to the value of the historical timestamp; When the timestamp variable is updated and I is not equal to K, set I=I+1, and trigger the step of obtaining the historical timestamp of the target device under the Ith product alias in the product information set.

4. The method according to claim 1, It is characterized in that After obtaining the receiving timestamp of the current time, the method further includes: The first correspondence between the receiving timestamp and the device identification of the target device and the second correspondence between the first product alias, the product identification and the resource update message are stored to obtain a historical push record corresponding to the current message push.

5. The method according to claim 1, It is characterized in that The product information set also includes other product identifiers of M other software products subscribed by the target device and a second product alias corresponding to each other product identifier; M is an integer greater than 0; Based on the historical timestamp of the target device under the subscribed product information, the push record corresponding to the target device is cleaned up, including: Initialize the timestamp variable corresponding to the target device to 0; Obtaining a historical timestamp of the Ith product alias of the target device under the Nth product identification; wherein N is a positive integer from 1 to K in sequence; If the historical timestamp is earlier than the timestamp variable, the historical push record corresponding to the historical timestamp is deleted; In the case where I is not equal to K, set I=I+1, and trigger the step of obtaining the historical timestamp of the Ith product alias of the target device under the Nth product identification; When N is not equal to M, let N=N+1, I=1, and trigger the step of obtaining the historical timestamp of the Ith product alias of the target device under the Nth product identification.

6. The method according to claim 3, It is characterized in that In the case where the historical timestamp is later than the timestamp variable, updating the value of the timestamp variable to the value of the historical timestamp; When the timestamp variable is updated and I is not equal to K, I=I+1 is set, and the step of obtaining the historical timestamp of the Ith product alias of the target device under the Nth product identification is triggered.

7. The method according to claim 1, It is characterized in that Before pushing the resource update message to the target device, the method further includes: Get the current device ID of the currently connected device; In a preset relationship between product aliases and device identifiers, determining a device identifier corresponding to the first product alias; The device identification of the target device that is identical to the device identification corresponding to the first product alias is determined in the current device identification to obtain the target device.

8. The method according to claim 1, It is characterized in that The resource update message also includes a publishing timestamp corresponding to the resource update message; the publishing timestamp is used to compare with the historical timestamp in the historical push record, and the resource update message is pushed when the publishing timestamp is later than the historical timestamp.

9. An electronic device, It is characterized in that The electronic device comprises: a processor and a memory; a program is stored in the memory, and the program is loaded and executed by the processor to implement the method for clearing push records as described in any one of claims 1 to 8.

10. A computer-readable storage medium, It is characterized in that The storage medium stores a program, and when the program is executed by the processor, it is used to implement the method for clearing push records as described in any one of claims 1 to 8.

Citation Information

Patent Citations

  • Message push method, device and computer readable storage medium

    CN108667716A

  • Method used for displaying information

    CN108965389A