Data Processing Method, Apparatus, Electronic Device, and Storage Medium
By determining whether to write a data storage sequence based on the user's data issuance level, the problem of insufficient timeliness and reliability of data transmission in the prior art is solved, and efficient and reliable data transmission is achieved.
Patent Information
- Application Number
- CN202110229775.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-02
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2041-03-02
AI Technical Summary
When the prior art provides users with big data such as feed streams, there are problems of insufficient timeliness and reliability, and it is difficult to provide data efficiently and reliably.
By obtaining the object information and user identification of the target object, determining whether the preset conditions are met based on the user's data issuance level, and determining whether the data is written to the user's storage sequence, thereby achieving efficient and reliable transmission of the data.
It reduces the amount of data that needs to be written at the same time, improves the timeliness, reliability and efficiency of data, and reduces memory consumption and cost.
Smart Images

Figure CN112883316B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of data processing, and more specifically, to a data processing method, apparatus, electronic device, and computer-readable storage medium. The present disclosure also relates to a data display method. Background Art
[0002] With the continuous development of mobile Internet technology, users can conveniently and quickly obtain rich and diverse information through terminal devices. As a data providing method, the feed stream enables users to focus their limited energy on the information they are interested in among a vast amount of information, bringing great convenience to users. Among them, the feed stream is the outlet of the information stream, and the feed data in the feed stream can be data such as text, images, audio, and video.
[0003] Currently, the general method for providing the feed stream is that the server first writes the feed data one by one into the inbox (i.e., the Input box) created for each user and used to store the feed data, and then the terminal device reads the feed data from the user's inbox in response to the user's query operation and displays it for the user to view.
[0004] Although the above method can provide the feed data to users, due to the increasing amount of feed data or other similar data, there are still certain deficiencies in timeliness and reliability in the above method. Therefore, how to provide such data to users reliably and efficiently has become an urgent problem to be solved. Summary of the Invention
[0005] Embodiments of the present disclosure provide a data processing method, apparatus, electronic device, and storage medium, as well as a data display method, which can provide data to users reliably and efficiently.
[0006] In a first aspect of the present disclosure, a data processing method is provided. The method includes:
[0007] Obtaining object information of a target object to be processed, and obtaining a first user identifier of a first user, where the target object is published by the first user;
[0008] Obtaining a data distribution level of a second user according to the first user identifier, where the second user is a user having a first association relationship with the first user;
[0009] When the data distribution level meets a preset distribution condition, writing the object information into a first object storage sequence corresponding to the second user.
[0010] In a second aspect of the present disclosure, a data display method is further provided, including:
[0011] Obtain the second user identifier of the second user;
[0012] Obtain the data distribution level of the second user according to the second user identifier;
[0013] When the data distribution level does not meet the preset distribution condition, obtain target object information, where the target object information includes the object information of the objects published by the first user within a preset time, and the first user is a user who has a second association relationship with the second user;
[0014] Display the target object information.
[0015] In a third aspect of the present disclosure, there is also provided a data processing device, including:
[0016] An information acquisition module, configured to acquire the object information of the target object to be processed, and acquire the first user identifier of the first user, where the target object is published by the first user;
[0017] A data distribution level acquisition module, configured to acquire the data distribution level of the second user according to the first user identifier, where the second user is a user who has a first association relationship with the first user;
[0018] An information distribution module, configured to write the object information into the first object storage sequence corresponding to the second user when the data distribution level meets the preset distribution condition.
[0019] According to a fourth aspect of the present disclosure, there is also provided an electronic device, including:
[0020] A memory, configured to store executable instructions;
[0021] A processor, configured to run the electronic device to execute the method according to the first aspect or the second aspect of the present disclosure under the control of the executable instructions.
[0022] According to a fifth aspect of the present disclosure, there is also provided a computer-readable storage medium, where the computer-readable storage medium stores a computer program that can be read and executed by a computer, and the computer program is used to execute the method according to the first aspect or the second aspect of the present disclosure when being read and run by the computer.
[0023] The beneficial effects of the present disclosure are as follows. According to the method of the embodiments of the present disclosure, after obtaining the object information of the target object to be processed, for example, the information of feed data, and the first user identifier of the first user who publishes the target object, the data distribution level of the user having a first association relationship with the first user can be obtained according to the first user identifier, and then it is determined whether to write the object information of the target object to the first object storage sequence corresponding to the second user, such as the inbox, according to whether the data distribution level meets the preset distribution condition; compared with the prior art method of distributing the target object, such as feed data, to users without any distinction and distributing all of them, this method can reduce the amount of data to be written at the same moment, so that the object information of the target object can be provided to the second user in a timely, reliable and efficient manner.
[0024] Other features and advantages of the present disclosure will become clear from the following detailed description of the exemplary embodiments of the present disclosure with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings incorporated in the specification and constituting a part of the specification illustrate embodiments of the present disclosure and, together with the description, are used to explain the principles of the present disclosure.
[0026] Figure 1 is a flowchart of the data processing method provided by the embodiments of the present disclosure.
[0027] Figure 2 is a flowchart of the data persistence processing provided by the embodiments of the present disclosure.
[0028] Figure 3 is a flowchart of a process for a server to provide data to a terminal device provided by the embodiments of the present disclosure.
[0029] Figure 4 is a flowchart of the data display method provided by the embodiments of the present disclosure.
[0030] Figure 5 is a schematic block diagram of the principle of the data processing device provided by the embodiments of the present disclosure.
[0031] Figure 6 is a schematic hardware structure diagram of an electronic device provided by the embodiments of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0032] Various exemplary embodiments of the present disclosure will now be described in detail with reference to the accompanying drawings. It should be noted that: unless otherwise specifically stated, the relative arrangements of components and steps, numerical expressions and values set forth in these embodiments do not limit the scope of the present disclosure.
[0033] The following description of at least one exemplary embodiment is merely illustrative and in no way restrictive of the present disclosure, its application, or its use.
[0034] Technologies, methods, and devices known to those of ordinary skill in the relevant art may not be discussed in detail, but where appropriate, such technologies, methods, and devices should be considered as part of the specification.
[0035] In all examples shown and discussed herein, any specific values should be construed as merely exemplary and not as limitations. Thus, other examples of the exemplary embodiments may have different values.
[0036] It should be noted that like reference numerals and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
[0037] <Method Embodiment 1>
[0038] In the process of implementing the present application, the inventors found that when providing a target object, such as feed data, to a user, generally, the data in the user's inbox, that is, the Input box, can be stored in memory. For example, the feed data can be stored in a Redis database. Since the read / write speed of memory is much faster than that of a disk, this method can solve the problem of promptly providing the target object to the user. However, since the cost of memory is much higher than that of a disk, in practice, the same feed data may be written into the inboxes of thousands of users. If all the data in the user's inbox is stored in memory, this will bring a huge cost problem. Moreover, since the data in memory is volatile, this method also has certain deficiencies in terms of reliability and stability. In this embodiment, the user's inbox, that is, the Input box, can be a sequence for storing the user's concerned content, such as the object information of the target object. The information stored therein can generally be sorted by time or can also be sorted based on the user's concerned factors. Correspondingly, in this embodiment, the user's outbox, that is, the Output box, can be a sequence for storing the user's published content, such as the object information of the target object. When other users other than this user want to view the target object published by this user, they can generally obtain it by viewing the content in the user's outbox.
[0039] To solve the above problems, an embodiment of the present disclosure provides a data processing method. Please refer to Figure 1, which is a schematic flowchart of the data processing method provided by an embodiment of the present disclosure. This method can be implemented by an electronic device, which can be a server, for example, a blade server, a rack server, etc., or can also be a server cluster deployed in the cloud, which is not specifically limited herein; of course, according to actual needs, this electronic device can also be a terminal device, for example, a smart phone, a portable computer, a desktop computer, a tablet computer, a wearable device, etc., which is not specifically limited here.
[0040] As Figure 1 shown, the method of this embodiment may include the following steps S1100 - S1300, which will be described in detail below.
[0041] Step S1100, obtain the object information of the target object to be processed, and obtain the first user identifier of the first user, where the target object is published by the first user.
[0042] The target object is an information unit, specifically, it can be data such as text, image, audio, and video. For example, it can be feed data in a feed scenario; it should be noted that in this embodiment, unless otherwise specified, the target object is taken as an example of feed data for illustration. Of course, in specific implementation, according to different application scenarios, the target object can also be other types of data, which is not specifically limited here.
[0043] The object information can be information used to describe the target object. For example, it can be information such as an object identifier and an object profile. Among them, the object identifier is used to uniquely identify the target object. For example, it can be a feedID; of course, the object information can also be the attribute information of the target object, such as the data format of the target object, the size of the target object, the publishing user of the target object, the publishing time of the target object, the update time, etc. In this embodiment, the object information of the target object at least includes the object identifier.
[0044] The first user is the user who publishes the target object; it should be noted that in this embodiment, descriptions such as "first" and "second" are used to distinguish different objects, rather than referring to a specific user. For example, the first user refers to the user who publishes the target object, and the second user can be a user who has a first association relationship with the first user. For example, in a content application, the second user can be a user who follows the first user, that is, a fan of the first user; in a social application, the first user and the second user can be friends with each other.
[0045] The first user identifier is an identifier used to uniquely identify the first user, for example, it can be a user ID.
[0046] In specific implementation, the object information of the target object and the first user identifier of the first user can be obtained from a piece of task data in the target task sequence. In this embodiment, the target task sequence can be a message queue for storing relevant information of the object to be sent. For example, it can be a message queue based on Rocketmq. Here, Rocketmq is a distributed message publishing and subscribing system. Of course, this message queue can also be implemented in other ways. For example, the target task sequence can also be a message queue based on Rabbitmq, and no special limitation is made here.
[0047] That is to say, the object information of the target object and the first user identifier can be obtained from the target task sequence. In one embodiment, the method maintains the target task sequence through the following method: obtaining the object information of the object published by the first user; writing the object information of the object and the corresponding first user identifier into the target task sequence.
[0048] Here, taking the feed data in the feed scenario as the target object as an example to illustrate the maintenance process of the target task sequence. In specific implementation, the first user, such as user01, can use the terminal device logged in with their account to publish feed data, such as feed01; in response to the publishing operation of user01, the terminal device sends a data publishing request to the server; after receiving the data publishing request, the server can first use its internal publishing module for recording user feed data to record the feed data. For example, store feed01 in the feed data table, and at the same time, send a notification message indicating that user01 has published feed01 to the feed sending module; after the sending module of the server obtains this notification message, it generates a piece of task data at least according to the first user identifier of the first user, that is, user01, and the data identifier of the feed data, that is, feed01, and writes this task data into the message queue based on Rocketmq. It should be noted that here, only the object information of the target object is included in the object information, and the task data in the target task sequence only includes the object information of the target object and the first user identifier as an example for illustration. In specific implementation, other information can of course also be included in the object information and the task data, and no special limitation is made here.
[0049] The above takes the feed data in the feed scenario as an example to illustrate how to maintain and obtain the task data in the target task sequence in this embodiment. After maintaining and obtaining the task data in the target task sequence, the server can obtain a task data from the target task sequence at a preset time interval or in the order in which the task data is added to the target task sequence, and obtain the object information of the target object to be processed, that is, to be sent down, and the first user identifier of the first user who publishes the target object from the task data. For example, the feed data "feed01" can be obtained from the target task sequence, and the user identifier "user01" of the user who publishes the feed data.
[0050] According to the above description, in this embodiment, after the first user publishes the target object, it is not necessary to send down the target object in real time to avoid increasing the concurrent data volume of the server and causing data congestion. Instead, a sending-down task for sending down the target object is generated and added to the target task sequence, so that the server can adaptively process the sending-down task according to its own performance, reduce the concurrent data volume per unit time, and process the sending-down task reliably and stably. It should be noted that the above is an implementation manner provided in this embodiment for obtaining the object information of the target object to be processed and the first user identifier. In specific implementation, of course, the target object can also be sent down through other means, which will not be elaborated here.
[0051] Step S1200, obtain the data sending-down level of the second user according to the first user identifier, where the second user is a user who has a first association relationship with the first user.
[0052] In this embodiment, the first association relationship can be a user who has a friend relationship with the first user, or it can also be a user who sets the first user as a followed user, that is, the second user can be a fan of the first user.
[0053] Specifically, after obtaining the object information of the target object to be processed, that is, to be sent down, and the first user identifier, in this embodiment, different from the prior art where no distinction is made for the second users to be sent down, but simply obtaining all the second users corresponding to the first user and sending the object information to the second users at the same time, resulting in slow speed and low efficiency, in this embodiment, for the object information to be processed, the second user identifiers of the second users who have a first association relationship with the first user can be obtained first according to the first user identifier of the first user and the preset user correspondence relationship, and the data sending-down level of the second user can be obtained according to the second user identifier.
[0054] The data distribution level characterizes the timeliness of data distribution processing for the second user. In this embodiment, the data distribution level may be user activity, that is, a value characterizing the activity level of the user using the application.
[0055] In specific implementation, after obtaining user authorization, the terminal device or the server may obtain the activity of the user at different times according to the user behavior log of the user using the application, and the specific method will not be elaborated here.
[0056] After the above processing to obtain the data distribution level of the second user, such as user activity, the object information can be specifically distributed.
[0057] Step S1300, when the data distribution level meets the preset distribution condition, write the object information into the first object storage sequence corresponding to the second user.
[0058] In one embodiment, the step of writing the object information into the object distribution sequence corresponding to the second user when the data distribution level meets the preset distribution condition includes: when the user activity is not less than the preset threshold, write the object information into the first object storage sequence.
[0059] In this embodiment, the first object storage sequence may be a sequence stored in the memory for storing the object information of the latest target object. For example, it may be an inbox for storing relevant information of feed data, that is, Inputbox. In specific implementation, in order to facilitate quick data distribution processing and quick reading of the latest data by the terminal device, the first object storage sequence may be stored in the Redis database.
[0060] Specifically, in this embodiment, for the target object to be distributed, after obtaining the user to be distributed, that is, the second user, the activity of the second user at the current moment can be obtained to determine whether the second user is active. If active, it means that the second user may be using the terminal device to browse information at present. Therefore, in order to enable the second user to see the latest information he / she is concerned about in time, when it is determined that the user activity is not less than the preset threshold, the object information can be directly written into the first object storage sequence of the second user, that is, the inbox, so that the data push module of the server can push the object information to the terminal device in time for the terminal device to display the target object for the second user to view.
[0061] That is, in this embodiment, when the method is applied to a server, after the step of writing the object information into the first object storage sequence corresponding to the second user, the method further includes: pushing the data in the first object storage sequence to a terminal device, where the terminal device includes a device logged in with the account of the second user.
[0062] In one embodiment, after step S1100, that is, after obtaining the object information of the target object and the first user identifier of the first user, in order to improve the speed of the terminal device when pulling data from the server, the method further includes: obtaining the user type of the first user according to the first user identifier; when the user type is a first preset type, writing the object information into the second object storage sequence corresponding to the first user.
[0063] In this embodiment, the user type characterizes the degree to which the information published by the user is concerned by other users. For example, the user type can be divided into core users and non-core users, where the core users can be determined according to the number of other users who follow the user, for example.
[0064] Specifically, in this embodiment, after obtaining the first user identifier, the number of second users having the above first association relationship with the first user can be obtained according to the first user identifier, and according to this number and the user level of the first user, it can be determined whether the user type of the first user is a first preset type, for example, whether it is a core user; if it is a core user, it means that the target object published by the first user may be viewed in real time by the second user or other users other than the second user; at this time, in order to facilitate the terminal device used by the second user or other users to quickly pull the target object, in this embodiment, the object information of the target object published by the first user can be written into the second object storage sequence corresponding to the first user, for example, the outbox, that is, the Output box, where the second object storage sequence can also be stored in the memory, for example, stored in the Redis database.
[0065] Specifically, after the object information of the target object to be sent is written into the first object storage sequence of the second user through the above steps S1100 - S1300, in order to improve the data reading and writing speed, the first object storage sequence is usually stored in the memory, that is, the volatile memory. Therefore, in order to reduce the high - cost problem caused by memory consumption, in this embodiment, when writing the object information of the target object into the first object storage sequence of the second user, it specifically includes: setting the expiration time of the object information according to a preset expiration duration; and setting the persistence flag indicating whether the object information has been persistently processed to the first state, where the first state indicates that the object information has not been persistently processed; and writing the object information, the expiration time, and the corresponding persistence flag into the first object storage sequence.
[0066] Correspondingly, please refer to Figure 2 , which is a schematic flow diagram of the data persistence processing provided by this disclosure. As Figure 2 shown, in this embodiment, the method further includes: Step S2100, obtaining the first object information with the persistence flag being the first state from the first object storage sequence according to a first preset time period, where the first preset time period is less than the preset expiration duration; Step S2200, merging the first object information to obtain the data to be persisted; Step S2300, writing the data to be persisted into the third object storage sequence corresponding to the second user, where the third object storage sequence is stored in the non - volatile memory; Step S2400, setting the persistence flag of the first object information in the first object storage sequence to the second state, where the first state indicates that the object information has been persistently processed.
[0067] In specific implementation, in order to balance the problem of different data reading and writing speeds between the volatile memory and the non - volatile memory, in this embodiment, when performing step S2300, the writing of the data to be persisted into the third object storage sequence corresponding to the second user includes: Step S2301, writing the data to be persisted and the second user identifier of the second user into the target persistence task sequence; Step S2302, writing the data to be persisted into the third object storage sequence according to the target persistence task sequence.
[0068] Here, the feed data in the feed scenario is still used as an example for illustration. Specifically, when the server writes the feed data into the inbox of the second user, in order to reduce costs, the expiration duration of the data can be set at the same time when the feed data is written. For example, if it is set to expire after 7 days, the server can calculate its expiration time based on the current time when writing the feed data and write the expiration time at the same time. At the same time, in order to facilitate the user to view their historical followed data, after the expired data is cleared from the inbox of the second user, the expired data can be persistently stored, that is, written into a non-volatile memory, for example, in a pika database based on disk storage.
[0069] In addition, in this embodiment, in order to balance the data read and write speed differences between the volatile memory and the non-volatile memory, that is, between the memory and the disk storage, in the specific implementation, the expired data may not be persistently stored one by one, but all the expired data is merged according to the first preset time period, for example, once an hour, and a to-be-persisted task data is generated based on the merged expired data, and the to-be-persisted task data is added to the target persistent task sequence, so that the server can adaptively perform data persistence processing according to the target persistent task sequence, thereby balancing the data read and write speed differences between the volatile memory and the non-volatile memory.
[0070] In addition, in this embodiment, the method further includes: deleting the object information whose expiration time is later than the current time from the first object storage sequence according to the second preset time period, where the second preset time period is not less than the first preset time period. It should be noted that in the specific implementation, no special restrictions are imposed on the execution timing of this step. For example, this step can be executed before, after, or at the same time as any one of the above steps S2100 - S2400.
[0071] According to the above description, it can be seen that in this embodiment, when writing the object information of the target object into the first object storage sequence of the second user, by setting the expiration time and the persistence flag of the object information, and by using the target persistent task sequence to first merge the expired data into the to-be-persisted data and then perform data persistence processing, the contradiction between the fast and slow memories can be cleverly solved, which can not only reduce the storage cost but also enable the server to provide highly available and reliable services.
[0072] In one embodiment, when a second user browses information using a terminal device logged in with their account, the terminal device can obtain the second user identifier of the second user, and based on the second user identifier, determine the data distribution level of the second user. If the data distribution level meets the preset conditions, then according to the above description, the server will automatically push the latest information to the terminal device for the terminal device to display the information. However, when the data distribution level of the user does not meet the preset conditions, the terminal device needs to actively obtain the latest information. Therefore, this embodiment also provides a data display method applied to a terminal device, and the method includes: obtaining the second user identifier of the second user; obtaining the data distribution level of the second user according to the second user identifier; when the data distribution level does not meet the preset distribution conditions, obtaining target object information, where the target object information includes object information of objects published by a first user within a preset time, and the first user is a user having a second association relationship with the second user; and displaying the target object information.
[0073] In this embodiment, the obtaining the target object information includes: sending a data acquisition request to the server according to the second user identifier, where the data acquisition request is used to acquire the target object information; receiving a data response message returned by the server corresponding to the data acquisition request; and obtaining the target object information according to the data response message.
[0074] Please refer to Figure 3 , which is a schematic flowchart of a process for a server to provide data to a terminal device provided by an embodiment of the present disclosure. As Figure 3 shown, in this embodiment, after the server obtains the data acquisition request sent by the terminal device, the data processing method applied to the server further includes: step S3100, receiving the data acquisition request sent by the terminal device, where the terminal device includes a device logged in with the account of the second user, and the data acquisition request is used to acquire second object information of objects published by the first user within a preset time; S3200, in response to the data acquisition request, writing the second object information into the first object storage sequence; and S3300, generating a data response message according to the second object information; S3400, returning the data response message to the terminal device.
[0075] In specific implementation, the generating the data response message according to the second object information includes: S3301, when the user type of the first user is a first preset type, obtaining third object information of objects stored in the second storage sequence of the first user; S3302, generating the data response message according to the second object information and the third object information.
[0076] Among them, generating the data response message according to the second object information and the third object information includes: performing duplicate removal processing on the second object information and the third object information to obtain first information to be returned; arranging the data in the first information to be returned in reverse chronological order to obtain second information to be returned; and obtaining the data response message according to the second information to be returned.
[0077] Specifically, when the second user uses the terminal device to query information, the terminal device can respond to the operation of the second user, or alternatively, the terminal device can determine whether the data distribution level of the second user at this moment meets the preset data distribution condition according to a preset time period. If it does not meet the condition, the terminal device will send a data acquisition request to the server to obtain the object information of the latest target object to display the target object to the user for viewing; in response to the data acquisition request sent by the terminal device, the server can write the first object information of the target object newly released by the first user followed by the second user into the first object storage sequence of the second user, that is, the inbox one by one. However, since it takes time to write the data one by one, especially when the amount of data is large, this process may even take dozens of minutes or longer. Therefore, in order to quickly provide the object information of the target object newly released by the first user to the terminal device, in this embodiment, since during the above-mentioned process of performing data writing processing, according to the user type of the first user, the object information of the target object released by the first user whose user type is the first preset type, that is, the core user, is also written into its second object storage sequence, that is, the outbox at the same time. Therefore, at this time, the server can directly obtain the second object information of the latest target object released by the first user from the second object storage sequence of the first user, and after performing duplicate removal processing on the first object information and the second object information, quickly return the object information of the target object to the terminal device in the form of reverse chronological order.
[0078] In summary, for the data processing method provided in this embodiment, after obtaining the object information of the target object to be processed, for example, the information of feed data, and the first user identifier of the first user who publishes the target object, the data distribution level of the user having a first association relationship with the first user can be obtained according to the first user identifier, and then according to whether the data distribution level meets the preset distribution condition, it is determined whether to write the object information of the target object into the first object storage sequence corresponding to the second user, for example, the inbox; compared with the prior art method of not making any distinction between users but distributing all target objects, for example, feed data, to users, this method can reduce the amount of data to be written at the same moment, and thus enable the object information of the target object to be provided to the second user in a timely, reliable and efficient manner.
[0079] <Second Method Embodiment>
[0080] Corresponding to the above Method Embodiment 1, this embodiment also provides a data display method, which can be applied to a terminal device, such as a smart phone, a portable computer, a desktop computer, a tablet computer, a wearable device, etc., without special limitation here.
[0081] Please refer to Figure 4 , which is a schematic flowchart of the data display method provided by the embodiments of the present disclosure. As Figure 4 shown, the method includes the following steps S4100 - S4400, which are described in detail below.
[0082] Step S4100: Obtain the second user identifier of the second user.
[0083] Step S4200: Obtain the data distribution level of the second user according to the second user identifier.
[0084] Step S4300: When the data distribution level does not meet the preset distribution condition, obtain target object information, where the target object information includes the object information of the objects published by the first user within a preset time, and the first user is a user having a second association relationship with the second user.
[0085] In one embodiment, the obtaining of the target object information includes: sending a data acquisition request to the server according to the second user identifier, where the data acquisition request is used to acquire the target object information; receiving a data response message returned by the server corresponding to the data acquisition request; and obtaining the target object information according to the data response message.
[0086] Step S4400: Display the target object information.
[0087] <Device Embodiment>
[0088] Corresponding to the above embodiment, in this embodiment, a data processing device is further provided. As Figure 5 shown, the device 5000 may include an information acquisition module 5100, a data distribution level acquisition module 5200, and an information distribution module 5300.
[0089] The information acquisition module 5100 is configured to acquire object information of a target object to be processed, and acquire a first user identifier of a first user, where the target object is published by the first user; the data distribution level acquisition module 5200 is configured to acquire a data distribution level of a second user according to the first user identifier, where the second user is a user having a first association relationship with the first user; the information distribution module 5300 is configured to write the object information into a first object storage sequence corresponding to the second user when the data distribution level meets a preset distribution condition.
[0090] <Device Embodiment>
[0091] In this embodiment, an electronic device is further provided, as Figure 6 shown. The electronic device 6000 may further include a processor 6200 and a memory 6100. The memory 6100 is configured to store executable instructions; the processor 6200 is configured to operate the electronic device according to the instructions to execute the index management method according to any embodiment of the present disclosure.
[0092] The electronic device 6000 may be a server or other types of devices, such as a terminal device, etc., which is not limited herein.
[0093] <Medium Embodiment>
[0094] Corresponding to the above method embodiment, in this embodiment, a computer-readable storage medium is further provided. The computer-readable storage medium stores a computer program that can be read and run by a computer. The computer program is configured to execute the method according to any of the above embodiments of the present disclosure when being read and run by the computer.
[0095] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a segment of a program, or a portion of an instruction, which contains one or more executable instructions for implementing a specified logical function. In some alternative implementations, the functions noted in the blocks may occur in an order different from that noted in the accompanying drawings. For example, two consecutive blocks may in fact be executed substantially in parallel, or they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented by a dedicated hardware-based system that performs the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions. As is well known to those skilled in the art, implementation by hardware, implementation by software, and implementation by a combination of software and hardware are equivalent.
[0096] The embodiments of the present disclosure have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of the terms used herein is intended to best explain the principles of the embodiments, the practical application, or the improvement of technologies in the market, or to enable other ordinary skilled persons in the art to understand the embodiments disclosed herein. The scope of the present disclosure is defined by the appended claims.
Claims
1. A data processing method, characterized in that, it includes: obtaining object information of a target object to be processed, and obtaining a first user identifier of a first user, wherein the target object is published by the first user; obtaining a data distribution level of a second user according to the first user identifier, wherein the second user is a user having a first association relationship with the first user; when the data distribution level meets a preset distribution condition, writing the object information into a first object storage sequence corresponding to the second user, wherein, after obtaining the object information and the first user identifier, the method further includes: obtaining a user type of the first user according to the first user identifier; when the user type is a first preset type, writing the object information into a second object storage sequence corresponding to the first user, the second object storage sequence being an outbox of the first user, and the object information can be pulled from the second object storage sequence.
2. The method according to claim 1, characterized in that, the object information and the first user identifier are obtained from a target task sequence, and the method maintains the target task sequence through the following method; obtaining object information of an object published by the first user; correspondingly writing the object information of the object and the first user identifier into the target task sequence.
3. The method according to claim 1, characterized in that, the data distribution level includes user activity; the step of writing the object information into an object distribution sequence corresponding to the second user when the data distribution level meets a preset distribution condition includes: when the user activity is not less than a preset threshold, writing the object information into the first object storage sequence.
4. The method according to claim 1, characterized in that, the method is applied to a server, and after the step of writing the object information into the first object storage sequence corresponding to the second user, the method further includes: pushing the data in the first object storage sequence to a terminal device, wherein the terminal device includes a device logged in with an account of the second user.
5. The method according to claim 1, characterized in that, the step of writing the object information into the first object storage sequence corresponding to the second user includes: setting an expiration time of the object information according to a preset expiration duration; and, setting a persistence flag indicating whether the object information has been persistently processed to a first state, wherein the first state indicates that the object information has not been persistently processed; correspondingly writing the object information, the expiration time and the persistence flag into the first object storage sequence.
6. The method according to claim 5, characterized in that, the first object storage sequence is stored in a volatile memory; the method further includes: Obtain first object information with a persistence identifier of the first state from the first object storage sequence according to a first preset time period, where the first preset time period is less than the preset expiration duration; Merge the first object information to obtain data to be persisted; Write the data to be persisted into a third object storage sequence corresponding to the second user, where the third object storage sequence is stored in a non-volatile memory; Set the persistence identifier of the first object information in the first object storage sequence to a second state, where the first state indicates that the object information has been persistently processed.
7. The method according to claim 6, wherein, The writing the data to be persisted into a third object storage sequence corresponding to the second user includes: Write the data to be persisted and the second user identifier of the second user into a target persistence task sequence correspondingly; Write the data to be persisted into the third object storage sequence according to the target persistence task sequence.
8. The method according to claim 6, wherein, The method further includes: Delete object information with an expiration time later than the current time from the first object storage sequence according to a second preset time period, where the second preset time period is not less than the first preset time period.
9. The method according to claim 1, wherein, The method is applied to a server. When the data distribution level does not meet the preset distribution condition, the method further includes: Receive a data acquisition request sent by a terminal device, where the terminal device includes a device logged in with an account of the second user, and the data acquisition request is used to acquire second object information of an object published by the first user within a preset time; In response to the data acquisition request, write the second object information into the first object storage sequence; and, Generate a data response message according to the second object information; Return the data response message to the terminal device.
10. The method according to claim 9, wherein, The generating a data response message according to the second object information includes: When the user type of the first user is a first preset type, acquire third object information of an object stored in a second object storage sequence of the first user; Generate the data response message according to the second object information and the third object information.
11. The method according to claim 10, wherein, The generating the data response message according to the second object information and the third object information includes: Perform deduplication processing on the second object information and the third object information to obtain first information to be returned; Arrange the data in the first information to be returned in reverse chronological order to obtain second information to be returned; Obtain the data response message according to the second information to be returned.
12. The method according to claim 1, wherein, The target object includes feed data, and the object information includes an identifier of the feed data.
13. A data display method, characterized in that, applied to a terminal device, comprising: obtaining a second user identifier of a second user; obtaining a data distribution level of the second user according to the second user identifier; when the data distribution level does not meet a preset distribution condition, obtaining target object information, where the target object information includes object information of an object published by a first user within a preset time, the first user being a user having a second association relationship with the second user, and when the user type of the first user is a first preset type, the obtaining of the target object information includes pulling the object information from a second object storage sequence of the first user, and the second object storage sequence is the outbox of the first user; displaying the target object information.
14. The method according to claim 13, characterized in that, the obtaining of the target object information includes: sending a data acquisition request to a server according to the second user identifier, where the data acquisition request is used to acquire the target object information; receiving a data response message returned by the server and corresponding to the data acquisition request; obtaining the target object information according to the data response message.
15. A data processing device, characterized in that, comprising: an information acquisition module, configured to acquire object information of a target object to be processed, and acquire a first user identifier of a first user, where the target object is published by the first user; a data distribution level acquisition module, configured to acquire a data distribution level of a second user according to the first user identifier, where the second user is a user having a first association relationship with the first user; an information distribution module, configured to write the object information into a first object storage sequence corresponding to the second user when the data distribution level meets a preset distribution condition; a module configured to acquire the user type of the first user according to the first user identifier, and write the object information into a second object storage sequence corresponding to the first user when the user type is a first preset type, the second object storage sequence being the outbox of the first user, and the object information can be pulled from the second object storage sequence.
16. An electronic device, characterized in that, comprising: a memory, configured to store executable instructions; a processor, configured to control the operation of the electronic device to execute the method according to any one of claims 1-14 according to the instructions.
17. A computer-readable storage medium, characterized in that, the computer-readable storage medium stores a computer program that can be read and executed by a computer, and the computer program is used to execute the method according to any one of claims 1-14 when being read and run by the computer.
Citation Information
Patent Citations
Message data processing method and device, equipment and storage medium
CN112380266A