Data processing method and device
By prioritizing the acquisition of the attribute value of the target object from the local cache and obtaining it from the application when necessary, the problem of low response efficiency on the server is solved, and more efficient data processing and push condition judgment is achieved.
Patent Information
- Application Number
- CN202311057341.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-21
- Publication Date
- 2025-02-21
AI Technical Summary
The current server returns responses to the application platform with low efficiency, and it is necessary to improve data processing efficiency to meet the needs of push conditions judgment.
By preferentially obtaining the target attribute value of the target object from the local cache, if it does not exist in the local cache, the attribute value is obtained from the application, thereby improving the efficiency of obtaining the attribute value and returning the target response of the application platform in a timely manner.
It effectively improves the efficiency of returning target responses to the application platform, reduces the phenomenon of repeatedly reading the same attribute values from the application, and improves the overall efficiency of data processing.
Smart Images

Figure CN119496819A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method and device. Background Art
[0002] With the development of information technology, information can be pushed through applications. Specifically, a push condition can be set for the information to be pushed, and the information to be pushed can be pushed to the object that meets the push condition. At present, the application platform can send an information push query request to the server to query the information to be pushed that can be pushed to the object. Correspondingly, the server can return a corresponding response to the application platform to indicate the information to be pushed that can be pushed to the object.
[0003] The efficiency of the current server returning responses to the application platform needs to be improved. Therefore, a solution is urgently needed to solve the above problems. Summary of the invention
[0004] In order to solve or at least partially solve the above technical problems, an embodiment of the present application provides a data processing method and device.
[0005] In a first aspect, an embodiment of the present application provides a data processing method, the method comprising:
[0006] Receiving a target request sent by an application platform, wherein the target request is used to request to determine content that can be pushed to a target object;
[0007] Determine whether the target object meets the push condition corresponding to the content to be pushed; wherein: when determining whether the target object meets the push condition, preferentially obtain the target attribute value of the target object used to determine whether the target object meets the corresponding push condition from the local cache, and if the target attribute value does not exist in the local cache, obtain the target attribute value from the application;
[0008] A target response for the target request is returned to the application platform, where the target response indicates the content that can be pushed to the target object.
[0009] Optionally, receiving the target request sent by the application platform includes:
[0010] Receive concurrent requests sent by the application platform, wherein the concurrent requests include the target request; accordingly, the local cache includes: a first cache, wherein the first cache is used to cache attribute values obtained based on the concurrent requests, and the attribute values cached in the first cache become invalid after a response to each of the concurrent requests is returned to the application platform.
[0011] Optionally, the method further includes:
[0012] If the target attribute value does not exist in the local cache, the target attribute value obtained from the application is written into the first cache.
[0013] Optionally, the local cache also includes a second cache, which is used to cache attribute values obtained based on the concurrent request or the historical request, and the validity period of the attribute values cached in the second cache is greater than the validity period of the attribute values cached in the first cache.
[0014] Optionally, the step of preferentially obtaining from the local cache a target attribute value of the target object for determining whether the target object satisfies a corresponding push condition includes:
[0015] First, the target attribute value is obtained from the first cache. If the first cache does not include the target attribute value, the target attribute value is obtained from the second cache.
[0016] Optionally, the method further includes:
[0017] If neither the first cache nor the second cache includes the target attribute value, the target attribute value obtained from the application is written into the first cache or the second cache.
[0018] Optionally, writing the target attribute value obtained from the application into the first cache or the second cache includes:
[0019] In response to acquiring the preset life cycle of the target attribute value, writing the target attribute value and the life cycle corresponding to the target attribute value into the second cache;
[0020] or,
[0021] In response to not obtaining the life cycle of the target attribute value, writing the target attribute value into the first cache.
[0022] In a second aspect, an embodiment of the present application provides a data processing device, the device comprising:
[0023] A receiving unit, configured to receive a target request sent by an application platform, wherein the target request is used to request to determine content that can be pushed to a target object;
[0024] a determination unit, configured to determine whether the target object satisfies a push condition corresponding to the content to be pushed; wherein: when determining whether the target object satisfies the push condition, a target attribute value of the target object used to determine whether the target object satisfies the corresponding push condition is preferentially obtained from a local cache; if the target attribute value does not exist in the local cache, the target attribute value is obtained from an application;
[0025] The sending unit is used to return a target response to the target request to the application platform, where the target response indicates the content that can be pushed to the target object.
[0026] Optionally, the receiving unit is used to:
[0027] Receive concurrent requests sent by the application platform, wherein the concurrent requests include the target request; accordingly, the local cache includes: a first cache, wherein the first cache is used to cache attribute values obtained based on the concurrent requests, and the attribute values cached in the first cache become invalid after a response to each of the concurrent requests is returned to the application platform.
[0028] Optionally, the device further comprises:
[0029] The first writing unit is configured to write the target attribute value obtained from the application into the first cache if the target attribute value does not exist in the local cache.
[0030] Optionally, the local cache also includes a second cache, which is used to cache attribute values obtained based on the concurrent request or the historical request, and the validity period of the attribute values cached in the second cache is greater than the validity period of the attribute values cached in the first cache.
[0031] Optionally, the step of preferentially obtaining from the local cache a target attribute value of the target object for determining whether the target object satisfies a corresponding push condition includes:
[0032] First, the target attribute value is obtained from the first cache. If the first cache does not include the target attribute value, the target attribute value is obtained from the second cache.
[0033] Optionally, the device further comprises:
[0034] The second writing unit is configured to write the target attribute value obtained from the application into the first cache or the second cache if the target attribute value is not included in the first cache or the second cache.
[0035] Optionally, the second writing unit is used to:
[0036] In response to acquiring the preset life cycle of the target attribute value, writing the target attribute value and the life cycle corresponding to the target attribute value into the second cache;
[0037] or,
[0038] In response to not obtaining the life cycle of the target attribute value, writing the target attribute value into the first cache.
[0039] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising a processor and a memory;
[0040] The processor is used to execute instructions stored in the memory so that the electronic device executes the method described in any one of the first aspects above.
[0041] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, comprising instructions, wherein the instructions instruct a device to execute any of the methods described in the first aspect above.
[0042] In a fifth aspect, an embodiment of the present application provides a computer program product, which, when executed on a computer, enables the computer to execute any of the methods described in the first aspect above.
[0043] Compared with the prior art, the embodiments of the present application have the following advantages:
[0044] An embodiment of the present application provides a data processing method, which includes: receiving a target request sent by an application platform, wherein the target request is used to request to determine the content that can be pushed to a target object. Determine whether the target object satisfies the push conditions corresponding to the content to be pushed. After determining the content that can be pushed to the target object, further return a target response to the target request to the application platform, wherein the target response indicates the content that can be pushed to the target object. Wherein: when determining whether the target object satisfies the push conditions, the target attribute value of the target object used to determine whether the target object satisfies the corresponding push conditions is preferentially obtained from the local cache to improve the efficiency of obtaining the target attribute value, and accordingly, improve the efficiency of returning the target response to the application platform. If the target attribute value does not exist in the local cache, the target attribute value is obtained from the application. It can be seen that by using this solution, the efficiency of returning the target response to the application platform can be effectively improved. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0047] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application;
[0048] Figure 3 A flowchart of another data processing method provided in an embodiment of the present application;
[0049] Figure 4 A schematic diagram of the structure of a data processing device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0050] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0051] The inventor of this application has found through research that currently, the application platform can send an information push query request to the server to query the information to be pushed that can be pushed to the object. Correspondingly, the server can return a corresponding response to the application platform to indicate the information to be pushed that can be pushed to the object. Figure 1 To understand. Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application.
[0052] like Figure 1 As shown, the client can send a query message to the application platform to query the push content that the client can display. Correspondingly, the application platform can send a request to the server to request the server to determine the content to be pushed that can be pushed to the client. The request may include, for example, information about the client. For example, if the client is displaying a live broadcast room page, the request may include an anchor identifier (ID). The server can further determine which push conditions corresponding to the content to be pushed can be satisfied by the aforementioned client. Furthermore, the server can return to the application platform the identification information of the content to be pushed that the client satisfies, so that the application platform can push the corresponding content to the client based on the identification information. Among them, the identification information of the content to be pushed can be a unique identifier of the content to be pushed, or it can be an identifier of the push condition corresponding to the content to be pushed.
[0053] In one example, the server may pre-store push conditions corresponding to the currently recommended online content to be pushed. When the server determines the content that can be pushed to the client, it may obtain the attribute value of the attribute involved in the push condition from the application, and further determine which push conditions corresponding to the content to be pushed that the client can meet based on the attribute value, thereby determining the content that can be pushed to the client. Example:
[0054] The push conditions for content 1 to be pushed are: the anchor type is a gold anchor, and the anchor's fans exceed 1000. The server can obtain the anchor type and anchor's fans corresponding to the anchor on the live broadcast room page displayed by the client from the application, and further determine whether the push conditions for content 1 to be pushed are met.
[0055] The push conditions for content 2 to be pushed are: the anchor type is a common anchor, and the number of anchor fans exceeds 10,000. The server can obtain the anchor type and anchor fan number corresponding to the anchor on the live broadcast room page displayed by the client from the application, and further determine whether the push conditions for content 2 to be pushed are met.
[0056] By analogy, the server needs to perform the above operations for each content to be pushed.
[0057] On the one hand, when there are a lot of online recommended content to be pushed, the server needs to frequently obtain the corresponding attribute values (such as the aforementioned anchor type and number of fans) from the application to determine whether the push conditions are met. On the other hand, there are many clients that send query messages to the application platform at the same time. Accordingly, the application platform must determine which push conditions of the content to be pushed can be met for each client. This will cause the application to receive a large number of data read requests in a short period of time. When the performance of the application is not sufficient to process the aforementioned large number of data read requests in a timely manner, the server cannot obtain the corresponding attribute values in time, and thus cannot determine whether the push conditions are met in time. Accordingly, the server cannot promptly feedback the response message to the application platform.
[0058] In order to solve the above problem, the inventor of the present application found that when determining which push conditions of the to-be-pushed content are satisfied by the query messages of each client, there is a problem of repeatedly reading the same attribute value from the application.
[0059] Example 1: Assuming that both Client 1 and Client 2 are viewer clients, and the pages displayed by Client 1 and Client 2 are both the live broadcast room pages of anchor A, when determining whether the aforementioned "push conditions corresponding to content 1 to be pushed" are met for Client 1 and Client 2 respectively, the two attribute values of anchor A's anchor type and number of fans will be repeatedly read from the application.
[0060] Example 2: When determining whether the aforementioned "push conditions corresponding to content 1 to be pushed" and "push conditions corresponding to content 2 to be pushed" are met for client 1, the two attribute values of anchor type and number of fans are repeatedly read from the application.
[0061] In view of this, an embodiment of the present application provides a data processing method, which can store the attribute values obtained from the application in a local cache. When judging whether the push conditions are met, the corresponding attribute values are read from the local cache first, rather than directly reading the corresponding attribute values from the application, thereby improving the efficiency of obtaining the corresponding attribute values, and correspondingly improving the efficiency of returning responses to the application platform.
[0062] It should be noted that the server mentioned in the embodiment of the present application may be a server that performs push condition judgment. Of course, the server may also integrate other functions, which are not specifically limited in the embodiment of the present application.
[0063] The embodiments of the present application do not specifically limit the application, and the applications corresponding to different attribute values may be different. For example, the aforementioned application for obtaining the anchor type and the application for obtaining the number of fans may be different applications. In addition, in one example, the application mentioned in the embodiments of the present application may be a downstream application, wherein the downstream application may be understood as an application in the back end of the data processing flow that receives, processes, uses or displays data from the upstream.
[0064] Various non-limiting implementations of the present application are described in detail below in conjunction with the accompanying drawings.
[0065] Exemplary Methods
[0066] See also Figure 2 , which is a flow chart of a data processing method provided in an embodiment of the present application. In this embodiment, the method can be applied to a server, for example.
[0067] In a specific example, the method may include the following steps: S101-S103.
[0068] S101: receiving a target request sent by an application platform, wherein the target request is used to request to determine content that can be pushed to a target object.
[0069] In an embodiment of the present application, the target request may be sent to the server after the application platform receives a query message sent by the first client. The query message is used to query which content to be pushed can be displayed by the first client. The embodiment of the present application does not specifically limit the content to be pushed. The content to be pushed may be, for example, a virtual resource, such as a virtual widget displayed on a live broadcast room page. The content to be pushed may also be an interactive entrance to a related function. The content to be pushed may also be an advertisement, etc., which are not listed one by one here.
[0070] The target object mentioned in the embodiment of the present application may be an object related to the first client, for example, the target object may be a page displayed by the first client, for example, a page currently displayed by the first client. The page includes but is not limited to a live broadcast room page, a short video playback page, and the like.
[0071] In one example, the server may receive a concurrent request sent by an application platform, and the concurrent request includes multiple requests. For example, the server receives a query message sent by a large number of clients, and further generates multiple requests based on the query message and sends them to the server. The concurrent request includes the target request, for example, the concurrent request may include a target request corresponding to each of the large number of clients, and the first client may be one of the large number of clients.
[0072] The processing flow of the target request corresponding to each client by the server is similar. In the embodiment of the present application, the processing flow of the target request corresponding to the first client by the client is taken as an example for explanation.
[0073] S102: Determine whether the target object satisfies the push condition corresponding to the content to be pushed, wherein: when determining whether the target object satisfies the push condition, preferentially obtain the target attribute value of the target object used to determine whether the target object satisfies the corresponding push condition from the local cache; if the target attribute value does not exist in the local cache, obtain the target attribute value from the application.
[0074] In one example, the server may pre-store at least one push condition corresponding to the content to be pushed, wherein for each content to be pushed, the corresponding push condition may include one or more conditions. In a specific example, the server may store the corresponding relationship between the push condition identifier corresponding to the content to be pushed and the push condition corresponding to the content to be pushed. In another example, the server may store the corresponding relationship between the identifier of the content to be pushed and the push condition corresponding to the content to be pushed.
[0075] In the embodiment of the present application, the server can determine whether the target object satisfies the push conditions corresponding to each content to be pushed in the at least one content to be pushed, thereby determining the content that can be pushed to the target object. For a certain content to be pushed, if the target object satisfies the push conditions corresponding to the content to be pushed, the content to be pushed can be pushed to the target object; if the target object does not satisfy the push conditions corresponding to the content to be pushed, the content to be pushed cannot be pushed to the target object.
[0076] In the embodiment of the present application, in order to improve the efficiency of determining the content that can be pushed to the target object, when determining whether the target object meets the push condition, the target attribute value of the target object used to determine whether the target object meets the corresponding push condition is not directly obtained from the application, but the target attribute value is preferentially obtained from the local cache. Reading the target attribute value from the local cache is more efficient than obtaining the target attribute value from the application.
[0077] If the target attribute value does not exist in the local cache, in order to determine whether the target object meets the push condition corresponding to the content to be pushed, the target attribute value is obtained from the application. For example, a data read request including the identifier of the target object and the target attribute can be sent to the application to request the application to return the target attribute value.
[0078] In one example, when sending a data read request to an application, go-native singleFlight can be applied to avoid sending multiple data read requests for target attributes of a target object to the application.
[0079] In another example, when sending a data read request to an application, the application's current limiting strategy can also be combined. When the current limiting strategy indicates that a data read request can be sent to the application, the data read request is sent to the application. Otherwise, the data read request cannot be sent to the application, so as to reduce the data request processing pressure of the application.
[0080] In one example, the target attribute value may be the value of the target attribute, and the target attribute may be an attribute corresponding to the first client. As an example, the target attribute may be an attribute of a page displayed by the first client, for example, the anchor type of the anchor on the live broadcast room page displayed by the first client. For another example, it may be the number of fans of the anchor on the anchor room page displayed by the first client, and so on.
[0081] In the embodiment of the present application, the target attribute may be any one of the one or more attributes mentioned in the push condition. For example, if the push condition is: the anchor type is a common anchor, and the anchor has more than 10,000 fans, then the target attribute may include the live broadcast type or the anchor's fans. The way in which the server obtains the attribute value of each attribute in the push condition is the same, and the present application takes the target attribute as an example for explanation.
[0082] In one example, the local cache may include a first cache, the first cache being used to cache the attribute value obtained from the concurrent request, and the validity period of the attribute value cached in the first cache being consistent with the life cycle of the concurrent request.
[0083] The life cycle of the concurrent request can be understood as the time period from when the server receives the concurrent request to when the server returns a response to each of the concurrent requests to the application platform. In other words, the attribute value cached in the first cache becomes invalid after the server returns a response to each of the concurrent requests to the application platform. In one example, the server can clear the first cache after the application platform returns a response to each of the concurrent requests.
[0084] If the value of the target attribute is obtained directly from the application, since the value of the target attribute may change dynamically, the value of the target attribute obtained at different times may be different. For example, assume that the server first determines whether the target object meets the push condition "the anchor type is a gold anchor, and the number of anchor fans exceeds 1000" corresponding to the content to be pushed 1, and then determines the push condition "the anchor type is an ordinary anchor, and the number of anchor fans exceeds 10000" corresponding to the content to be pushed 2. When judging the push condition corresponding to the content to be pushed 1, the number of anchor fans obtained from the application is A, and when judging the push condition corresponding to the content to be pushed 2, the number of anchor fans obtained from the application is B. In the embodiment of the present application, the target attribute value is obtained from the first cache first, which can not only improve the efficiency of obtaining the target attribute value, but also make the value of the target attribute obtained consistent during the life cycle of the concurrent request. That is, the values of the target attributes obtained are all the target attribute values, so that during the life cycle of the concurrent request, for the same attribute, the same attribute value is used to determine whether the target object meets the push condition corresponding to the content to be pushed.
[0085] In one example, if the target attribute value does not exist in the first cache, the server can write the target attribute value obtained from the application into the first cache, so that when the server needs to read the value of the target attribute corresponding to the target object again within the life cycle of the aforementioned concurrent request, it can preferentially read the target attribute value from the first cache, thereby improving the efficiency of reading the target attribute value.
[0086] In one example, the local cache may include a second cache in addition to the first cache. The second cache is used to cache the attribute values obtained based on the concurrent request or the historical request, and the validity period of the attribute values cached in the second cache is greater than the validity period of the attribute values cached in the first cache. That is, the first cache is used to cache the attribute values that are valid within the life cycle of the current concurrent request, and the second cache is used to cache the attribute values with a longer validity period. For example, the second cache can be used to cache the values of attributes that are not updated in real time, such as the gender of the anchor, and the region to which the anchor belongs, etc. Correspondingly, for this case, the target attribute value is preferentially obtained from the local cache. In the specific implementation, for example, the target attribute value can be preferentially obtained from the first cache and the second cache. In addition, considering that the possibility of reading the target attribute value in the first cache is higher, because the life cycle of the first cache is consistent with the life cycle of the current concurrent request, therefore, in a specific example, the target attribute value can be first obtained from the first cache, and if the target attribute value is not included in the first cache, the target attribute value is obtained from the second cache to further improve the efficiency of obtaining the target attribute value.
[0087] In one example, if the target attribute value is not included in the first cache and the second cache, the target attribute value obtained from the application can be written to the first cache or the second cache, so that when the server needs to read the value of the target attribute corresponding to the target object again, it can preferentially read the target attribute value from the first cache or the second cache, thereby improving the efficiency of reading the target attribute value.
[0088] In one example, if the target attribute is pre-set with a life cycle, the target attribute value and the life cycle corresponding to the target attribute value may be written into the second cache. The life cycle corresponding to the target attribute value is the life cycle pre-set for the target attribute. In another example, if the target attribute is not pre-set with a life cycle, the target attribute value may be written into the first cache.
[0089] In a specific example, if the target attribute is pre-set with a life cycle, the aforementioned push condition saved by the server may include the pre-set life cycle of the target attribute. In other words, the server can read the push condition, and if the push condition includes the pre-set life cycle of the target attribute, it means that the target attribute has a pre-set life cycle, and the server can write the target attribute value and the life cycle corresponding to the target attribute value into the second cache. If the push condition does not include the life cycle of the target attribute, it means that the target attribute has not been set with a life cycle, and the server can write the target attribute value into the first cache.
[0090] S103: Return a target response to the target request to the application platform, where the target response indicates the content that can be pushed to the target object.
[0091] After the server determines the content that can be pushed to the target object, it can send the content that can be pushed to the target object, so that the application platform can determine the content that can be pushed to the target object.
[0092] In one example, the target response may include an identifier of the content to be pushed that can be pushed to the target object, so that the application platform determines the content to be pushed that can be pushed to the target object based on the identifier of the content to be pushed that can be pushed to the target object.
[0093] In another example, the target response may include an identifier of a push condition corresponding to the content to be pushed that can be pushed to the target object. In this case, the application platform may, for example, store a target correspondence between the identifier of the push condition and the content to be pushed that satisfies the push condition. In this way, the application platform can determine the content to be pushed that can be pushed to the target object based on the identifier of the push condition corresponding to the content to be pushed that can be pushed to the target object and the aforementioned target correspondence.
[0094] From the above description, it can be seen that by utilizing the solution of the embodiment of the present application, when determining whether the target object satisfies the push condition, the target attribute value of the target object used to determine whether the target object satisfies the corresponding push condition is preferentially obtained from the local cache, so as to improve the efficiency of obtaining the target attribute value, and accordingly, improve the efficiency of returning the target response to the application platform.
[0095] Next, in conjunction with the accompanying drawings, a flow chart of another data processing method according to an embodiment of the present application is introduced. Figure 3 , which is a flow chart of another data processing method provided in an embodiment of the present application. Figure 3The data processing method shown may include the following S301-S307.
[0096] S301: receiving a concurrent request sent by an application platform, wherein the concurrent request includes a target request, and the target request is used to request to determine content that can be pushed to a target object.
[0097] S302: Read the value of the target attribute from the first cache.
[0098] If the target attribute value of the target attribute is obtained, S306 is executed; if the target attribute value of the target attribute is not obtained, S303 is executed.
[0099] S303: Read the value of the target attribute from the second cache.
[0100] If the target attribute value of the target attribute is obtained, S306 is executed; if the target attribute value of the target attribute is not obtained, S304 is executed.
[0101] S304: Obtain a current limiting policy corresponding to the application, and determine that the current limiting policy indicates that a data read request can be sent to the application at present.
[0102] S305: Send a data read request to the application to obtain a target attribute value of the target attribute, and write the target attribute value into the first cache or the second cache.
[0103] S306: Determine, according to the target attribute value, whether the target object satisfies a push condition corresponding to the content to be pushed.
[0104] S307: Return a target response to the target request to the application platform, where the target response indicates the content that can be pushed to the target object.
[0105] Regarding the specific implementation of S301 - S307 , reference may be made to the relevant description of the above embodiments, and no repeated description will be made here.
[0106] Exemplary Devices
[0107] Based on the method provided in the above embodiment, the embodiment of the present application further provides a device, which is described below in conjunction with the accompanying drawings.
[0108] See also Figure 4 , which is a structural schematic diagram of a data processing device provided in an embodiment of the present application. Figure 4 The data processing device 400 shown can be used to execute the data processing method provided by the above method embodiment.
[0109] In an example, the data processing device 400 includes: a receiving unit 401 , a determining unit 402 , and a sending unit 403 .
[0110] A receiving unit 401 is used to receive a target request sent by an application platform, wherein the target request is used to request to determine the content that can be pushed to the target object;
[0111] The determination unit 402 is used to determine whether the target object meets the push condition corresponding to the content to be pushed; wherein: when determining whether the target object meets the push condition, the target attribute value of the target object used to determine whether the target object meets the corresponding push condition is obtained from the local cache first; if the target attribute value does not exist in the local cache, the target attribute value is obtained from the application;
[0112] The sending unit 403 is configured to return a target response to the target request to the application platform, where the target response indicates the content that can be pushed to the target object.
[0113] Optionally, the receiving unit 401 is configured to:
[0114] Receive concurrent requests sent by the application platform, wherein the concurrent requests include the target request; accordingly, the local cache includes: a first cache, wherein the first cache is used to cache attribute values obtained based on the concurrent requests, and the attribute values cached in the first cache become invalid after a response to each of the concurrent requests is returned to the application platform.
[0115] Optionally, the device further comprises:
[0116] The first writing unit is configured to write the target attribute value obtained from the application into the first cache if the target attribute value does not exist in the local cache.
[0117] Optionally, the local cache also includes a second cache, which is used to cache attribute values obtained based on the concurrent request or the historical request, and the validity period of the attribute values cached in the second cache is greater than the validity period of the attribute values cached in the first cache.
[0118] Optionally, the step of preferentially obtaining from the local cache a target attribute value of the target object for determining whether the target object satisfies a corresponding push condition includes:
[0119] First, the target attribute value is obtained from the first cache. If the first cache does not include the target attribute value, the target attribute value is obtained from the second cache.
[0120] Optionally, the device further comprises:
[0121] The second writing unit is configured to write the target attribute value obtained from the application into the first cache or the second cache if the target attribute value is not included in the first cache or the second cache.
[0122] Optionally, the second writing unit is used to:
[0123] In response to acquiring the preset life cycle of the target attribute value, writing the target attribute value and the life cycle corresponding to the target attribute value into the second cache;
[0124] or,
[0125] In response to not obtaining the life cycle of the target attribute value, writing the target attribute value into the first cache.
[0126] Since the device 400 is a device corresponding to the method provided in the above method embodiment, the specific implementation of each unit of the device 400 is based on the same concept as the above method embodiment. Therefore, for the specific implementation of each unit of the device 400, reference can be made to the description part of the above method embodiment, which will not be repeated here.
[0127] The embodiment of the present application also provides an electronic device, the electronic device comprising a processor and a memory;
[0128] The processor is used to execute the instructions stored in the memory, so that the electronic device executes the data processing method provided by the above method embodiment.
[0129] An embodiment of the present application provides a computer-readable storage medium, including instructions, wherein the instructions instruct a device to execute the data processing method provided by the above method embodiment.
[0130] An embodiment of the present application provides a computer program product. When the computer program product is run on a computer, the computer is enabled to execute the data processing method provided by the above method embodiment.
[0131] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0132] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
[0133] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application should be included in the protection scope of the present application.
Claims
1. A data processing method, characterized in that: The method comprises: Receiving a target request sent by an application platform, wherein the target request is used to request to determine content that can be pushed to a target object; Determine whether the target object meets the push condition corresponding to the content to be pushed; wherein: when determining whether the target object meets the push condition, preferentially obtain the target attribute value of the target object used to determine whether the target object meets the corresponding push condition from the local cache, and if the target attribute value does not exist in the local cache, obtain the target attribute value from the application; A target response for the target request is returned to the application platform, where the target response indicates the content that can be pushed to the target object.
2. The method according to claim 1, characterized in that The receiving the target request sent by the application platform includes: Receive concurrent requests sent by the application platform, wherein the concurrent requests include the target request; accordingly, the local cache includes: a first cache, wherein the first cache is used to cache attribute values obtained based on the concurrent requests, and the attribute values cached in the first cache become invalid after a response to each of the concurrent requests is returned to the application platform.
3. The method according to claim 2, characterized in that The method further comprises: If the target attribute value does not exist in the local cache, the target attribute value obtained from the application is written into the first cache.
4. The method according to claim 2, characterized in that: The local cache also includes a second cache, which is used to cache attribute values obtained based on the concurrent request or the historical request, and the validity period of the attribute values cached in the second cache is greater than the validity period of the attribute values cached in the first cache.
5. The method according to claim 4, characterized in that The step of preferentially obtaining from the local cache a target attribute value of the target object for determining whether the target object satisfies a corresponding push condition includes: First, the target attribute value is obtained from the first cache. If the first cache does not include the target attribute value, the target attribute value is obtained from the second cache.
6. The method according to claim 5, characterized in that The method further comprises: If neither the first cache nor the second cache includes the target attribute value, the target attribute value obtained from the application is written into the first cache or the second cache.
7. The method according to claim 6, characterized in that The writing the target attribute value obtained from the application into the first cache or the second cache includes: In response to acquiring the preset life cycle of the target attribute value, writing the target attribute value and the life cycle corresponding to the target attribute value into the second cache; or, In response to not obtaining the life cycle of the target attribute value, writing the target attribute value into the first cache.
8. A data processing device, characterized in that: The device comprises: A receiving unit, configured to receive a target request sent by an application platform, wherein the target request is used to request to determine content that can be pushed to a target object; a determination unit, configured to determine whether the target object satisfies a push condition corresponding to the content to be pushed; wherein: when determining whether the target object satisfies the push condition, a target attribute value of the target object used to determine whether the target object satisfies the corresponding push condition is preferentially obtained from a local cache; if the target attribute value does not exist in the local cache, the target attribute value is obtained from an application; The sending unit is used to return a target response to the target request to the application platform, where the target response indicates the content that can be pushed to the target object.
9. An electronic device, characterized in that: The electronic device comprises a processor and a memory; The processor is configured to execute instructions stored in the memory, so that the electronic device executes the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The method comprises instructions for instructing a device to execute the method according to any one of claims 1 to 7.