Search

CN-115357589-B - Data updating method, device, electronic equipment and storage medium

CN115357589BCN 115357589 BCN115357589 BCN 115357589BCN-115357589-B

Abstract

The present disclosure relates to a data updating method, a device, an electronic apparatus and a storage medium, which are applied to a first server, wherein the method comprises the steps of counting a first operation time generated by any object from a last counting time to a current counting time based on a counting instruction; and updating the total operation times corresponding to the first label based on the first operation times. According to the method and the device, the operation frequency increment corresponding to any object can be obtained based on the statistical instruction, so that the total operation frequency corresponding to the label to which the object belongs can be updated according to the operation frequency increment, and the updating efficiency is improved.

Inventors

  • ZHAO CHENYU

Assignees

  • 北京达佳互联信息技术有限公司

Dates

Publication Date
20260512
Application Date
20220803

Claims (17)

  1. 1. A data updating method, applied to a first server, the method comprising: based on the statistical instruction, counting the first operation times generated from the last statistical time to the current statistical time of any object; Determining a first label corresponding to any object; Updating the total operation times corresponding to the first label based on the first operation times; Under the condition that an object updating instruction is an object deleting instruction, the number of objects corresponding to a second label is updated in response to the object updating instruction aiming at the second label, the total number of object operations of the deleted object is obtained from a first counting database of a second server and used as a second operation number, the total number of operations corresponding to the second label is obtained from a second counting database of the first server, any label and the total number of operations corresponding to any label are stored in the second counting database, if the second operation number is smaller than or equal to the total number of operations corresponding to the second label, the total number of operations corresponding to the second label is subtracted by the second operation number to update the total number of operations corresponding to the second label, if the second operation number is larger than the total number of operations corresponding to the second label, a plurality of objects except for the deleted object are determined, the total number of operations corresponding to the second label is obtained from the first counting database, the total number of operations corresponding to the plurality of objects are respectively updated, the total number of operations corresponding to the second objects are respectively added, and the total number of operations corresponding to the second object corresponding to the second label is updated according to the total number of operations corresponding to the second label.
  2. 2. The data updating method according to claim 1, characterized by further comprising: Generating the statistical instruction every interval for a preset time length; Based on the statistical instruction, the step of counting the first operation times generated by any object from the last statistical time to the current statistical time comprises the following steps: And based on the statistical instruction, obtaining a first operation frequency of any object in a first preset duration from an object change log of any object in the preset duration.
  3. 3. The method for updating data according to claim 1, wherein the step of counting the first number of operations generated by any one object from the last statistical time to the current statistical time based on the statistical instruction further comprises: receiving the statistical instruction sent by a second server, wherein the statistical instruction is generated after the second server counts the first operation times of any object generated in the preset time length every interval preset time length; Based on the statistics instruction, counting the first operation times generated by any object from the last statistics time to the current statistics time comprises the following steps: and determining a first operation frequency generated by any object included in the statistical instruction within the preset duration.
  4. 4. The method for updating data according to claim 1, wherein the step of counting the first number of operations generated by any one object from the last statistical time to the current statistical time based on the statistical instruction further comprises: The statistical instruction sent by a second server is received, wherein the statistical instruction is generated after the second server accumulates the first operation times generated by any object from the last statistical time; Based on the statistics instruction, counting the first operation times generated by any object from the last statistics time to the current statistics time comprises the following steps: and determining that any object included in the statistical instruction corresponds to the first operation times.
  5. 5. The method for updating data according to claim 1, wherein the updating the number of objects corresponding to the second tag in response to the object updating instruction for the second tag includes: responding to an object updating instruction aiming at a second label, and acquiring the number of updated objects corresponding to the object updating instruction; And updating the number of objects corresponding to the second label based on the number of updated objects.
  6. 6. The method for updating data according to claim 5, wherein the step of updating the number of objects corresponding to the second tag in response to the object update instruction for the second tag further comprises, before: and calculating and obtaining the initial object quantity and the initial total operation times respectively corresponding to the plurality of labels from the label-object corresponding relation table stored by the server.
  7. 7. The data updating method according to claim 1, characterized in that the method further comprises: Outputting the number of objects and the total operation times corresponding to different labels to a plurality of clients corresponding to the server, so that the clients can display the number of objects and the total operation times.
  8. 8. A data updating apparatus for application to a first server, the apparatus comprising: The statistics module is configured to execute statistics instructions, and for any object, the statistics module is used for counting the first operation times generated from the last statistics time to the current statistics time of the any object; a determining module configured to perform determining a first tag corresponding to the arbitrary object; an updating module configured to perform updating of the total operation times corresponding to the first tag based on the first operation times; The acquisition module is configured to execute, in the case that the object update instruction is an object deletion instruction, in response to the object update instruction for the second tag, to update the number of objects corresponding to the second tag, and acquire the total number of object operations of the deleted objects from the first count database of the second server as the second operation times; The updating module is further configured to obtain the total operation times corresponding to a current second tag from a second counting database of the first server, any tag and the total operation times corresponding to any tag are stored in the second counting database, if the second operation times are smaller than or equal to the total operation times corresponding to the current second tag, the second operation times are subtracted from the total operation times corresponding to the current second tag to update the total operation times corresponding to the second tag, if the second operation times are larger than the total operation times corresponding to the current second tag, a plurality of objects except for the deleted object corresponding to the second tag are determined, the object operation total number corresponding to each of the plurality of objects is obtained from the first counting database, and the object operation total numbers corresponding to each of the plurality of objects are added to update the total operation times corresponding to the second tag, wherein the second server updates the object operation total number corresponding to any object in the first counting database according to the first operation times corresponding to any object.
  9. 9. The data updating apparatus according to claim 8, characterized in that the apparatus further comprises: The first generation module is configured to execute preset time length at each interval and generate the statistical instruction; the statistics module is specifically configured to perform: And based on the statistical instruction, for any object, obtaining a first operation frequency of the any object in a first preset duration from an object change log of the object in the preset duration.
  10. 10. The data updating apparatus according to claim 8, characterized in that the apparatus further comprises: The first receiving module is configured to execute the statistics instruction sent by the second server, wherein the statistics instruction is generated after the second server counts the first operation times of any object generated in the preset time length every interval preset time length; the statistics module is specifically configured to perform: and determining a first operation frequency generated by any object included in the statistical instruction within the preset duration.
  11. 11. The data updating apparatus according to claim 8, characterized in that the apparatus further comprises: The second receiving module is configured to execute the statistics instruction sent by the second server, wherein the statistics instruction is generated after the second server accumulates the first operation times of any object from the last statistics time; the statistics module is specifically configured to perform: and determining that any object included in the statistical instruction corresponds to the first operation times.
  12. 12. The data updating apparatus of claim 8, wherein the updating module is further configured to execute the update module to obtain a number of objects to be updated corresponding to the object update instruction in response to the object update instruction for the second tag, and update the number of objects corresponding to the second tag based on the number of objects to be updated.
  13. 13. The data updating apparatus according to claim 8, characterized in that the apparatus further comprises: The computing module is configured to execute the calculation to obtain the initial object quantity and the initial total operation times corresponding to the labels respectively from the label-object corresponding relation table stored by the server.
  14. 14. The data updating apparatus according to claim 8, characterized in that the apparatus further comprises: the output module is configured to output the number of objects and the total operation times corresponding to different labels to a plurality of clients corresponding to the server side, so that the plurality of clients display the number of objects and the total operation times.
  15. 15. An electronic device, comprising: A processor; a memory for storing the processor-executable instructions; Wherein the processor is configured to execute the instructions to implement the data update method of any one of claims 1 to 7.
  16. 16. A computer readable storage medium, which when executed by a processor of an electronic device, causes the electronic device to perform the data updating method of any of claims 1 to 7.
  17. 17. A computer program product comprising computer instructions which, when executed by a processor, implement the data updating method of any of claims 1 to 7.

Description

Data updating method, device, electronic equipment and storage medium Technical Field The disclosure relates to the field of data processing, and in particular relates to a data updating method, a data updating device, electronic equipment and a storage medium. Background In the related art, there is a demand for data statistics at a client for publishing objects such as articles, videos or commodities, and for a hot tag, such as news in a current day, the total number of operations such as viewing amount, praise amount or collection amount of all objects under the hot tag is counted. At present, the statistics of the total operation times of the objects under the labels is generally realized by regularly counting the total operation times of all the objects under each label by a server corresponding to a client and covering the original data statistics corresponding to each label. However, since the storage data of the storage service needs to be read frequently, storage pressure may be caused on the relevant read storage service. Disclosure of Invention The disclosure provides a data updating method, a data updating device, an electronic device and a storage medium, so as to at least solve the problem that a statistical count in the related art occupies a large amount of computing resources and may cause storage pressure to related storage services. The technical scheme of the present disclosure is as follows: according to a first aspect of embodiments of the present disclosure, there is provided a data updating method applied to a first server, the method including: Based on the statistical instruction, counting a first operation frequency generated by any object from the last statistical time to the current statistical time aiming at the any object; Determining a first label corresponding to any object; Updating the total operation times corresponding to the first label based on the first operation times In some embodiments, the method further comprises: Generating the statistical instruction every interval for a preset time length; The step of counting the first operation times generated by any object from the last counting time to the current counting time based on the counting instruction comprises the following steps: And based on the statistical instruction, for any object, obtaining a first operation frequency of the any object in the first preset duration from an object change log of the object in the preset duration. In some embodiments, the step of counting the first operation times generated by any object from the last counting time to the current counting time based on the counting instruction further includes: receiving the statistical instruction sent by a second server, wherein the statistical instruction is generated after the second server counts the first operation times of any object generated in the preset time length every interval preset time length; based on the statistics instruction, for any object, counting the first operation times generated by the any object from the last statistics time to the current statistics time comprises: and determining a first operation frequency generated by any object included in the statistical instruction within the preset duration. In some embodiments, the step of counting the first operation times generated by any object from the last counting time to the current counting time based on the counting instruction further comprises, before the step of counting the first operation times generated by any object from the last counting time to the current counting time: The statistical instruction sent by a second server is received, wherein the statistical instruction is generated after the second server accumulates the first operation times generated by any object from the last statistical time; Based on the statistics instruction, counting the first operation times generated by any object from the last statistics time to the current statistics time comprises the following steps: and determining that any object included in the statistical instruction corresponds to the first operation times. In some embodiments, the method further comprises: Responding to an object updating instruction aiming at a second label, and acquiring the number of updating objects corresponding to the updating object instruction; And updating the number of objects corresponding to the second label based on the number of updated objects. In some embodiments, the second server updates the total number of object operations of the objects in the first count database according to the first operation times corresponding to any object; The step of updating the number of objects corresponding to the second tag in response to the object update instruction for the second tag when the object update instruction is the object delete instruction further includes: obtaining the total number of object operations of the deleted object from a first count database of the second server as a secon