Task processing method and device, readable medium, electronic equipment and program product
By storing and matching decision parameters and results in the cache and utilizing cache identifiers, the problem of slow response speed is solved, the load on the policy engine and the operation and maintenance costs are reduced, and the user experience is improved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING ZITIAO NETWORK TECH CO LTD
- Filing Date
- 2024-12-27
- Publication Date
- 2026-06-30
AI Technical Summary
In existing technologies, the response speed is slow when selecting processing strategies based on actual conditions, resulting in high load on the strategy engine, increased operation and maintenance costs, and negatively impacting user experience.
By storing decision parameters and policy decision results in the cache and using cache identifiers for matching, the number of requests to the policy engine is reduced, thereby lowering the policy engine load and operational costs. Meanwhile, when the decision parameters are not found in the cache, the policy decision results are obtained through a remote procedure call interface.
This reduces the number of requests to the strategy engine, lowers the load and maintenance costs of the strategy engine, and improves response speed and user experience.
Smart Images

Figure CN122308964A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to a task processing method, apparatus, readable medium, electronic device, and program product. Background Technology
[0002] In the same task scenario, multiple different processing strategies are usually formulated to ensure that the appropriate strategy is adopted based on the actual situation. For example, in a short video shooting scenario, different processing strategies can be selected based on the performance of the terminal device.
[0003] However, in related technologies, there are problems such as slow response speed when selecting processing strategies based on actual conditions. Summary of the Invention
[0004] This summary section is provided to briefly introduce the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0005] Firstly, this disclosure provides a task processing method applied to a server. The task processing method includes: Determine the first decision parameters on the client side that are relevant to the strategic decision-making of the target task; In response to obtaining a second decision parameter related to the strategy decision of the target task from the cache, a first cache identifier is generated based on at least the first decision parameter and the second decision parameter, wherein the cache is used to store the decision parameter and the strategy decision result corresponding to the decision parameter, and each strategy decision result is associated with a cache identifier; In response to the existence of a second cache identifier in the cache that is the same as the first cache identifier, the policy decision result corresponding to the second cache identifier in the cache is determined as the policy decision result corresponding to the target task.
[0006] Secondly, this disclosure provides a task processing method applied to a client, the task processing method including: Determine the first decision parameters on the client side that are relevant to the strategic decision-making of the target task; In response to obtaining a second decision parameter related to the strategy decision of the target task from the cache, a first cache identifier is generated based on at least the first decision parameter and the second decision parameter, wherein the cache is used to store the decision parameter and the strategy decision result corresponding to the decision parameter, and each strategy decision result is associated with a cache identifier; In response to the existence of a second cache identifier in the cache that is the same as the first cache identifier, the policy decision result corresponding to the second cache identifier in the cache is determined as the policy decision result corresponding to the target task.
[0007] Thirdly, this disclosure provides a task processing apparatus, the task processing apparatus comprising: The first determining module is used to determine the first decision parameters on the client side related to the strategy decision of the target task; The first generation module is configured to, in response to obtaining a second decision parameter related to the strategy decision of the target task from the cache, generate a first cache identifier based on the first decision parameter and the second decision parameter, wherein the cache is used to store the decision parameter and the strategy decision result corresponding to the decision parameter, and each strategy decision result is associated with a cache identifier. The second determining module is used to determine the policy decision result corresponding to the second cache identifier in the cache as the policy decision result corresponding to the target task in response to the existence of a second cache identifier in the cache that is the same as the first cache identifier.
[0008] Fourthly, this disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the method described in the first aspect.
[0009] Fifthly, this disclosure provides an electronic device, comprising: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the steps of the method in the first aspect.
[0010] In a sixth aspect, this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method described in the first aspect.
[0011] The above technical solution allows for the storage of decision parameters and their corresponding policy decision results in a cache, with each policy decision result associated with a cache identifier. Therefore, after determining the first decision parameter, an attempt can be made to retrieve the second decision parameter from the cache. Once the second decision parameter is obtained, at least a first cache identifier can be generated based on the first and second decision parameters. Furthermore, an attempt can be made to retrieve the policy decision result corresponding to the target task from the cache based on the first cache identifier. Thus, when retrieving the policy decision result corresponding to the target task, retrieving it from the cache first can reduce the number of requests to the policy engine, lowering its load and operational costs. It also reduces response time, improving response speed and user experience.
[0012] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description
[0013] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale. In the drawings: Figure 1 This is a flowchart illustrating a task processing method according to an exemplary embodiment of the present disclosure; Figure 2 This is a flowchart illustrating another task processing method according to an exemplary embodiment of the present disclosure; Figure 3 This is a flowchart illustrating another task processing method according to an exemplary embodiment of the present disclosure; Figure 4 This is a flowchart illustrating another task processing method according to an exemplary embodiment of the present disclosure; Figure 5 This is a structural block diagram of a content detection device according to an exemplary embodiment of the present disclosure; Figure 6 This is a structural block diagram of a content detection device according to an exemplary embodiment of the present disclosure; Figure 7 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation
[0014] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0015] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0016] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.
[0017] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0018] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0019] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0020] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0021] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0022] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0023] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0024] Meanwhile, it is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0025] As mentioned in the background section, in related technologies, there are problems such as slow response speed when selecting processing strategies based on actual conditions.
[0026] For example, in related technologies, the processing strategy of the task terminal (e.g., short video application or prop distribution platform) is generally configured in the strategy engine. Thus, when the task terminal needs to obtain the processing strategy, it sends a strategy request to the strategy engine, so that the strategy engine can make a real-time decision based on the strategy request and obtain the required processing strategy.
[0027] However, due to the large number of task terminals, each terminal may send policy requests to the policy engine at any time, resulting in the policy engine needing to handle a large number of concurrent requests. This high request volume means the policy engine requires more computing resources to process these requests, which not only increases the load on the policy engine but also raises its operational costs. Simultaneously, the large number of requests the policy engine needs to handle may prevent it from responding quickly enough to each policy request, leading to decision delays, affecting the response speed of task terminals, and consequently impacting user experience. For example, in short video applications, a slow policy engine response may cause video loading delays, affecting the user's viewing experience.
[0028] In view of the above, this disclosure provides a task processing method, apparatus, readable medium, electronic device, and program product to solve the aforementioned technical problems.
[0029] The embodiments of this disclosure will be further explained below with reference to the accompanying drawings.
[0030] Figure 1 This is a flowchart illustrating a task processing method according to an exemplary embodiment of the present disclosure, with reference to... Figure 1 This method can be applied to the server side and may include the following steps: S101: Determine the first decision parameters on the client side related to the strategic decision of the target task.
[0031] In this embodiment, the target task and the client can be determined according to the actual situation, and this disclosure does not impose any restrictions on them. For example, when the client is a short video application, the target task can be a prop display task in the short video application, or a video shooting task in the short video application. When the client is a video playback application, the target task can be a video playback task in the video playback application, etc.
[0032] In this embodiment, the executing entity can be the upstream server of the target task. Therefore, when the upstream server detects that a client is executing the target task or receives a request from a client to execute the target task, it can generate a policy request for the target task and parse the policy request to obtain the first decision parameters on the client side related to the policy decision of the target task carried in the policy request.
[0033] For example, the client can be a short video application, the target task can be a prop display task within the short video application, and correspondingly, the upstream server can be a prop distribution platform within the short video application. Thus, when a user opens the short video application on their terminal device and triggers the interface within the application for collaborative shooting with props, the prop distribution platform can generate a strategy request for prop display and parse this request to obtain first decision parameters, such as the version parameters of the short video application, the CPU model and / or GPU model of the terminal device, etc.
[0034] S102: In response to obtaining the second decision parameter related to the strategy decision of the target task from the cache, generate a first cache identifier based at least on the first decision parameter and the second decision parameter, wherein the cache is used to store the decision parameter and the strategy decision result corresponding to the decision parameter, and each strategy decision result is associated with a cache identifier.
[0035] S103: In response to the existence of a second cache identifier in the cache that is the same as the first cache identifier, the policy decision result corresponding to the second cache identifier in the cache is determined as the policy decision result corresponding to the target task.
[0036] The above technical solution allows for the storage of decision parameters and their corresponding policy decision results in a cache, with each policy decision result associated with a cache identifier. Therefore, after determining the first decision parameter, an attempt can be made to retrieve the second decision parameter from the cache. Once the second decision parameter is obtained, at least a first cache identifier can be generated based on the first and second decision parameters. Furthermore, an attempt can be made to retrieve the policy decision result corresponding to the target task from the cache based on the first cache identifier. Thus, when retrieving the policy decision result corresponding to the target task, retrieving it from the cache first can reduce the number of requests to the policy engine, lowering its load and operational costs. It also reduces response time, improving response speed and user experience.
[0037] To facilitate understanding of the task processing methods provided in this disclosure, the possible implementation methods in this disclosure are described below.
[0038] In a possible manner, the first decision parameter may include a policy identifier for identifying the policy corresponding to the target task, a cache type of the policy corresponding to the target task in the cache, and relevant condition parameters for determining the decision result of the policy corresponding to the target task. Accordingly, generating the first cache identifier based at least on the first decision parameter and the second decision parameter may include: Determine the intersection of relevant condition parameters and second decision parameters; generate a first cache identifier based at least on the parameter intersection, policy identifier, and cache type.
[0039] In this embodiment, the relevant condition parameters can be parameters involved in the strategy corresponding to the target task, specifically determined according to the actual scenario. This disclosure embodiment does not impose any restrictions on this. For example, continuing with the previous example, when the target task is a prop display task in a short video application, the relevant condition parameters can be the version parameters of the short video application, the central processing unit model and / or graphics processor model of the terminal device, etc.
[0040] In this embodiment, the policy identifier and cache type can be determined according to actual conditions, and this disclosure does not impose any restrictions on them. For example, the policy identifier may include the policy identifier of a hierarchical policy and the policy identifier of a list policy. The cache type may include a policy decision result type and a decision parameter type. The policy decision result type may include the decision result of a hierarchical policy and / or the decision result of a list policy. The decision parameter type may include the decision parameters of a hierarchical policy and / or the decision parameters of a list policy, etc.
[0041] In this embodiment, when generating the cache identifier, the intersection of the relevant condition parameters and the second decision parameters is determined so that the cache identifier can mark the decision parameters applicable to the client. By combining the policy identifier and the cache type, the cache identifier can identify the policy. Therefore, when matching the policy decision results based on the cache identifier, the accuracy of the matching results can be improved, so that the policy decision results can better match the client and further improve the user experience.
[0042] Among the possible approaches, task processing methods may also include: Determine the prefix identifier used to identify the policy engine; Accordingly, at least based on the intersection of parameters, the policy identifier, and the cache type, a first cache identifier is generated, which may include: The first cache identifier is generated based on the prefix identifier, parameter intersection, policy identifier, and cache type.
[0043] It should be understood that, since the cache identifier in the cache may be stored in upstream memory or a distributed cache, it may be confused with other cached data in upstream tasks. Therefore, in this embodiment, when generating the first cache identifier, an additional prefix identifier for identifying the policy engine is introduced to distinguish it from other task data, thereby further improving the accuracy of the policy decision results.
[0044] In possible ways, generating the first cache identifier based on the prefix identifier, parameter intersection, policy decision identifier, and cache type may include: When there are multiple parameters in the parameter intersection, the parameters in the parameter intersection are concatenated according to the first concatenation order to obtain the parameter sequence. Then, the prefix identifier, parameter sequence, policy decision identifier, and cache type are concatenated according to the second concatenation order to generate the first cache identifier. The first concatenation order is used to indicate the concatenation order of the parameters in the parameter intersection, and the second concatenation order is used to indicate the concatenation order among the prefix identifier, parameter intersection, policy decision identifier, and cache type.
[0045] In this embodiment, the first and second concatenation orders can be determined according to actual conditions, and this disclosure does not impose any restrictions on them. For example, the first concatenation order can be: version number, operating system type, CPU model, and GPU model; the second concatenation order can be: prefix identifier, cache type, policy decision identifier, and parameter intersection. Therefore, when the parameters in the parameter intersection include the version number and GPU model, they can first be concatenated based on the version number and GPU model to obtain the parameter sequence: version number_GPU model; then, they can be concatenated based on the prefix identifier, cache type, policy decision identifier, and parameter intersection to generate the first cache identifier: prefix identifier + cache type + policy decision identifier + version number_GPU model.
[0046] Correspondingly, when there is only one parameter in the parameter intersection, the prefix identifier, parameter intersection, policy decision identifier, and cache type can be directly concatenated according to the second concatenation order to generate the first cache identifier.
[0047] In some possible ways, to facilitate the conversion of the cache identifier into a string, the first cache identifier can also be serialized into JSON format after it is generated.
[0048] Using the above method, the prefix identifier, parameter intersection, strategy decision identifier, and cache type can be concatenated according to the second concatenation order. When there are multiple parameters in the parameter intersection, the parameters in the parameter intersection can be concatenated according to the first concatenation order. This ensures that when generating cache identifiers based on the same first decision parameters, the generated first cache identifiers are identical each time. On the one hand, this improves the accuracy of the strategy decision results; on the other hand, it avoids requesting the strategy decision results from the strategy engine due to different generated first cache identifiers, further improving response speed and enhancing the user experience.
[0049] Among the possible approaches, task processing methods may also include: In response to the failure to obtain the second decision parameter related to the strategy decision of the target task from the cache, or in response to the absence of a second cache identifier that is the same as the first cache identifier in the cache, a request to obtain the strategy decision result corresponding to the target task is sent to the strategy engine through the remote procedure call interface. The strategy engine makes a decision after receiving the request and obtains feedback information in response to the request. The strategy engine receives the feedback information in response to the request, which includes the first strategy decision result. The first strategy decision result is determined as the strategy decision result corresponding to the target task.
[0050] In this way, if the second decision parameters related to the strategy decision of the target task cannot be obtained from the cache, or if the strategy decision result corresponding to the target task cannot be obtained from the cache, the strategy decision result corresponding to the target task can be obtained from the strategy engine through the remote procedure call interface. Since the remote procedure call interface allows the client to communicate directly with the strategy engine, it avoids intermediate proxies or additional data processing layers, effectively reduces response time, and further improves response speed and user experience.
[0051] In some possible embodiments, the feedback information may further include decision parameters corresponding to the first strategy decision result, and first information indicating whether to store the first strategy decision result in the cache, and accordingly, may also include: In response to the failure to obtain a second decision parameter related to the strategy decision of the target task from the cache, when the first information indicates that the first strategy decision result should be stored in the cache, a third cache identifier is generated at least according to the first decision parameter and the decision parameter corresponding to the first strategy decision result; the third cache identifier is associated with the first strategy decision result and stored in the cache, and the decision parameter corresponding to the first strategy decision result is stored in the cache.
[0052] In this embodiment, the method of generating the third cache identifier based at least on the first decision parameter and the decision parameter corresponding to the first strategy decision result can refer to the method of generating the first cache identifier based at least on the first decision parameter and the second decision parameter, which will not be repeated here.
[0053] It should be understood that, in order to quickly retrieve and match decision parameters, when storing decision parameters in the cache, a cache identifier for each decision parameter can be generated first, and then this cache identifier can be associated with the decision parameter and stored in the cache. Similarly, to avoid confusion between the cache identifier of the decision parameter in the cache and other cached data from upstream tasks, a prefix identifier for identifying the policy engine can be added when generating the cache identifier of the decision parameter. For example, the cache identifier can be generated based on the prefix identifier, the policy identifier, and the cache type of the corresponding policy in the cache.
[0054] In this way, when the second decision parameters related to the strategy decision of the target task are not obtained from the cache, in addition to obtaining the first strategy decision result from the strategy engine, the decision parameters corresponding to the first strategy decision result and the first information indicating whether to store the first strategy decision result in the cache can also be obtained. When the first information indicates that the first strategy decision result should be stored in the cache, the first strategy decision result and the decision parameters corresponding to the first strategy decision result can be stored in the cache. This allows the first strategy decision result and the decision parameters corresponding to the first strategy decision result to be obtained from the cache when the same strategy request is received in the future, without having to send a request to the strategy engine again, thus improving the response speed.
[0055] In some possible embodiments, the feedback information may further include decision parameters corresponding to the first strategy decision result, and first information indicating whether to store the first strategy decision result in the cache, and accordingly, may also include: In response to the absence of a second cache identifier that is identical to the first cache identifier in the cache, when the first information indicates that the first policy decision result should be stored in the cache, the first cache identifier is associated with the first policy decision result and stored in the cache, and the decision parameters corresponding to the first policy decision result are stored in the cache.
[0056] In the above manner, when there is no second cache identifier in the cache that is the same as the first cache identifier, in addition to obtaining the first policy decision result from the policy engine, it is also possible to obtain the decision parameters corresponding to the first policy decision result and the first information used to indicate whether to store the first policy decision result in the cache. When the first information indicates that the first policy decision result should be stored in the cache, the first policy decision result and the decision parameters corresponding to the first policy decision result can be stored in the cache. This allows the first policy decision result and the decision parameters corresponding to the first policy decision result to be obtained from the cache when the same policy request is received in the future, without having to send a request to the policy engine again, thus improving the response speed.
[0057] To facilitate understanding of the task processing method provided in this embodiment, the following describes a possible implementation of this example in conjunction with the steps described above: For example, such as Figure 2 As shown, in this embodiment, the client can be a short video application, the target task can be a prop display task within the short video application, and correspondingly, the upstream server can be a prop distribution platform within the short video application. Therefore, when a user opens the short video application on their terminal device and triggers the interface for collaborative shooting with props, the prop distribution platform can generate a strategy request for prop display and parse this request to obtain the first decision parameter. Subsequently, the upstream server can attempt to retrieve the second decision parameter related to the strategy decision for the prop display task from the cache. If the second decision parameter is not retrieved from the cache, a request to obtain the strategy decision result corresponding to the prop display task can be sent to the strategy engine via a remote procedure call interface. Upon receiving the request, the strategy engine makes a decision, obtains feedback information in response to the request, and sends the feedback information to the prop distribution platform. The feedback information may include the strategy decision result, the decision parameters corresponding to the strategy decision result, and first information indicating whether to store the first strategy decision result in the cache.
[0058] After receiving the feedback information, the item distribution platform will, on the one hand, use the strategy decision result as the strategy decision result for the item display task and distribute the corresponding items to the client according to the strategy decision result; on the other hand, it can determine whether to cache the strategy decision result based on the first information. If it is determined to cache the strategy decision result, it can generate a cache identifier for the strategy decision result in the cache based on the intersection of the first decision parameters and the decision parameters in the feedback information, the prefix identifier, the strategy identifier corresponding to the item display task, and the cache type of the strategy corresponding to the item display task in the cache. It can also generate a cache identifier for the decision parameters in the cache based on the prefix identifier, the strategy identifier corresponding to the item display task, and the cache type of the strategy corresponding to the item display task in the cache. Finally, it will associate and store the strategy decision result, decision parameters, and corresponding cache identifiers in the cache.
[0059] If the second decision parameter is obtained from the cache, a first cache identifier can be generated based on the prefix identifier, the strategy identifier corresponding to the item display task, the intersection of the first and second decision parameters, and the cache type of the strategy corresponding to the item display task in the cache. Then, an attempt is made to match the first cache identifier in the cache. If a second cache identifier that is the same as the first cache identifier is found in the cache, the strategy decision result corresponding to the second cache identifier is taken as the strategy decision result of the item display task.
[0060] If no second cache identifier matching the first cache identifier is found in the cache, a request to obtain the strategy decision result corresponding to the item display task can be sent to the strategy engine via the remote procedure call interface. After receiving the request, the strategy engine makes a decision, obtains feedback information in response to the request, and sends the feedback information to the item distribution platform. The feedback information may include the strategy decision result, the decision parameters corresponding to the strategy decision result, and instructions.
[0061] Upon receiving feedback, the item distribution platform takes two steps: first, it uses the strategy decision result as the strategy decision result for the item display task and distributes the corresponding items to the client accordingly; second, based on the first information, it determines whether to cache the strategy decision result. If caching is chosen, it generates a cache identifier for the decision parameters in the cache based on the prefix identifier, the strategy identifier corresponding to the item display task, and the cache type of the strategy corresponding to the item display task in the cache. The strategy decision result and the first cache identifier are then associated and stored in the cache, and the decision parameters and their corresponding cache identifiers are also associated and stored in the cache.
[0062] Based on the same concept, embodiments of this disclosure also provide another task processing method, such as... Figure 3 As shown, this method can be applied to the client and may include the following steps: S301: Determine the first decision parameters on the client side related to the strategic decision of the target task.
[0063] In this embodiment, the target task and the client can be determined according to the actual situation, and this disclosure does not impose any restrictions on them. For example, when the client is a short video application, the target task can be a prop display task in the short video application, or a video shooting task in the short video application. When the client is a video playback application, the target task can be a video playback task in the video playback application, etc.
[0064] In this embodiment, the executing entity can be an upstream client of the target task. This upstream client can be installed on a terminal device, such as a tablet, mobile phone, or computer. Therefore, when the upstream client detects that a downstream client is executing the target task or receives a request from a downstream client to execute the target task, it can generate a policy request for the target task and parse the policy request to obtain the first decision parameters on the client side related to the policy decision of the target task carried in the policy request.
[0065] In this embodiment, the upstream client and the downstream client can be different clients or different components within the same client. This disclosure does not impose any restrictions on this. For example, the downstream client can be a video shooting component in a short video application, and the target task can be a sharpness selection task. Correspondingly, the upstream client can be a sharpness control component in the short video application used to determine the shooting sharpness. Thus, when a user opens the short video application on their terminal device and triggers the video shooting component in the short video application, the sharpness control component can generate a strategy request for sharpness selection and can parse the strategy request to obtain first decision parameters, such as the version parameters of the short video application, the CPU model and / or GPU model of the terminal device, etc.
[0066] S302: In response to obtaining the second decision parameter related to the strategy decision of the target task from the cache, a first cache identifier is generated based on the first decision parameter and the second decision parameter, wherein the cache is used to store the decision parameter and the strategy decision result corresponding to the decision parameter, and each strategy decision result is associated with a cache identifier.
[0067] S303: In response to the existence of a second cache identifier in the cache that is the same as the first cache identifier, the policy decision result corresponding to the second cache identifier in the cache is determined as the policy decision result corresponding to the target task.
[0068] The above technical solution allows for the storage of decision parameters and their corresponding policy decision results in a cache, with each policy decision result associated with a cache identifier. Therefore, after determining the first decision parameter, an attempt can be made to retrieve the second decision parameter from the cache. Once the second decision parameter is obtained, at least a first cache identifier can be generated based on the first and second decision parameters. Furthermore, an attempt can be made to retrieve the policy decision result corresponding to the target task from the cache based on the first cache identifier. Thus, when retrieving the policy decision result corresponding to the target task, retrieving it from the cache first can reduce the number of requests to the policy engine, lowering its load and operational costs. It also reduces response time, improving response speed and user experience.
[0069] To facilitate understanding of the task processing methods provided in this disclosure, the possible implementation methods in this disclosure are described below.
[0070] Among the possible approaches, task processing methods may also include: Determine the policy state of the policy decision results in the cache. The policy state is used to indicate whether the policy decision results are available. Accordingly, the first decision parameters on the client side related to the strategy decision for the target task may include: Based on the strategy state, determine the first decision parameters on the client side that are relevant to the strategy decision for the target task.
[0071] In this embodiment, the timing for determining the policy state of the policy decision results in the cache can be determined according to the actual situation, and this embodiment does not impose any restrictions on this. For example, to avoid affecting the response speed of policy requests, the policy state of the policy decision results in the cache can be determined during client cold start, and this embodiment does not impose any restrictions on this.
[0072] In this embodiment, determining the first decision parameter on the client side related to the strategy decision of the target task based on the strategy state can be as follows: For each strategy decision result in the cache, determine the strategy state corresponding to that strategy decision result. When each strategy state indicates that the strategy decision result is available, determine the first decision parameter on the client side related to the strategy decision of the target task. When there is a strategy state indicating that the strategy decision result is unavailable, the strategy decision result, the decision parameter corresponding to the strategy decision result, and / or the cache identifier associated with the strategy decision result can be updated, and after the update, determine the first decision parameter on the client side related to the strategy decision of the target task. That is to say, in possible ways, determining the first decision parameter on the client side related to the strategy decision of the target task based on the strategy state can include: When the policy state indicates that the policy decision result is available, determine the first decision parameter on the client side related to the policy decision of the target task; or, when the policy state indicates that the policy decision result is unavailable, update the decision parameters and / or policy decision results in the cache, and after updating the decision parameters and / or policy decision results in the cache, determine the first decision parameter on the client side related to the policy decision of the target task.
[0073] By using the above method, all policy decision results in the cache can be made available before determining the first decision parameter. Therefore, after determining the first decision parameter, if the policy decision result can be retrieved from the cache, it can be used directly. This improves response speed and avoids secondary requests caused by unavailable policy decision results, further enhancing response speed.
[0074] Determining the policy state of the policy decision results in the cache, among possible methods, may include: Retrieve task policy information related to the client side from the policy engine. The policy engine stores task policy information, which is used to characterize information related to the policy decision of the task. Based on the task policy information and the decision parameters in the cache, determine the policy state of the policy decision results in the cache.
[0075] It should be understood that the decision parameters stored in the cache, as well as the corresponding policy decision results, generally come from the policy engine. The task policy information, such as the decision parameters and their corresponding policy decision results, in the policy engine is generally dynamic, and the policy decision results in the cache are usually related to the decision parameters. Therefore, the policy state of the policy decision result can be determined using the task policy information and the decision parameters in the cache.
[0076] In one possible approach, each policy decision result and each decision parameter in the cache is associated with a policy identifier. The task policy information includes the policy identifier of the policy corresponding to the task, the decision parameters associated with the policy identifier, associated second information, and associated third information. The second information is used to indicate whether the policy decision result associated with the policy identifier needs downstream processing, and the third information is used to mark the expiration status of the policy decision result associated with the policy identifier. Accordingly, based on the task policy information and the decision parameters in the cache, the policy status of the policy decision results in the cache is determined, which may include: Identify the first policy identifier that exists simultaneously in the task policy information and the cache; based on the decision parameters associated with the first policy identifier in the cache, the decision parameters associated with the first policy identifier in the task policy information, the associated second information, and the associated third information, determine the policy state of the policy decision result associated with the first policy identifier in the cache.
[0077] As mentioned earlier, task policy information in the policy engine is generally dynamically changing. Therefore, there may be situations where some task policy information has been deleted from the policy engine, but is still stored in the cache. Since this part of the task policy information has been deleted from the policy engine, it means that this part of the task policy information is no longer usable. Therefore, to reduce the amount of policy state determination, this embodiment, when determining the policy state of the policy decision result in the cache, can first determine the first policy identifier that exists simultaneously in both the task policy information and the cache, and then determine the policy state of the policy decision result associated with the first policy identifier in the cache. This improves the efficiency of policy state determination and reduces the consumption of computing resources on the terminal device, thereby improving the processing performance of the terminal device.
[0078] For example, the cache may include four policy identifiers, denoted as policy identifier a, policy identifier b, policy identifier c, and policy identifier d. The task policy information includes five policy identifiers, denoted as policy identifier a, policy identifier c, policy identifier e, policy identifier f, and policy identifier g. Since policy identifiers a and c exist simultaneously in both the task policy information and the cache, this indicates that the policy decision results associated with policy identifiers b and d in the cache are no longer usable. Therefore, only the policy state of the policy decision results associated with policy identifiers a and c needs to be determined.
[0079] In possible approaches, the first policy identifier may include multiple identifiers. Accordingly, the policy state of the policy decision result associated with the first policy identifier in the cache is determined based on the decision parameters associated with the first policy identifier in the cache, the decision parameters associated with the first policy identifier in the task policy information, the associated second information, and the associated third information. This can include: For each first policy identifier in the cache, if at least one of the following conditions exists: the second information indicates that the policy decision result requires downstream processing, the third information marks the expiration state as expired, or the decision parameters in the task policy information are inconsistent with the decision parameters in the cache, the policy state of the policy decision result associated with the first policy identifier in the cache is determined to be a policy state indicating that the policy decision is unavailable; for each first policy identifier in the cache, if the second information indicates that the policy decision result does not require downstream processing, the third information marks the expiration state as not expired, and the decision parameters in the task policy information are consistent with the decision parameters in the cache, the policy state of the policy decision result associated with the third cache identifier in the cache is determined to be a policy state indicating that the policy decision is available.
[0080] For example, continuing with the previous example, for policy identifier a, if the second information associated with policy identifier a indicates that the policy decision result associated with policy identifier a needs downstream processing, the expiration status marked by the third information associated with policy identifier a is expired, or the decision parameters associated with policy identifier a in the task policy information are inconsistent with the decision parameters associated with it in the cache (for example, the decision parameters associated with policy identifier a in the task policy information include version V2, and the decision parameters associated with policy identifier a in the task policy information include version V1), then the policy status of the policy decision result associated with policy identifier a in the cache is determined to be a policy status indicating that the policy decision is unavailable.
[0081] For policy identifier c, if the second information associated with policy identifier c indicates that the policy decision result associated with policy identifier c does not require downstream processing, the expiration status of the third information associated with policy identifier c is e (not expired), and the decision parameters associated with policy identifier c in the task policy information are consistent with the decision parameters associated with it in the cache (for example, the decision parameters associated with policy identifier c in the task policy information include version V2, and the decision parameters associated with policy identifier c in the task policy information include version V2), then the policy status of the policy decision result associated with policy identifier c in the cache is determined to be a policy status indicating that the policy decision is available.
[0082] Updating the decision parameters and / or policy decision results stored in the cache, among other possible methods, may include: Delete the policy decision results and decision parameters associated with the first policy identifier from the cache; determine the second policy identifier in the first policy identifier that the policy status indicates the policy decision result is unavailable; obtain the policy decision results and / or decision parameters corresponding to the second policy identifier from the policy engine, and replace the decision parameters and / or policy decision results associated with the second policy identifier in the cache.
[0083] For example, continuing with the previous example, a request to obtain the policy decision result corresponding to policy identifier 'a' can be sent to the policy engine through the remote procedure call interface. After receiving the request, the policy engine can return the policy decision result and / or decision parameters corresponding to policy identifier 'a' through the remote procedure call interface. After receiving the policy decision result and / or decision parameters corresponding to policy identifier 'a', the client can replace the decision parameters, policy decision results, and / or cache identifiers associated with policy identifier 'a' in the cache.
[0084] Among the possible approaches, task processing methods may also include: Determine the time interval since the last time task policy information related to the client was obtained from the policy engine; Accordingly, determining the policy state of the policy decision results in the cache may include: When the time interval is outside the preset time interval range, determine the policy state of the policy decision result in the cache.
[0085] In this embodiment, the preset time interval can be determined according to the actual situation, and this disclosure does not impose any restrictions on it. For example, the preset time interval can be set to [1, 10] or [0, 5], etc., where the time unit is minutes.
[0086] In this embodiment, the policy state of the policy decision result in the cache is determined only when the time interval is outside the preset time interval range. This reduces the number of times the policy state is determined, thereby reducing the consumption of computing resources in the terminal device and improving the processing performance of the terminal device.
[0087] In a possible manner, the first decision parameter may include a policy identifier for identifying the policy corresponding to the target task, a cache type of the policy corresponding to the target task in the cache, and relevant condition parameters for determining the decision result of the policy corresponding to the target task. Accordingly, generating the first cache identifier based at least on the first decision parameter and the second decision parameter may include: Determine the intersection of relevant condition parameters and second decision parameters; generate a first cache identifier based at least on the parameter intersection, policy identifier, and cache type.
[0088] In this embodiment, the relevant condition parameters can be parameters involved in the strategy corresponding to the target task, specifically determined according to the actual scenario. This disclosure embodiment does not impose any restrictions on this. For example, continuing with the previous example, when the target task is a prop display task in a short video application, the relevant condition parameters can be the version parameters of the short video application, the central processing unit model and / or graphics processor model of the terminal device, etc.
[0089] In this embodiment, when generating the cache identifier, the intersection of the relevant condition parameters and the second decision parameters is determined so that the cache identifier can mark the decision parameters applicable to the client. By combining the policy identifier and the cache type, the cache identifier can identify the policy. Therefore, when matching the policy decision results based on the cache identifier, the accuracy of the matching results can be improved, so that the policy decision results can better match the client and further improve the user experience.
[0090] Among the possible approaches, task processing methods may also include: Determine the prefix identifier used to identify the policy engine; Accordingly, at least based on the intersection of parameters, the policy identifier, and the cache type, a first cache identifier is generated, which may include: The first cache identifier is generated based on the prefix identifier, parameter intersection, policy identifier, and cache type.
[0091] It should be understood that, since the cache identifier in the cache may be stored in upstream memory or a distributed cache, it may be confused with other cached data in upstream tasks. Therefore, in this embodiment, when generating the first cache identifier, an additional prefix identifier for identifying the policy engine is introduced to distinguish it from other task data, thereby further improving the accuracy of the policy decision results.
[0092] In possible ways, generating the first cache identifier based on the prefix identifier, parameter intersection, policy decision identifier, and cache type may include: When there are multiple parameters in the parameter intersection, the parameters in the parameter intersection are concatenated according to the first concatenation order to obtain the parameter sequence. Then, the prefix identifier, parameter sequence, policy decision identifier, and cache type are concatenated according to the second concatenation order to generate the first cache identifier. The first concatenation order is used to indicate the concatenation order of the parameters in the parameter intersection, and the second concatenation order is used to indicate the concatenation order among the prefix identifier, parameter intersection, policy decision identifier, and cache type.
[0093] In this embodiment, the first and second concatenation orders can be determined according to actual conditions, and this disclosure does not impose any restrictions on them. For example, the first concatenation order can be: version number, operating system type, CPU model, and GPU model; the second concatenation order can be: prefix identifier, cache type, policy decision identifier, and parameter intersection. Therefore, when the parameters in the parameter intersection include the version number and GPU model, they can first be concatenated based on the version number and GPU model to obtain the parameter sequence: version number_GPU model; then, they can be concatenated based on the prefix identifier, cache type, policy decision identifier, and parameter intersection to generate the first cache identifier: prefix identifier + cache type + policy decision identifier + version number_GPU model.
[0094] Correspondingly, when there is only one parameter in the parameter intersection, the prefix identifier, parameter intersection, policy decision identifier, and cache type can be directly concatenated according to the second concatenation order to generate the first cache identifier.
[0095] In some possible ways, to facilitate the conversion of the cache identifier into a string, the first cache identifier can also be serialized into JSON format after it is generated.
[0096] Using the above method, the prefix identifier, parameter intersection, strategy decision identifier, and cache type can be concatenated according to the second concatenation order. When there are multiple parameters in the parameter intersection, the parameters in the parameter intersection can be concatenated according to the first concatenation order. This ensures that when generating cache identifiers based on the same first decision parameters, the generated first cache identifiers are identical each time. On the one hand, this improves the accuracy of the strategy decision results; on the other hand, it avoids requesting the strategy decision results from the strategy engine due to different generated first cache identifiers, further improving response speed and enhancing the user experience.
[0097] To facilitate understanding of the task processing method provided in this embodiment, the following describes a possible implementation of this example in conjunction with the steps described above: For example, such as Figure 4As shown, in this embodiment, the downstream client can be a video shooting component in a short video application, and the target task can be a clarity selection task. Correspondingly, the upstream client can be a clarity control component in the short video application used to determine the shooting clarity. Therefore, after a cold start of the short video application, a request to obtain task strategy information related to the client side can be generated first, and this request can be sent to the strategy engine so that the strategy engine returns the task strategy information related to the client side. After receiving the task strategy information related to the client side returned by the strategy engine, the time interval since the last time the task strategy information related to the client was obtained from the strategy engine is determined. If the time interval is outside a preset time interval range, a first strategy identifier that exists simultaneously in both the task strategy information and the cache is determined based on the strategy identifier in the task strategy information and the strategy identifier in the cache, and the strategy decision result and decision parameters associated with the first strategy identifier in the cache are deleted. Next, for each first policy identifier in the cache, it is determined whether the policy decision result associated with the first policy identifier needs downstream processing. If downstream processing is required, the policy information associated with the first policy identifier (such as policy decision result, decision parameters, and cache identifier) is placed into the first policy request pool. If downstream processing is not required, it is determined whether the policy decision result associated with the policy identifier is expired (e.g., the storage time in the cache is 1 day). If expired, the policy information associated with the first policy identifier (such as policy decision result, decision parameters, and cache identifier) is placed into the second policy request pool. If not expired, it is determined whether there is a parameter change compared to the previous request. If there is a parameter change, the policy information associated with the first policy identifier (such as policy decision result, decision parameters, and cache identifier) is placed into the second policy request pool. If there is no parameter change, the policy status of the policy decision result associated with the first policy identifier in the cache is determined to be a policy status indicating that the policy decision is available. After determining the policy status of all policy decision results associated with the first policy identifier, for the first policy identifier in the first policy request pool and the second policy request pool, the interface for obtaining policy information (such as policy decision results and decision parameters) from the policy engine can be called in batches, and then the policy information obtained from the policy engine can be cached in the cache.
[0098] Subsequently, if the user opens a short video application on their terminal device and triggers the video recording component within that application, the clarity control component can generate a strategy request for clarity selection. This request can be parsed to obtain the first decision parameter. Then, the second decision parameter can be retrieved from the cache. Based on the prefix identifier, the strategy identifier corresponding to the clarity selection task, the intersection of the first and second decision parameters, and the cache type of the strategy corresponding to the clarity selection task in the cache, a first cache identifier is generated. The component then attempts to match this first cache identifier within the cache. If a second cache identifier matching the first cache identifier is found, the strategy decision result corresponding to the second cache identifier is used as the strategy decision result for the prop display task.
[0099] Based on the same concept, embodiments of this disclosure also provide a task processing apparatus, such as... Figure 5 As shown, the task processing device may include: The first determining module 501 is used to determine the first decision parameters on the client side related to the strategy decision of the target task; The first generation module 502 is used to generate a first cache identifier in response to obtaining a second decision parameter related to the strategy decision of the target task from the cache, at least based on the first decision parameter and the second decision parameter. The cache is used to store the decision parameter and the strategy decision result corresponding to the decision parameter, and each strategy decision result is associated with a cache identifier. The second determining module 503 is used to determine the policy decision result corresponding to the second cache identifier in the cache as the policy decision result corresponding to the target task in response to the existence of a second cache identifier in the cache that is the same as the first cache identifier.
[0100] The aforementioned task processing device can store decision parameters and their corresponding policy decision results in a cache, with each policy decision result associated with a cache identifier. Therefore, after determining the first decision parameter, an attempt can be made to retrieve the second decision parameter from the cache. Once the second decision parameter is retrieved, at least a first cache identifier can be generated based on the first and second decision parameters. Then, an attempt can be made to retrieve the policy decision result corresponding to the target task from the cache based on the first cache identifier. Thus, when retrieving the policy decision result corresponding to the target task, retrieving it from the cache first can reduce the number of requests to the policy engine, lowering its load and operational costs; it can also reduce response time, improving response speed and user experience.
[0101] In one possible manner, the first decision parameters include a policy identifier for identifying the policy corresponding to the target task, the cache type of the policy corresponding to the target task in the cache, and relevant condition parameters for determining the decision result of the policy corresponding to the target task. Accordingly, the first generation module 502 may include: The first determining unit is used to determine the parameter intersection between the relevant condition parameters and the second decision parameters; The generation unit is used to generate a first cache identifier based at least on the intersection of parameters, the policy identifier, and the cache type.
[0102] In some possible configurations, the task processing apparatus may also include: The third determination module is used to determine the prefix identifier used to identify the strategy engine; Accordingly, the generation unit can be used to generate the first cache identifier based on the prefix identifier, parameter intersection, policy identifier, and cache type.
[0103] In one possible approach, the generation unit can be used to concatenate the parameters in the parameter intersection according to a first concatenation order to obtain a parameter sequence when the parameters in the parameter intersection include multiple parameters, and to concatenate the prefix identifier, parameter sequence, policy decision identifier, and cache type according to a second concatenation order to generate a first cache identifier. The first concatenation order is used to indicate the concatenation order of the parameters in the parameter intersection, and the second concatenation order is used to indicate the concatenation order among the prefix identifier, parameter intersection, policy decision identifier, and cache type.
[0104] In some possible configurations, the task processing apparatus may also include: The sending module is used to send a request to the strategy engine to obtain the strategy decision result corresponding to the target task through a remote procedure call interface in response to the failure to obtain the second decision parameter related to the strategy decision of the target task from the cache, or in response to the absence of a second cache identifier that is the same as the first cache identifier in the cache. The strategy engine is used to make a decision after receiving the request and generate feedback information for the request. The feedback information includes at least the first strategy decision result. The fourth determination module is used to receive feedback information from the strategy engine in response to the request and determine the first strategy decision result as the strategy decision result corresponding to the target task.
[0105] In some possible embodiments, the feedback information may further include decision parameters corresponding to the first strategy decision result, and first information indicating whether to store the first strategy decision result in a cache. Accordingly, the task processing device may further include: The second generation module is used to generate a third cache identifier at least based on the first decision parameter and the decision parameter corresponding to the first strategy decision result when the first information indicates that the first strategy decision result should be stored in the cache, in response to the failure to obtain the second decision parameter related to the strategy decision of the target task from the cache. The first storage module is used to associate the third cache identifier with the first strategy decision result and store it in the cache, and to store the decision parameters corresponding to the first strategy decision result in the cache.
[0106] In some possible embodiments, the feedback information may further include decision parameters corresponding to the first strategy decision result, and first information indicating whether to store the first strategy decision result in a cache. Accordingly, the task processing device may further include: The second storage module is used to, in response to the absence of a second cache identifier in the cache that is identical to the first cache identifier, when the first information indicates that the first strategy decision result should be stored in the cache, associate the first cache identifier with the first strategy decision result and store it in the cache, and store the decision parameters corresponding to the first strategy decision result in the cache.
[0107] Based on the same concept, embodiments of this disclosure also provide a task processing apparatus, such as... Figure 6 As shown, the task processing device may include: The fifth determining module 601 is used to determine the first decision parameters on the client side related to the strategy decision of the target task; The third generation module 602 is used to generate a first cache identifier in response to obtaining a second decision parameter related to the strategy decision of the target task from the cache, at least based on the first decision parameter and the second decision parameter. The cache is used to store the decision parameter and the strategy decision result corresponding to the decision parameter, and each strategy decision result is associated with a cache identifier. The sixth determining module 603 is used to determine the policy decision result corresponding to the second cache identifier in the cache as the policy decision result corresponding to the target task in response to the existence of a second cache identifier in the cache that is the same as the first cache identifier.
[0108] The aforementioned task processing device can store decision parameters and their corresponding policy decision results in a cache, with each policy decision result associated with a cache identifier. Therefore, after determining the first decision parameter, an attempt can be made to retrieve the second decision parameter from the cache. Once the second decision parameter is retrieved, at least a first cache identifier can be generated based on the first and second decision parameters. Then, an attempt can be made to retrieve the policy decision result corresponding to the target task from the cache based on the first cache identifier. Thus, when retrieving the policy decision result corresponding to the target task, retrieving it from the cache first can reduce the number of requests to the policy engine, lowering its load and operational costs; it can also reduce response time, improving response speed and user experience.
[0109] In some possible configurations, the task processing apparatus may also include: The seventh determination module is used to determine the policy status of the policy decision results in the cache. The policy status is used to indicate whether the policy decision results are available. Accordingly, the fifth determining module 601 can be used to determine the first decision parameters on the client side related to the strategy decision of the target task based on the strategy state.
[0110] In one possible manner, the fifth determining module 601 may be used to determine the first decision parameter on the client side related to the strategy decision of the target task when the strategy state indicates that the strategy decision result is available; or, when the strategy state indicates that the strategy decision result is unavailable, it may update the decision parameters and / or strategy decision results stored in the cache, and determine the first decision parameter on the client side related to the strategy decision of the target task after updating the decision parameters and / or strategy decision results stored in the cache.
[0111] In some possible ways, the seventh determining module may include: The acquisition submodule is used to obtain task policy information related to the client side from the policy engine. The policy engine stores task policy information, which is used to represent information related to the policy decision of the task. The first determination submodule is used to determine the policy state of the policy decision results in the cache based on the task policy information and the decision parameters in the cache.
[0112] In one possible approach, each policy decision result and each decision parameter in the cache is associated with a policy identifier. The task policy information includes the policy identifier of the policy corresponding to the task, the decision parameters associated with the policy identifier, associated second information, and associated third information. The second information is used to indicate whether the policy decision result associated with the policy identifier needs downstream processing, and the third information is used to mark the expiration status of the policy decision result associated with the policy identifier. Accordingly, the first determining submodule may include: The second determining unit is used to determine the first policy identifier that exists simultaneously in the task policy information and the cache. The third determining unit is used to determine the policy state of the policy decision result associated with the first policy identifier in the cache based on the decision parameters associated with the first policy identifier in the cache, the decision parameters associated with the first policy identifier in the task policy information, the associated second information, and the associated third information.
[0113] In possible approaches, the first strategy identifier may include multiple identifiers, and correspondingly, the third determining unit may be used for: For each first policy identifier in the cache, if at least one of the following situations exists: the second information indicates that the policy decision result needs to be processed downstream, the third information marks the expiration state as expired, or the decision parameters in the task policy information are inconsistent with the decision parameters in the cache, the policy state of the policy decision result associated with the first policy identifier in the cache is determined to be a policy state indicating that the policy decision is unavailable. For each first policy identifier in the cache, if the second information indicates that the policy decision result does not require downstream processing, the third information indicates that the expiration state is not expired, and the decision parameters in the task policy information are consistent with the decision parameters in the cache, the policy state of the policy decision result associated with the third cache identifier in the cache is determined to be the policy state indicating that the policy decision is available.
[0114] In one possible manner, the fifth determining module 601 may include: The delete submodule is used to delete policy decision results and decision parameters from the cache, except those associated with the first policy identifier; The second determination submodule is used to determine, from the first strategy identifier, a second strategy identifier that indicates the strategy decision result is unavailable; The replacement submodule is used to obtain the policy decision result and / or decision parameters corresponding to the second policy identifier from the policy engine, and replace the policy decision result and / or decision parameters associated with the second policy identifier in the cache.
[0115] In some possible configurations, the task processing apparatus may also include: The eighth determination module is used to determine the time interval since the last time task policy information related to the client was obtained from the policy engine; Accordingly, the seventh determining module can be used to determine the policy state of the policy decision result in the cache when the time interval is outside the preset time interval range.
[0116] In one possible manner, the first decision parameters include a policy identifier for identifying the policy corresponding to the target task, the cache type of the policy corresponding to the target task in the cache, and relevant condition parameters for determining the decision result of the policy corresponding to the target task. Accordingly, the third generation module 602 may include: The third determination submodule is used to determine the parameter intersection between the relevant condition parameters and the second decision parameters; The generation submodule is used to generate the first cache identifier based at least on the intersection of parameters, the policy identifier, and the cache type.
[0117] In some possible configurations, the task processing apparatus may also include: The ninth determination module is used to determine the prefix identifier used to identify the strategy engine; Accordingly, the generation submodule can be used to generate the first cache identifier based on the prefix identifier, parameter intersection, policy identifier, and cache type.
[0118] In one possible approach, the generation submodule can be used to concatenate the parameters in the parameter intersection according to a first concatenation order to obtain a parameter sequence when the parameters in the parameter intersection include multiple parameters, and to concatenate the prefix identifier, parameter sequence, policy decision identifier, and cache type according to a second concatenation order to generate a first cache identifier. The first concatenation order is used to indicate the concatenation order of the parameters in the parameter intersection, and the second concatenation order is used to indicate the concatenation order among the prefix identifier, parameter intersection, policy decision identifier, and cache type.
[0119] Based on the same concept, embodiments of this disclosure also provide a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of any of the above-described task processing methods.
[0120] Based on the same concept, this disclosure also provides an electronic device that may include: A storage device on which computer programs are stored; A processing device for executing a computer program stored in a storage device to implement the steps of any of the above-described task processing methods.
[0121] Based on the same concept, embodiments of this disclosure also provide a computer program product, including a computer program that, when executed by a processor, implements the steps of any of the above-described task processing methods.
[0122] The following is for reference. Figure 7The diagram illustrates a structural schematic of an electronic device 700 suitable for implementing embodiments of the present disclosure. Terminal devices in embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 7 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.
[0123] like Figure 7 As shown, the electronic device 700 may include a processing unit (e.g., a central processing unit, a graphics processor, etc.) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage device 708 into a random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the electronic device 700. The processing unit 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0124] Typically, the following devices can be connected to I / O interface 705: input devices 706 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 707 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 708 including, for example, magnetic tapes, hard disks, etc.; and communication devices 709. Communication device 709 allows electronic device 700 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 7 An electronic device 700 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0125] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 709, or installed from storage device 708, or installed from ROM 702. When the computer program is executed by processing device 701, it performs the functions defined in the methods of embodiments of this disclosure.
[0126] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0127] In some implementations, communication can be conducted using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol), and can be interconnected with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.
[0128] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0129] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: determine a first decision parameter on the client side related to a strategy decision for a target task; in response to obtaining a second decision parameter related to a strategy decision for the target task from a cache, generate a first cache identifier based at least on the first and second decision parameters, wherein the cache is used to store decision parameters and strategy decision results corresponding to the decision parameters, and each strategy decision result is associated with a cache identifier; in response to the existence of a second cache identifier in the cache that is identical to the first cache identifier, determine the strategy decision result corresponding to the second cache identifier in the cache as the strategy decision result corresponding to the target task.
[0130] Computer program code for performing the operations of this disclosure can be written in one or more programming languages or a combination thereof, including but not limited to object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0131] 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 this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in 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 using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0132] The modules described in the embodiments of this disclosure can be implemented in software or hardware. The names of the modules are not, in some cases, intended to limit the module itself.
[0133] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0134] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0135] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0136] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0137] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative forms of implementing the claims. Regarding the apparatus in the above embodiments, the specific manner in which the various modules perform their operations has been described in detail in the embodiments relating to the method, and will not be elaborated upon here.
Claims
1. A task processing method, characterized in that, Applied to the server side, the task processing method includes: Determine the first decision parameters on the client side that are relevant to the strategic decision-making of the target task; In response to obtaining a second decision parameter related to the strategy decision of the target task from the cache, a first cache identifier is generated based on at least the first decision parameter and the second decision parameter, wherein the cache is used to store the decision parameter and the strategy decision result corresponding to the decision parameter, and each strategy decision result is associated with a cache identifier; In response to the existence of a second cache identifier in the cache that is the same as the first cache identifier, the policy decision result corresponding to the second cache identifier in the cache is determined as the policy decision result corresponding to the target task.
2. The task processing method according to claim 1, characterized in that, The first decision parameters include a policy identifier for identifying the policy corresponding to the target task, a cache type for the policy corresponding to the target task in the cache, and relevant condition parameters for determining the decision result of the policy corresponding to the target task. Generating the first cache identifier based at least on the first decision parameters and the second decision parameters includes: Determine the parameter intersection between the relevant condition parameters and the second decision parameters; A first cache identifier is generated based at least on the intersection of the parameters, the policy identifier, and the cache type.
3. The task processing method according to claim 2, characterized in that, The task processing method further includes: Determine the prefix identifier used to identify the policy engine; The step of generating a first cache identifier based at least on the intersection of the parameters, the policy identifier, and the cache type includes: A first cache identifier is generated based on the prefix identifier, the parameter intersection, the policy identifier, and the cache type.
4. The task processing method according to claim 3, characterized in that, The step of generating a first cache identifier based on the prefix identifier, the parameter intersection, the policy decision identifier, and the cache type includes: When the parameters in the parameter intersection include multiple parameters, the parameters in the parameter intersection are concatenated according to a first concatenation order to obtain a parameter sequence. Then, the prefix identifier, the parameter sequence, the policy decision identifier, and the cache type are concatenated according to a second concatenation order to generate a first cache identifier. The first concatenation order is used to indicate the concatenation order of the parameters in the parameter intersection, and the second concatenation order is used to indicate the concatenation order among the prefix identifier, the parameter intersection, the policy decision identifier, and the cache type.
5. The task processing method according to any one of claims 1-4, characterized in that, The task processing method further includes: In response to the failure to obtain a second decision parameter related to the strategy decision of the target task from the cache, or in response to the absence of a second cache identifier identical to the first cache identifier in the cache, a request for obtaining the strategy decision result corresponding to the target task is sent to the strategy engine through a remote procedure call interface. The strategy engine is used to make a decision after receiving the request and generate feedback information for the request. The feedback information includes at least the first strategy decision result. The system receives feedback information from the strategy engine in response to the request and determines the first strategy decision result as the strategy decision result corresponding to the target task.
6. The task processing method according to claim 5, characterized in that, The feedback information also includes decision parameters corresponding to the first strategy decision result, and first information indicating whether to store the first strategy decision result in the cache, further including: In response to the failure to obtain a second decision parameter related to the strategy decision of the target task from the cache, when the first information indicates that the first strategy decision result should be stored in the cache, a third cache identifier is generated at least according to the first decision parameter and the decision parameter corresponding to the first strategy decision result; The third cache identifier is associated with the first policy decision result and stored in the cache, and the decision parameters corresponding to the first policy decision result are also stored in the cache.
7. The task processing method according to claim 5, characterized in that, The feedback information also includes decision parameters corresponding to the first strategy decision result, and first information indicating whether to store the first strategy decision result in the cache, further including: In response to the absence of a second cache identifier identical to the first cache identifier in the cache, when the first information indicates that the first policy decision result should be stored in the cache, the first cache identifier is associated with the first policy decision result and stored in the cache, and the decision parameters corresponding to the first policy decision result are stored in the cache.
8. A task processing method, characterized in that, Applied to the client, the task processing method includes: Determine the first decision parameters on the client side that are relevant to the strategic decision-making of the target task; In response to obtaining a second decision parameter related to the strategy decision of the target task from the cache, a first cache identifier is generated based on the first decision parameter and the second decision parameter, wherein the cache is used to store the decision parameter and the strategy decision result corresponding to the decision parameter, and each strategy decision result is associated with a cache identifier; In response to the existence of a second cache identifier in the cache that is the same as the first cache identifier, the policy decision result corresponding to the second cache identifier in the cache is determined as the policy decision result corresponding to the target task.
9. The task processing method according to claim 8, characterized in that, The task processing method further includes: Determine the policy state of the policy decision results in the cache, the policy state being used to indicate whether the policy decision results are available; The first decision parameters on the client side related to the strategy decision for the target task include: Based on the strategy state, determine the first decision parameters on the client side related to the strategy decision of the target task.
10. The task processing method according to claim 9, characterized in that, The step of determining the first decision parameter on the client side related to the strategy decision of the target task based on the strategy state includes: When the strategy state indicates that the strategy decision result is available, determine the first decision parameter on the client side related to the strategy decision of the target task; or, When the policy state indicates that the policy decision result is unavailable, the decision parameters and / or policy decision results stored in the cache are updated, and after updating the decision parameters and / or policy decision results stored in the cache, the first decision parameter on the client side related to the policy decision of the target task is determined.
11. The task processing method according to claim 9, characterized in that, The step of determining the policy state of the policy decision results in the cache includes: Obtain task policy information related to the client side from the policy engine. The policy engine stores task policy information, which is used to represent information related to the policy decision of the task. Based on the task policy information and the decision parameters in the cache, the policy state of the policy decision results in the cache is determined.
12. The task processing method according to claim 11, characterized in that, Each policy decision result and each decision parameter in the cache is associated with a policy identifier. The task policy information includes the policy identifier of the policy corresponding to the task, the decision parameters associated with the policy identifier, associated second information, and associated third information. The second information is used to indicate whether the policy decision result associated with the policy identifier needs downstream processing, and the third information is used to mark the expiration status of the policy decision result associated with the policy identifier. Determining the policy status of the policy decision results in the cache based on the task policy information and the decision parameters in the cache includes: Determine a first policy identifier that exists simultaneously in the task policy information and the cache; Based on the decision parameters associated with the first policy identifier in the cache, the decision parameters associated with the first policy identifier in the task policy information, the associated second information, and the associated third information, the policy state of the policy decision result associated with the first policy identifier in the cache is determined.
13. The task processing method according to claim 12, characterized in that, The first policy identifier includes multiple identifiers. The step of determining the policy state of the policy decision result associated with the first policy identifier in the cache based on the decision parameters associated with the first policy identifier in the cache, the decision parameters associated with the first policy identifier in the task policy information, the associated second information, and the associated third information includes: For each of the first policy identifiers in the cache, if at least one of the following conditions exists: the second information indicates that the policy decision result needs downstream processing, the third information indicates that the expiration state is expired, or the decision parameters in the task policy information are inconsistent with the decision parameters in the cache, the policy state of the policy decision result associated with the first policy identifier in the cache is determined to be a policy state indicating that the policy decision is unavailable. For each of the first policy identifiers in the cache, if the second information indicates that the policy decision result does not require downstream processing, the expiration status of the third information marker is not expired, and the decision parameters in the task policy information are consistent with the decision parameters in the cache, the policy status of the policy decision result associated with the third cache identifier in the cache is determined to be a policy status indicating that the policy decision is available.
14. The task processing method according to claim 12, characterized in that, Updating the decision parameters and / or policy decision results stored in the cache includes: Delete the policy decision results and decision parameters in the cache except those associated with the first policy identifier; In the first strategy identifier, a second strategy identifier is determined that the strategy state indicates the strategy decision result is unavailable; The policy decision result and / or decision parameters corresponding to the second policy identifier are obtained from the policy engine, and the policy decision result and / or decision parameters associated with the second policy identifier in the cache are replaced.
15. The task processing method according to any one of claims 9-14, characterized in that, The task processing method further includes: Determine the time interval since the last time task policy information related to the client was obtained from the policy engine; The step of determining the policy state of the policy decision results in the cache includes: When the time interval is outside the preset time interval range, the policy state of the policy decision result in the cache is determined.
16. The task processing method according to any one of claims 8-14, characterized in that, The first decision parameters include a policy identifier for identifying the policy corresponding to the target task, a cache type for the policy corresponding to the target task in the cache, and relevant condition parameters for determining the decision result of the policy corresponding to the target task. Generating the first cache identifier based at least on the first decision parameters and the second decision parameters includes: Determine the parameter intersection between the relevant condition parameters and the second decision parameters; A first cache identifier is generated based at least on the intersection of the parameters, the policy identifier, and the cache type.
17. The task processing method according to claim 16, characterized in that, The task processing method further includes: Determine the prefix identifier used to identify the policy engine; The step of generating a first cache identifier based at least on the parameter intersection, the policy decision identifier, and the cache type includes: A first cache identifier is generated based on the prefix identifier, the parameter intersection, the policy decision identifier, and the cache type.
18. The task processing method according to claim 17, characterized in that, The step of generating a first cache identifier based on the prefix identifier, the parameter intersection, the policy decision identifier, and the cache type includes: When the parameters in the parameter intersection include multiple parameters, the parameters in the parameter intersection are concatenated according to a first concatenation order to obtain a parameter sequence. Then, the prefix identifier, the parameter sequence, the policy decision identifier, and the cache type are concatenated according to a second concatenation order to generate a first cache identifier. The first concatenation order is used to indicate the concatenation order of the parameters in the parameter intersection, and the second concatenation order is used to indicate the concatenation order among the prefix identifier, the parameter intersection, the policy decision identifier, and the cache type.
19. A task processing device, characterized in that, The task processing device includes: The first determining module is used to determine the first decision parameters on the client side related to the strategy decision of the target task; The first generation module is configured to, in response to obtaining a second decision parameter related to the strategy decision of the target task from the cache, generate a first cache identifier based on the first decision parameter and the second decision parameter, wherein the cache is used to store the decision parameter and the strategy decision result corresponding to the decision parameter, and each strategy decision result is associated with a cache identifier. The second determining module is used to determine the policy decision result corresponding to the second cache identifier in the cache as the policy decision result corresponding to the target task in response to the existence of a second cache identifier in the cache that is the same as the first cache identifier.
20. A computer-readable medium having a computer program stored thereon, characterized in that, When executed by a processing device, the computer program performs the steps of the method described in any one of claims 1-18.
21. An electronic device, characterized in that, include: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the steps of the method according to any one of claims 1-18.
22. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-18.