CN110381155B - Task management method, device, storage medium and terminal - Google Patents

Task management method, device, storage medium and terminal Download PDF

Info

Publication number
CN110381155B
CN110381155B CN201910678839.3A CN201910678839A CN110381155B CN 110381155 B CN110381155 B CN 110381155B CN 201910678839 A CN201910678839 A CN 201910678839A CN 110381155 B CN110381155 B CN 110381155B
Authority
CN
China
Prior art keywords
task
server
synchronization request
state synchronization
terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910678839.3A
Other languages
Chinese (zh)
Other versions
CN110381155A (en
Inventor
任童童
冯超然
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN201910678839.3A priority Critical patent/CN110381155B/en
Publication of CN110381155A publication Critical patent/CN110381155A/en
Application granted granted Critical
Publication of CN110381155B publication Critical patent/CN110381155B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/62Establishing a time schedule for servicing the requests

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer And Data Communications (AREA)

Abstract

The disclosure relates to a task management method, a task management device, a storage medium and a terminal, and belongs to the field of computer software. The method comprises the following steps: acquiring at least one task instruction for achieving a task from a server, wherein one task instruction is used for instructing the terminal to monitor a type of user behaviors; for any task indication, generating a task state synchronization request based on the monitored user behavior matched with the task indication; reporting the task state synchronization request to the server, and receiving a response message of the task state synchronization request from the server, wherein the response message is a response message of a judgment result for judging whether the task is achieved based on the task state synchronization request and a task achievement condition. According to the embodiment of the disclosure, the terminal actively monitors and reports the task state to the server, and the server does not need to actively monitor the task state, so that a large amount of resources of the server are saved.

Description

Task management method, device, storage medium and terminal
Technical Field
The present disclosure relates to the field of computer software, and in particular, to a method, an apparatus, a storage medium, and a terminal for task management.
Background
Task systems are a common function in the field of computer software, and refer to a mechanism by which a user can obtain a task to achieve a reward by completing a series of task requirements, and are commonly used in game applications. The task design, task acquisition, task achievement judgment and the like are key technologies of the task system. In particular, since task achievement determination is a key for deciding whether to issue a task achievement reward to a user, how to perform task achievement determination becomes an important link of task management.
In the related art, the whole task achievement judging step is completed by the server. For example, the server needs to actively monitor the task status of the terminal side, that is, the server needs to actively monitor the action or behavior of the user on the terminal side, which causes the server to consume a lot of resources. For this reason, how to perform task management becomes a focus of attention of those skilled in the art.
Disclosure of Invention
The present disclosure provides a task management method, device, storage medium, and terminal, to at least solve the problem of large resource occupation on a server in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a task management method, where the method is applied to a terminal, and includes:
acquiring at least one task instruction for achieving a task from a server, wherein one task instruction is used for instructing the terminal to monitor a type of user behaviors;
for any task indication, generating a task state synchronization request based on the monitored user behavior matched with the task indication;
reporting the task state synchronization request to the server;
and receiving a response message of the task state synchronization request from the server, wherein the response message is a response message of a judgment result of judging whether the task is achieved based on the task state synchronization request and a task achievement condition.
In a possible implementation manner, the reporting the task state synchronization request to the server includes:
reporting the task state synchronization request to the server according to a target reporting rule;
the target reporting rule is that the first request is reported in real time, and the non-first request is reported according to a fixed time interval.
In one possible implementation, the obtaining at least one task indication for fulfilling a task from a server includes:
sending a task instruction acquisition request to the server;
and receiving at least one task instruction issued by the server, wherein the at least one task instruction is obtained by converting task description information of the task acquired based on the task instruction acquisition request.
In one possible implementation manner, after the at least one task indication is obtained, the method further includes:
generating a task state structure body of the task indication for any task indication;
the task state structure is used for recording task states, and the task states are updated when user behaviors matched with the task indications are monitored.
In one possible implementation, after receiving a response message of the task state synchronization request from the server, the method further includes:
when the task state synchronization request is reported successfully, updating the task state recorded in the task state structure body indicated by the corresponding task;
and when the report of the task state synchronization request fails, the task state contained in the task state synchronization request is stored in a local cache.
In a possible implementation manner, after saving the task state included in the task state synchronization request to a local cache, the method further includes any one of:
when the server is in a networking state, reporting the task state of the local cache to the server in a task state synchronization request form;
and after the application is started next time, reporting the task state of the local cache to the server in a task state synchronization request mode.
In a possible implementation manner, the reporting the task state synchronization request to the server according to a target reporting rule includes:
and reporting the task state synchronization request to the server in real time when the task state synchronization request is the first request of the task.
And when the task state synchronization request is a non-first request of the task, reporting the task state synchronization request to the server according to the fixed time interval, wherein the fixed time interval is issued by the server.
In a possible implementation manner, after the at least one task indication is obtained, the method further includes:
starting a timer having said fixed time interval;
the reporting the task state synchronization request to the server according to the target reporting rule includes:
and reporting the task state synchronization request to the server according to the fixed time interval based on the timer.
In a possible implementation manner, before reporting the task state synchronization request to the server, the method further includes:
and destroying all task state synchronization requests currently positioned in the request queue.
In one possible implementation, after generating the task state synchronization request, the method further includes:
and after receiving a response message of the last task state synchronization request returned by the server, reporting the current task state synchronization request to the server.
In a possible implementation manner, the receiving, from the server, a response message of the task state synchronization request includes:
receiving a task instruction of a new task issued by the server, and updating a local existing task instruction by the task instruction of the new task;
and the task instruction of the new task is issued by the server after judging that the task is achieved.
According to a second aspect of the embodiments of the present disclosure, there is provided a task management method, which is applied to a server, and includes:
receiving a task indication acquisition request sent by a terminal;
issuing at least one task instruction for achieving a task to the terminal, wherein one task instruction is used for instructing the terminal to monitor a class of user behaviors;
receiving a task state synchronization request reported by the terminal, wherein the task state synchronization request is generated based on the monitored user behavior matched with the task indication for any task indication;
determining whether the task is achieved based on the task state synchronization request and a task achievement condition;
and issuing a response message of the task state synchronization request to the terminal, wherein the response message is the response message of the judgment result for judging whether the task is achieved.
In a possible implementation manner, before issuing the at least one task instruction to the terminal, the method further includes:
acquiring a task list from other servers, wherein the task list comprises a plurality of tasks including the task;
and acquiring task description information of the task, and converting the task description information into the at least one task instruction.
In a possible implementation manner, before receiving a task indication obtaining request sent by a terminal, the method further includes: and issuing the fixed time interval to the terminal.
According to a third aspect of the embodiments of the present disclosure, there is provided a task management device, which is applied to a terminal, and includes:
an acquisition module configured to acquire at least one task instruction for fulfilling a task from a server, one of the task instructions being for instructing the terminal to monitor a class of user behavior;
a first generation module configured to generate a task state synchronization request based on the monitored user behavior matched with the task indication for any one of the task indications;
a reporting module configured to report the task state synchronization request to the server;
a receiving module configured to receive a response message of the task state synchronization request from the server, the response message being a response message of a determination result of whether the task is achieved based on the task state synchronization request and a task achievement condition.
In a possible implementation manner, the reporting module is further configured to report the task state synchronization request to the server according to a target reporting rule;
the target reporting rule is that the first request is reported in real time, and the non-first request is reported according to a fixed time interval.
In one possible implementation manner, the obtaining module includes:
a sending unit configured to send a task instruction acquisition request to the server;
and the receiving unit is configured to receive the at least one task instruction issued by the server, wherein the at least one task instruction is obtained by converting task description information of a task acquired based on the task instruction acquisition request.
In one possible implementation, the apparatus further includes:
the second generation module is configured to generate a task state structural body of the task indication for any one task indication;
the task state structure is used for recording task states, and the task states are updated when user behaviors matched with the task indications are monitored.
In one possible implementation, the apparatus further includes:
the updating module is configured to update the task state recorded in the task state structural body indicated by the corresponding task when the task state synchronization request is reported successfully;
and the cache module is configured to store the task state contained in the task state synchronization request to a local cache when the report of the task state synchronization request fails.
In a possible implementation manner, the reporting module is further configured to report the task state of the local cache to the server in a form of a task state synchronization request when the server is in a networking state; and after the application is started next time, reporting the task state of the local cache to the server in a task state synchronization request mode.
In a possible implementation manner, the reporting module is further configured to report the task state synchronization request to the server in real time when the task state synchronization request is the first request of the task; and when the task state synchronization request is a non-first request of the task, reporting the task state synchronization request to the server according to the fixed time interval, wherein the fixed time interval is issued by the server.
In one possible implementation, the apparatus further includes:
a timer module configured to start a timer having the fixed time interval;
the reporting module is further configured to report the task state synchronization request to the server at the fixed time interval based on the timer.
In one possible implementation, the apparatus further includes:
and the destruction module is configured to destroy each task state synchronization request currently located in the request queue.
In a possible implementation manner, the reporting module is further configured to report the current task state synchronization request to the server after receiving a response message of a last task state synchronization request returned by the server.
In one possible implementation manner, the receiving module includes:
the receiving unit is configured to receive a task instruction of a new task issued by the server;
an updating unit configured to update a locally existing task indication with a task indication of the new task;
and the task instruction of the new task is issued by the server after judging that the task is achieved.
According to a fourth aspect of the embodiments of the present disclosure, there is provided a task management device, which is applied to a server, including:
the system comprises a first receiving module, a second receiving module and a processing module, wherein the first receiving module is configured to receive a task indication acquisition request sent by a terminal;
the first sending module is configured to issue at least one task instruction for achieving a task to the terminal, wherein one task instruction is used for instructing the terminal to monitor a class of user behaviors;
the second receiving module is configured to receive a task state synchronization request reported by the terminal, wherein the task state synchronization request is generated based on the monitored user behavior matched with the task indication for any task indication;
a determination module configured to determine whether the task is fulfilled based on the task state synchronization request and a task fulfillment condition;
and the second sending module is configured to issue a response message of the task state synchronization request to the terminal, wherein the response message is a response message of a judgment result for judging whether the task is achieved.
In one possible implementation, the apparatus further includes:
the acquisition module is configured to acquire a task list from other servers, wherein the task list comprises a plurality of tasks including the task;
the acquisition module is further configured to acquire task description information of the task;
a conversion module configured to convert the task description information into the at least one task indication.
In a possible implementation manner, the sending module is further configured to issue the fixed time interval to the terminal.
According to a fifth aspect of the embodiments of the present disclosure, there is provided a terminal, including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the task management method according to the first aspect.
According to a sixth aspect of embodiments of the present disclosure, there is provided a server including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the task management method according to the second aspect.
According to a seventh aspect of embodiments of the present disclosure, there is provided a storage medium, wherein instructions, when executed by a processor of a terminal, enable the terminal to perform the task management method according to the first aspect.
According to an eighth aspect of embodiments of the present disclosure, there is provided a storage medium having instructions that, when executed by a processor of a server, enable the server to perform the task management method according to the second aspect.
According to a ninth aspect of embodiments of the present disclosure, there is provided a computer program product, wherein instructions of the computer program product, when executed by a processor of a terminal, enable the terminal to perform the task management method according to the first aspect.
According to a tenth aspect of embodiments of the present disclosure, there is provided a computer program product, wherein instructions of the computer program product, when executed by a processor of a server, enable the server to perform the task management method according to the second aspect.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
in the task achievement judging process, the terminal can obtain at least one task instruction for achieving the task from the server, wherein one task instruction is used for instructing the terminal to monitor one type of user behaviors; and then, for any task indication, the terminal generates a task state synchronization request based on the monitored user behavior matched with the task indication, reports the task state synchronization request to the server, and further receives a response message of the task state synchronization request from the server, wherein the response message is a judgment result of judging whether the task is achieved or not by the server based on the task state synchronization request and the task achievement condition. According to the embodiment of the disclosure, the terminal actively monitors the action or behavior of the user on the terminal side, namely, the terminal actively monitors and reports the task state to the server, and the server does not need to actively monitor the task state, so that a large amount of resources of the server are saved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a schematic diagram illustrating an implementation environment involved with a method of task management according to an example embodiment.
FIG. 2 is a flowchart illustrating a method of task management according to an example embodiment.
FIG. 3 is a flowchart illustrating a method of task management according to an example embodiment.
FIG. 4 is a flowchart illustrating a method of task management according to an example embodiment.
FIG. 5 is a flow diagram illustrating the overall execution of a task achievement decision, according to an exemplary embodiment.
Fig. 6 is a flowchart illustrating a task status reporting performed by a terminal according to an exemplary embodiment.
FIG. 7 is a block diagram illustrating a task management device according to an example embodiment.
FIG. 8 is a block diagram illustrating a task management device according to an example embodiment.
Fig. 9 is a block diagram illustrating a terminal according to an example embodiment.
FIG. 10 is a block diagram illustrating a server in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims. In addition, the user information to which the present disclosure relates may be information authorized by the user or sufficiently authorized by each party.
Before explaining the embodiments of the present disclosure in detail, some terms related to the embodiments of the present disclosure are explained.
A task system: the function is a common function in the field of computer software, and refers to a mechanism by which a user can obtain a task to achieve a reward by completing a series of task requirements, and is commonly found in game applications. The task design, task acquisition, task achievement judgment and the like are key technologies of the task system.
Long connection: it means that a plurality of data packets can be continuously transmitted on one connection, and if no data packet is transmitted during the connection holding period, a link detection packet needs to be transmitted by two parties.
That is, when an HTTP (HyperText Transfer Protocol) sends a request, a TCP (Transmission Control Protocol) connection is created first, and the content of the HTTP request is sent to the server over the TCP connection, so that a request is completed. And then, the terminal and the server negotiate whether to close the TCP link, if the TCP link is not closed, resource consumption is generated, a large amount of resources of the server are occupied, but if a request exists subsequently, the request can be directly sent on the TCP link without three-way handshake operation.
Short connection: the concept of long connection refers to that during data transmission, a TCP connection is established only when data needs to be sent, and after the data is sent, the TCP connection is disconnected, that is, only one request is sent per TCP connection.
In the related art, the whole task achievement judging step is completed by the server at present. For example, for a task with a high real-time requirement, the server performs task state synchronization in real time based on a long connection mode, which is often applied to a scene requiring real-time synchronization such as a network game, and because the task state synchronization is required in real time in this mode, a large amount of resources of the server need to be occupied, the pressure of the server is greatly increased, and the requirement on server resources is too high. For tasks with low real-time requirements, the server currently adopts a non-real-time task state counting mechanism to perform task achievement judgment. For example, the task state statistics is performed once in whole at a time point after the task ends. In view of the above, although the resource requirement on the server is low, the problem of poor user experience due to delayed determination exists due to untimely task state statistics. In addition, in some special cases, the task achievement decision is not fulfilled by the server. For example, if some operations of the terminal in the offline state are completed, the server cannot be obtained.
Based on this, the embodiment of the disclosure provides a task management method for task achievement determination, which can not only ensure user experience, but also save server resources, and can also handle special situations such as offline tasks.
The following describes an implementation environment related to a task management method provided by an embodiment of the present disclosure.
Referring to fig. 1, the implementation environment includes a terminal 101 and a server 102.
The type of the terminal 101 includes, but is not limited to, a mobile smart terminal device such as a smart phone, a tablet computer, and the like, which is not specifically limited in this disclosure. As an example, a specific application program may be installed on the terminal 101, and the terminal 101 performs data transmission with the server 102 through the specific application program. In addition, the server 102 may be a single server or a cluster of servers.
Since user actions or user behaviors such as permission granting and video watching generally occur on the terminal 101, and in the task achievement determination process, if the server 102 actively monitors whether the user actions or user behaviors occur, a large amount of resources are often consumed, for this reason, in the embodiment of the present disclosure, the terminal 101 actively monitors and informs the server 102 of a task state, so that resource consumption of the server is reduced, and the server 102 is only responsible for performing task achievement determination based on the task state reported by the terminal 101. The task state is obtained by monitoring and recording the action or behavior of the user generated on the terminal side by the terminal 101.
In addition, some tasks can be achieved only by a large number of user actions or user behaviors, therefore, the embodiment of the disclosure also provides a mechanism for managing task state reporting, namely, the first request is reported in real time, and the non-first request is reported according to a fixed time interval issued by a server, so that server pressure caused by a large number of frequent task state reports is avoided.
In another expression, the embodiment of the present disclosure further reduces the pressure of the server through a time interval policy on the basis of ensuring timely reporting of the task state. That is, the problem of poor user experience caused by a non-real-time mode is solved, server resources are saved, and the burden of the server is reduced.
In addition, the embodiment of the disclosure further provides a mechanism for caching the task state, and the mechanism is based on the active monitoring of the task state by the terminal 101 and the task state caching mechanism, so that the problem that the offline task cannot be judged and synchronized when the task is judged only by the server alone can be solved.
To sum up, the embodiment of the present disclosure not only solves the problem of determining and synchronizing the offline task, but also solves the problem of poor user experience caused by a non-real-time manner. Namely, the embodiment of the disclosure saves server resources and reduces the burden of the server while ensuring relative timeliness.
A task management method provided by an embodiment of the present disclosure is explained in detail below.
Fig. 2 is a flowchart illustrating a task management method, as shown in fig. 2, for use in a terminal according to an exemplary embodiment, including the following steps.
In step 201, at least one task instruction for fulfilling a task is obtained from a server, and one task instruction is used for instructing a terminal to monitor a type of user behavior.
In step 202, for any task indication, a task state synchronization request is generated based on the monitored user behavior matching the task indication.
In step 203, the task state synchronization request is reported to the server.
In step 204, a response message of the task state synchronization request is received from the server, wherein the response message is a response message of a determination result of whether the task is achieved or not is determined based on the task state synchronization request and the task achievement condition.
In the method provided by the embodiment of the disclosure, in the task achievement judging process, the terminal can obtain at least one task instruction for achieving the task from the server, wherein one task instruction is used for instructing the terminal to monitor one type of user behaviors; and then, for any task indication, the terminal generates a task state synchronization request based on the monitored user behavior matched with the task indication, reports the task state synchronization request to the server, and further receives a response message of the task state synchronization request from the server, wherein the response message is a judgment result of judging whether the task is achieved or not by the server based on the task state synchronization request and the task achievement condition. According to the embodiment of the disclosure, the terminal actively monitors the action or behavior of the user on the terminal side, namely, the terminal actively reports the task state to the server, and the server does not need to actively monitor the task state, so that a large amount of resources of the server are saved.
In a possible implementation manner, the reporting the task state synchronization request to the server includes:
reporting the task state synchronization request to the server according to a target reporting rule;
the target reporting rule is that the first request is reported in real time, and the non-first request is reported according to a fixed time interval.
In one possible implementation, the obtaining at least one task indication for fulfilling a task from a server includes:
sending a task instruction acquisition request to the server;
and receiving at least one task instruction issued by the server, wherein the at least one task instruction is obtained by converting task description information of the task acquired based on the task instruction acquisition request.
In one possible implementation manner, after the at least one task indication is obtained, the method further includes:
generating a task state structure body of the task indication for any task indication;
the task state structure is used for recording task states, and the task states are updated when user behaviors matched with the task indications are monitored.
In one possible implementation, after receiving a response message of the task state synchronization request from the server, the method further includes:
when the task state synchronization request is reported successfully, updating the task state recorded in the task state structure body indicated by the corresponding task;
and when the report of the task state synchronization request fails, the task state contained in the task state synchronization request is stored in a local cache.
In a possible implementation manner, after saving the task state included in the task state synchronization request to a local cache, the method further includes any one of:
when the server is in a networking state, reporting the task state of the local cache to the server in a task state synchronization request form;
and after the application is started next time, reporting the task state of the local cache to the server in a task state synchronization request mode.
In a possible implementation manner, the reporting the task state synchronization request to the server according to a target reporting rule includes:
and reporting the task state synchronization request to the server in real time when the task state synchronization request is the first request of the task.
And when the task state synchronization request is a non-first request of the task, reporting the task state synchronization request to the server according to the fixed time interval, wherein the fixed time interval is issued by the server.
In a possible implementation manner, after the at least one task indication is obtained, the method further includes:
starting a timer having said fixed time interval;
the reporting the task state synchronization request to the server according to the target reporting rule includes:
and reporting the task state synchronization request to the server according to the fixed time interval based on the timer.
In a possible implementation manner, before reporting the task state synchronization request to the server, the method further includes:
and destroying all task state synchronization requests currently positioned in the request queue.
In one possible implementation, after generating the task state synchronization request, the method further includes:
and after receiving a response message of the last task state synchronization request returned by the server, reporting the current task state synchronization request to the server.
In a possible implementation manner, the receiving, from the server, a response message of the task state synchronization request includes:
receiving a task instruction of a new task issued by the server, and updating a local existing task instruction by the task instruction of the new task;
and the task instruction of the new task is issued by the server after judging that the task is achieved.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
Fig. 3 is a flowchart illustrating a task management method, as shown in fig. 3, for use in a server, according to an example embodiment, including the following steps.
In step 301, a task instruction acquisition request sent by a terminal is received.
In step 302, at least one task instruction for accomplishing a task is issued to the terminal, and one task instruction is used for instructing the terminal to monitor a type of user behavior.
In step 303, a task state synchronization request reported by the terminal is received, where the task state synchronization request is generated based on the monitored user behavior matched with the task indication for any task indication.
In step 304, it is determined whether a task is fulfilled based on the task state synchronization request and the task fulfillment condition.
In step 305, a response message of the task state synchronization request is issued to the terminal, and the response message is a response message of a determination result for determining whether the task is achieved.
In the method provided by the embodiment of the disclosure, in the task achievement judging process, the terminal can obtain at least one task instruction for achieving the task from the server, wherein one task instruction is used for instructing the terminal to monitor one type of user behaviors; and then, for any task indication, the terminal generates a task state synchronization request based on the monitored user behavior matched with the task indication, reports the task state synchronization request to the server, and further receives a response message of the task state synchronization request from the server, wherein the response message is a judgment result of judging whether the task is achieved or not by the server based on the task state synchronization request and the task achievement condition. According to the embodiment of the disclosure, the terminal actively monitors the action or behavior of the user on the terminal side, namely, the terminal actively reports the task state to the server, and the server does not need to actively monitor the task state, so that a large amount of resources of the server are saved.
In a possible implementation manner, before issuing the at least one task instruction to the terminal, the method further includes:
acquiring a task list from other servers, wherein the task list comprises a plurality of tasks including the task;
and acquiring task description information of the task, and converting the task description information into the at least one task instruction.
In a possible implementation manner, before receiving a task indication obtaining request sent by a terminal, the method further includes: and issuing the fixed time interval to the terminal.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
Fig. 4 is a flowchart illustrating a task management method according to an exemplary embodiment, in which an interaction subject is a terminal and a server. The task management method provided by the embodiment of the present disclosure will now be explained in detail with reference to fig. 5 and 6. Referring to fig. 4, a method flow provided by the embodiment of the present disclosure includes:
in step 401, the terminal sends a task instruction acquisition request to the server.
In the embodiment of the disclosure, the terminal does not need to care what a specific task is, whether the task is achieved or not, and does not need to perform task achievement judgment, the terminal only needs to monitor the corresponding operation behavior of the user on the terminal according to the task indication issued by the server, form the task state and report the task state to the server, so as to complete task state synchronization, and the server performs task achievement judgment according to the synchronized task state.
The task indication is used for indicating which user behavior or user action the terminal monitors. That is, a task indication is used to instruct the terminal to monitor a type of user behavior or a type of user action. As an example, assuming that one task is for the user to grant positioning rights, the corresponding task indication may be to monitor the user's consent authorization action.
In a possible implementation manner, the terminal may send a task indication acquisition request to the server once after a specific application is started each time, which is not specifically limited in this embodiment of the present disclosure.
In the embodiment of the disclosure, the task indication obtaining request may be an HTTP request, and the HTTP request is based on an HTTP short connection, so as to reduce resource overhead of the server.
In step 402, the server obtains task description information of a task, converts the task description information of the task into at least one task instruction, and sends the at least one task instruction to the terminal.
In one possible implementation, as shown in fig. 5, the server includes, in detail, a task server and a task configuration server. The task configuration server is specially used for configuring one or more tasks to form a task list, and the task list comprises one or more tasks. Referring to fig. 5, step 402 can be subdivided into the following two steps:
4021. and after receiving a task instruction request of the terminal, the task server acquires a task list from the task configuration server.
4022. The task server converts the task description information of one task in the task list into at least one task instruction and sends the task instruction to the terminal.
The first point to be noted is that a task may correspond to only one task indication, such as only including user authorized positioning; a task may also include multiple task indications, including, for example, user authorized location + number of videos watched recorded.
The second point to be noted is that, in the embodiment of the present disclosure, the task configuration server is only used for configuring the task, and unless otherwise specified, the servers appearing in the embodiment of the present disclosure all refer to the task server.
In a possible implementation manner, the task may be a task randomly selected from a task list, or may be a task screened according to a preset condition, for example, screening according to conditions such as time or area, which is not specifically limited in this embodiment of the disclosure.
The task description information is converted into a task instruction, that is, a task rule is converted into a user action or behavior which is notified to the terminal and should be monitored. As an example, assume that the task rule set forth by the task description information of a task is: the total time for the user to grant the specific permission, see the videos and see the videos reaches 20 + 20 minutes, and after the conversion, the corresponding task instructions may be: monitoring the action of agreeing to authorization of the user, recording the total time of watching the video and recording the number of watching the video.
In a possible implementation manner, the terminal and the server may agree in advance to record the operation behavior executed by the user on the terminal by using the corresponding field and the manner of assigning values to the field. For example, for the location authorized by the user, an "authorized location" field may be defined, and a value of "1" in the field is agreed to represent that the user is authorized, and a value of "0" in the field represents that the user is not authorized.
It should be noted that the authority may be a positioning authority or an address book authority, and this is not specifically limited in the embodiment of the present disclosure. The task rule constitutes a task achievement condition for the task.
In step 403, the terminal generates a task status structure indicated by each task and starts a timer with a fixed time interval.
In the embodiment of the present disclosure, referring to fig. 5 and fig. 6, after the terminal obtains the task instruction, a corresponding task state structure is generated. The task state structure is used for recording task states, and one task indication corresponds to one task state structure. For a task instruction, whenever the user behavior matched with the task instruction is monitored, task state recording is carried out, namely the task state is updated.
As an example, taking user authorized location as an example, initially, the task state structure of the user authorized location may be { "authorized location": 0 "}, and after the user performs an authorized location operation on the terminal, the corresponding task state changes, and at this time, the task state structure of the user authorized location changes to {" authorized location ": 1" }.
In a possible implementation manner, after the terminal obtains the task indication, the terminal also starts a timer with a fixed time interval, so as to perform task state synchronization according to the timer. The fixed time interval is issued to the terminal by the server, namely the time interval is issued by the server, so that the time interval for the task state synchronization of the terminal is controlled, and the pressure of the server is reduced by the mode. As an example, the fixed time interval may be issued by the server to the terminal when the specific application is first started, which is not specifically limited in this disclosure.
In step 404, for any task indication, the terminal generates a task state synchronization request based on the monitored user behavior matched with the task indication, and reports the task state synchronization request to the server.
In the embodiment of the disclosure, when the terminal monitors that the user performs the operation matched with a certain task instruction, the corresponding task state is recorded.
Taking user authorized location as an example, after a user performs an authorized location operation on a terminal, recording a task state { "authorized location": 1 "} and simultaneously generating a task state synchronization request, where the task state synchronization request carries the recorded task state.
Taking the example of recording the number of videos to be watched as an example, in a fixed time interval of one timer, each time after the user performs a video playing operation on the terminal, the task state is updated once, and the number of videos to be watched is increased by one. As an example, for a case where one task indication contains a large number of user actions or user behaviors, the terminal may generate a task state synchronization request according to a fixed time interval of a timer. That is, a task state synchronization request is generated once every time a fixed time interval is reached. For example, if the fixed time interval is satisfied after 5 videos are watched, a task state synchronization request is generated, where the task state synchronization request carries the recorded number of videos watched 5.
In another possible implementation manner, after the task state synchronization request is generated, the embodiment of the present disclosure may report the task synchronization request according to a set target reporting rule. Namely, reporting a task state synchronization request to a server includes the following two cases:
4041. and when the task state synchronization request is the first request of the task, the terminal reports the task state synchronization request to the server in real time.
That is, before a task state synchronization request is synchronized, a determination is made to determine whether the task state synchronization request is first triggered by the task, and if the task state synchronization request is first triggered, the task state synchronization request is immediately reported.
4042. And when the task state synchronization request is a non-first request of the task, the terminal reports the task state synchronization request to the server at a fixed time interval based on the timer.
The step is to judge whether a fixed time interval for reporting issued by the server is met, if the fixed time interval is met, the terminal reports to the server, otherwise, the terminal does not report for the moment until the fixed time interval is met and then reports. The mode is matched with the timer, so that the pressure of the server is reduced while the task reporting is ensured to have certain timeliness.
In another possible implementation manner, each time the terminal triggers the task state synchronization request, the request which is previously positioned in the request queue is cancelled. That is, before the terminal reports the task state synchronization request to the server, the method further includes:
step a, the terminal destroys all task state synchronization requests currently located in the request queue.
For example, taking the number of videos watched by the user as an example, assuming that the user meets the fixed time interval after watching 5 videos, the terminal generates a corresponding task state synchronization request and reports the task state synchronization request, but the corresponding HTTP request is not sent out because the network speed is not good, and the terminal is currently still in the request queue to wait for the return of the previous request. However, the number of videos watched by the user during the waiting period has reached 7, and the task synchronization request for the number of videos 7 is newly generated, the previously generated task synchronization request for the number of videos 5 may be destroyed.
In another possible implementation, the task state synchronization request is executed serially, i.e. only after the last request is returned, the next request is started. That is, after the terminal generates the task state synchronization request, the method further includes:
and b, after receiving a response message of the last task state synchronization request returned by the server, reporting the current task state synchronization request to the server.
In another possible implementation manner, an embodiment of the present disclosure further includes:
and c, when the task state synchronization request is reported successfully, updating the task state recorded in the task state structural body indicated by the corresponding task.
Aiming at the step, when the task state synchronization request is reported successfully, the terminal updates the local task state and clears the local cache.
In one possible implementation, updating the local task state refers to updating the task state indicated by the corresponding task to an initial state. As an example, the embodiment of the present disclosure adopts an incremental reporting manner, for example, if the task state synchronization request reports that the number of videos to be viewed is 5, then after the task state synchronization request is successfully reported, updating the local task state means setting the number of videos to be viewed to be 0, and clearing the number of videos to be viewed recorded in the local cache. If the user watches 2 videos in the timing period of the new timer, the newly generated task synchronization state request records the number of the watched videos to be 2 and reports the number to the server, and the server is responsible for recording the total number of the watched videos to be 7.
And d, when the task state synchronization request fails to be reported, saving the task state contained in the task state synchronization request to a local cache.
For the step, the task state synchronization request can not be reported due to the reason that the network state is not good and the like.
In the embodiment of the disclosure, in order to implement offline task determination and synchronization, when a task state synchronization request fails to report, the terminal stores a corresponding task state in a local cache. For example, if a task state synchronization request reports a video watching number of 5, the terminal may store the task state of the video watching number of 5 to a local cache after the task state synchronization request fails to report.
In a possible implementation manner, after the task state included in the task state synchronization request is stored in the local cache, the task state may be reported again at a time in a subsequent process, that is, the method further includes any one of the following:
step e, when in the networking state, reporting the task state of the local cache to the server in the form of a task state synchronization request; or after the application is started next time, reporting the task state of the local cache to the server in the form of a task state synchronization request.
In summary, the mechanism that the terminal actively monitors the user behavior or the user action, reports the data cached locally and the local cache mechanism can solve the problem of judgment and synchronization of the offline task.
In step 405, the server determines whether the task is achieved based on the task state synchronization request and the task achievement condition reported by the terminal.
In the embodiment of the disclosure, after receiving the data actively reported by the terminal, the server records the data actively reported by the terminal, and performs task achievement judgment based on the data actively reported by the terminal.
Assume that the task achievement conditions for this task are: the user grants the positioning authority and the number of the videos reaches 20, if the task state synchronization request reported by the terminal is used for informing the server of the task state { "authorized location": 1 "}, the server indicates that the user has authorized the positioning, the server determines that the user grants the positioning authority in the task achievement condition is achieved, if the number of the videos watched by the user is 15 at the moment, the server cannot judge that the task is achieved, because the task achievement also needs to meet the requirement that the number of the videos watched reaches 20 until the number of the videos watched by the user reaches 20, and the server judges that the task is achieved.
In addition, in the embodiment of the present disclosure, the server may also issue a response message of the task state synchronization request to the terminal, that is, the terminal may receive the response message of the task state synchronization request from the server. Wherein, the response message is the response message of the judgment result of judging whether the task is achieved. In a possible implementation manner, the steps c and d may be performed after the terminal receives the response message from the server, and this is not particularly limited in the embodiment of the present disclosure.
In another possible implementation, the response message of the task state synchronization request is received from the server, including but not limited to: receiving a task instruction of a new task issued by a server, and updating a local existing task instruction by the task instruction of the new task; wherein, the task instruction of the new task is issued by the server after judging that the task is completed. That is, the disclosed embodiment further includes the following steps 406 and 407.
In step 406, after the task is completed, the server issues a task instruction of the new task to the terminal.
In the embodiment of the disclosure, after judging that a task is achieved, the server updates the existing task indication of the terminal by using the task indication of a new task, so that on one hand, the terminal is prevented from continuously recording the achieved task, and resource waste is caused; another aspect is to start the next new task. As an example, the new task may be a current task that is chronologically up-to-date, which is not specifically limited by the embodiments of the present disclosure.
In step 407, the terminal receives the task instruction of the new task issued by the server, and updates the local existing task instruction with the task instruction of the new task.
After the task indication of the new task reaches the terminal, the terminal updates the local existing task indication by the task indication of the new task, and meanwhile, the task state related to the last achieved task and the local cache are emptied.
The method provided by the embodiment of the disclosure has at least the following beneficial effects:
in the task achievement judging process, the terminal can obtain at least one task instruction for achieving the task from the server, wherein one task instruction is used for instructing the terminal to monitor one type of user behaviors; and then, for any task indication, the terminal generates a task state synchronization request based on the monitored user behavior matched with the task indication, reports the task state synchronization request to the server, and further receives a response message of the task state synchronization request from the server, wherein the response message is a judgment result of judging whether the task is achieved or not by the server based on the task state synchronization request and the task achievement condition. According to the embodiment of the disclosure, the terminal actively monitors the action or behavior of the user on the terminal side, namely, the terminal actively reports the task state to the server, and the server does not need to actively monitor the task state, so that a large amount of resources of the server are saved.
In addition, when the terminal reports the task state synchronization request, the terminal reports the first request in real time, and the non-first request reports according to the fixed time interval, so that the server resources can be saved while the relative timeliness is ensured.
In addition, the embodiment of the disclosure further provides a mechanism for caching the task state, and the mechanism is based on the active monitoring of the task state by the terminal and the task state caching mechanism, so that the problem that the offline task cannot be judged and synchronized when the task is judged only by the server alone can be solved.
In another exemplary embodiment, the overall implementation of a task achievement decision provided by an embodiment of the present disclosure is now described with reference to fig. 5. Referring to fig. 5, it includes:
in step 501, the terminal obtains a task instruction from a task server.
The terminal can send an HTTP request to the task server through the installed specific application program to acquire the task indication.
In step 502, the task server obtains a task list from the task configuration server.
In step 503, the task configuration server returns the configured task list to the task server.
In step 504, the task server converts the task description information of one task in the task list into a task instruction, and sends the obtained task instruction to the terminal.
In step 505, after the terminal successfully obtains the task instruction, it generates a corresponding task state structure for recording the task state, and starts a timer with a fixed time interval.
In step 506, the terminal monitors the user behavior matched with the task indication, records the task state, and reports a task state synchronization request to the task server.
Aiming at the step, the terminal is matched with the timer, so that the timeliness of task reporting can be guaranteed, and no overlarge burden is caused on the server.
In step 507, the task server records the reported task state and performs task achievement judgment; when the task is completed, the task indication is updated.
In step 508, the task server returns a task indication of the new task to the terminal.
In step 509, after receiving the task instruction of the new task issued by the server, the terminal updates the local existing task instruction with the task instruction of the new task.
In addition, a process of reporting a task state by a terminal according to an embodiment of the present disclosure is shown in fig. 6, and includes:
step a, the terminal starts a specific application program.
And step b, the terminal acquires the task indication.
And c, if the task instruction is successfully acquired, executing the following step d.
And d, generating a corresponding task state structural body by the terminal.
And e, the terminal starts a timer with a fixed time interval.
In another possible implementation, the terminal destroys the timer if at some point the task indication is no longer present.
In addition, the embodiment of the disclosure also has a cache mechanism, and after the specific application program is started, the terminal can read the local cache; and if the task state which cannot be reported successfully is stored in the local cache, the terminal reads the local cache and triggers the task state synchronization.
And f, entering a task state synchronization stage.
And g, the terminal judges whether the report is carried out for the first time or meets the report time interval.
And h, if the terminal judges that the report is carried out for the first time or the report time interval is met, canceling the request in the request queue before, and initiating the request.
And step i, if the request is successful, the terminal updates the task state and clears the local cache.
And j, if the request fails, the terminal stores the current task state to a local cache.
Additionally, as shown in FIG. 6, task state updates are triggered whenever a user action or user behavior occurs that matches a task indication, or possibly request synchronization.
According to the embodiment of the disclosure, the terminal actively monitors the action or behavior of the user on the terminal side, namely, the terminal actively reports the task state to the server, and the server does not need to actively monitor the task state, so that a large amount of resources of the server are saved. In addition, when the terminal reports the task state synchronization request, the terminal reports the first request in real time, and the non-first request reports according to the fixed time interval, so that the server resources can be saved while the relative timeliness is ensured. In addition, the embodiment of the disclosure further provides a mechanism for caching the task state, and the mechanism is based on the active monitoring of the task state by the terminal and the task state caching mechanism, so that the problem that the offline task cannot be judged and synchronized when the task is judged only by the server alone can be solved.
FIG. 7 is a block diagram illustrating a task management device according to an example embodiment. Referring to fig. 7, the apparatus includes an obtaining module 701, a first generating module 702, a reporting module 703 and a receiving module 704.
An obtaining module 701 configured to obtain at least one task instruction for accomplishing a task from a server, one task instruction being used for instructing the terminal to monitor a type of user behavior;
a first generating module 702 configured to generate a task state synchronization request for any one of the task indications based on the monitored user behavior matching the task indication;
a reporting module 703 configured to report the task state synchronization request to the server;
a receiving module 704 configured to receive a response message of the task state synchronization request from the server, where the response message is a response message of a determination result of determining whether the task is achieved based on the task state synchronization request and a task achievement condition.
According to the device provided by the embodiment of the disclosure, in the task achievement judging process, the terminal can obtain at least one task instruction for achieving a task from the server, wherein one task instruction is used for instructing the terminal to monitor one type of user behaviors; and then, for any task indication, the terminal generates a task state synchronization request based on the monitored user behavior matched with the task indication, reports the task state synchronization request to the server, and further receives a response message of the task state synchronization request from the server, wherein the response message is a judgment result of judging whether the task is achieved or not by the server based on the task state synchronization request and the task achievement condition. According to the embodiment of the disclosure, the terminal actively monitors the action or behavior of the user on the terminal side, namely, the terminal actively reports the task state to the server, and the server does not need to actively monitor the task state, so that a large amount of resources of the server are saved.
In a possible implementation manner, the reporting module is further configured to report the task state synchronization request to the server according to a target reporting rule;
the target reporting rule is that the first request is reported in real time, and the non-first request is reported according to a fixed time interval.
In one possible implementation manner, the obtaining module includes:
a sending unit configured to send a task instruction acquisition request to the server;
and the receiving unit is configured to receive the at least one task instruction issued by the server, wherein the at least one task instruction is obtained by converting task description information of a task acquired based on the task instruction acquisition request.
In one possible implementation, the apparatus further includes:
the second generation module is configured to generate a task state structural body of the task indication for any one task indication;
the task state structure is used for recording task states, and the task states are updated when user behaviors matched with the task indications are monitored.
In one possible implementation, the apparatus further includes:
the updating module is configured to update the task state recorded in the task state structural body indicated by the corresponding task when the task state synchronization request is reported successfully;
and the cache module is configured to store the task state contained in the task state synchronization request to a local cache when the report of the task state synchronization request fails.
In a possible implementation manner, the reporting module is further configured to report the task state of the local cache to the server in a form of a task state synchronization request when the server is in a networking state; and after the application is started next time, reporting the task state of the local cache to the server in a task state synchronization request mode.
In a possible implementation manner, the reporting module is further configured to report the task state synchronization request to the server in real time when the task state synchronization request is the first request of the task; and when the task state synchronization request is a non-first request of the task, reporting the task state synchronization request to the server according to the fixed time interval, wherein the fixed time interval is issued by the server.
In one possible implementation, the apparatus further includes:
a timer module configured to start a timer having the fixed time interval;
the reporting module is further configured to report the task state synchronization request to the server at the fixed time interval based on the timer.
In one possible implementation, the apparatus further includes:
and the destruction module is configured to destroy each task state synchronization request currently located in the request queue.
In a possible implementation manner, the reporting module is further configured to report the current task state synchronization request to the server after receiving a response message of a last task state synchronization request returned by the server.
In one possible implementation, the receiving module includes:
the receiving unit is configured to receive a task instruction of a new task issued by the server;
an updating unit configured to update a locally existing task indication with a task indication of the new task;
and the task instruction of the new task is issued by the server after judging that the task is achieved.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
FIG. 8 is a block diagram illustrating a task management device according to an example embodiment. The apparatus is applied to a server, and referring to fig. 8, the apparatus includes a first receiving module 801, a first sending module 802, a second receiving module 803, a determining module 804 and a second sending module 805.
A first receiving module 801 configured to receive a task indication acquisition request sent by a terminal;
a first sending module 802, configured to issue at least one task instruction for reaching a task to the terminal, where one task instruction is used to instruct the terminal to monitor a type of user behavior;
a second receiving module 803, configured to receive a task state synchronization request reported by the terminal, where the task state synchronization request is generated based on a monitored user behavior matched with a task instruction for any task instruction;
a decision module 804 configured to decide whether the task is fulfilled based on the task state synchronization request and the task fulfillment condition;
a second sending module 805 configured to issue a response message of the task state synchronization request to the terminal, where the response message is a response message of the determination result of determining whether the task is achieved.
According to the device provided by the embodiment of the disclosure, in the task achievement judging process, the terminal can obtain at least one task instruction for achieving a task from the server, wherein one task instruction is used for instructing the terminal to monitor one type of user behaviors; and then, for any task indication, the terminal generates a task state synchronization request based on the monitored user behavior matched with the task indication, reports the task state synchronization request to the server, and further receives a response message of the task state synchronization request from the server, wherein the response message is a judgment result of judging whether the task is achieved or not by the server based on the task state synchronization request and the task achievement condition. According to the embodiment of the disclosure, the terminal actively monitors the action or behavior of the user on the terminal side, namely, the terminal actively reports the task state to the server, and the server does not need to actively monitor the task state, so that a large amount of resources of the server are saved.
In one possible implementation, the apparatus further includes:
the acquisition module is configured to acquire a task list from other servers, wherein the task list comprises a plurality of tasks including the task;
the acquisition module is further configured to acquire task description information of the task;
a conversion module configured to convert the task description information into the at least one task indication.
In a possible implementation manner, the sending module is further configured to issue the fixed time interval to the terminal.
All the above optional technical solutions may be combined arbitrarily to form the optional embodiments of the present disclosure, and are not described herein again.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 9 is a block diagram illustrating a terminal 900 according to an example embodiment.
The terminal 900 may be a portable mobile terminal such as: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4), a notebook computer, or a desktop computer. Terminal 900 may also be referred to by other names such as user equipment, portable terminals, laptop terminals, desktop terminals, and the like.
In general, terminal 900 includes: a processor 901 and a memory 902.
Processor 901 may include one or more processing cores, such as a 4-core processor, an 8-core processor, and so forth. The processor 901 may be implemented in at least one hardware form of a DSP (Digital Signal Processing), an FPGA (Field-Programmable Gate Array), and a PLA (Programmable Logic Array). The processor 901 may also include a main processor and a coprocessor, where the main processor is a processor for Processing data in an awake state, and is also called a Central Processing Unit (CPU); a coprocessor is a low power processor for processing data in a standby state. In some embodiments, the processor 901 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the display screen. In some embodiments, the processor 901 may further include an AI (Artificial Intelligence) processor for processing computing operations related to machine learning.
Memory 902 may include one or more computer-readable storage media, which may be non-transitory. The memory 902 may also include high-speed random access memory, as well as non-volatile memory, such as one or more magnetic disk storage devices, flash memory storage devices. In some embodiments, a non-transitory computer readable storage medium in memory 902 is used to store at least one instruction for execution by processor 901 to implement a method of task management as provided by method embodiments herein.
In some embodiments, terminal 900 can also optionally include: a peripheral interface 903 and at least one peripheral. The processor 901, memory 902, and peripheral interface 903 may be connected by buses or signal lines. Various peripheral devices may be connected to the peripheral interface 903 via a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 904, a touch display screen 905, a camera 906, an audio circuit 907, a positioning component 908, and a power supply 909.
The peripheral interface 903 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 901 and the memory 902. In some embodiments, the processor 901, memory 902, and peripheral interface 903 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 901, the memory 902 and the peripheral interface 903 may be implemented on a separate chip or circuit board, which is not limited by this embodiment.
The Radio Frequency circuit 904 is used for receiving and transmitting RF (Radio Frequency) signals, also called electromagnetic signals. The radio frequency circuitry 904 communicates with communication networks and other communication devices via electromagnetic signals. The radio frequency circuit 904 converts an electrical signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electrical signal. Optionally, the radio frequency circuit 904 comprises: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber identity module card, and so forth. The radio frequency circuit 904 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: the world wide web, metropolitan area networks, intranets, generations of mobile communication networks (2G, 3G, 4G, and 5G), Wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the radio frequency circuit 904 may also include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display screen 905 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 905 is a touch display screen, the display screen 905 also has the ability to capture touch signals on or over the surface of the display screen 905. The touch signal may be input to the processor 901 as a control signal for processing. At this point, the display 905 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display 905 may be one, providing the front panel of the terminal 900; in other embodiments, the number of the display panels 905 may be at least two, and each of the display panels is disposed on a different surface of the terminal 900 or is in a foldable design; in still other embodiments, the display 905 may be a flexible display disposed on a curved surface or a folded surface of the terminal 900. Even more, the display screen 905 may be arranged in a non-rectangular irregular figure, i.e. a shaped screen. The Display panel 905 can be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), and other materials.
The camera assembly 906 is used to capture images or video. Optionally, camera assembly 906 includes a front camera and a rear camera. Generally, a front camera is disposed at a front panel of the terminal, and a rear camera is disposed at a rear surface of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, and the main camera and the wide-angle camera are fused to realize panoramic shooting and VR (Virtual Reality) shooting functions or other fusion shooting functions. In some embodiments, camera assembly 906 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
Audio circuit 907 may include a microphone and a speaker. The microphone is used for collecting sound waves of a user and the environment, converting the sound waves into electric signals, and inputting the electric signals to the processor 901 for processing, or inputting the electric signals to the radio frequency circuit 904 for realizing voice communication. For stereo sound acquisition or noise reduction purposes, the microphones may be multiple and disposed at different locations of the terminal 900. The microphone may also be an array microphone or an omni-directional pick-up microphone. The speaker is used to convert electrical signals from the processor 901 or the radio frequency circuit 904 into sound waves. The loudspeaker can be a traditional film loudspeaker or a piezoelectric ceramic loudspeaker. When the speaker is a piezoelectric ceramic speaker, the speaker can be used for purposes such as converting an electric signal into a sound wave audible to a human being, or converting an electric signal into a sound wave inaudible to a human being to measure a distance. In some embodiments, audio circuit 907 may also include a headphone jack.
The positioning component 908 is used to locate the current geographic Location of the terminal 900 for navigation or LBS (Location Based Service). The Positioning component 908 may be a Positioning component based on the Global Positioning System (GPS) in the united states, the beidou System in china, or the galileo System in russia.
Power supply 909 is used to provide power to the various components in terminal 900. The power source 909 may be alternating current, direct current, disposable or rechargeable. When the power source 909 includes a rechargeable battery, the rechargeable battery may be a wired rechargeable battery or a wireless rechargeable battery. The wired rechargeable battery is a battery charged through a wired line, and the wireless rechargeable battery is a battery charged through a wireless coil. The rechargeable battery may also be used to support fast charge technology.
In some embodiments, terminal 900 can also include one or more sensors 910. The one or more sensors 910 include, but are not limited to: acceleration sensor 911, gyro sensor 912, pressure sensor 913, fingerprint sensor 914, optical sensor 915, and proximity sensor 916.
The acceleration sensor 911 can detect the magnitude of acceleration in three coordinate axes of the coordinate system established with the terminal 900. For example, the acceleration sensor 911 may be used to detect the components of the gravitational acceleration in three coordinate axes. The processor 901 can control the touch display 905 to display the user interface in a landscape view or a portrait view according to the gravitational acceleration signal collected by the acceleration sensor 911. The acceleration sensor 911 may also be used for acquisition of motion data of a game or a user.
The gyro sensor 912 may detect a body direction and a rotation angle of the terminal 900, and the gyro sensor 912 may cooperate with the acceleration sensor 911 to acquire a 3D motion of the user on the terminal 900. The processor 901 can implement the following functions according to the data collected by the gyro sensor 912: motion sensing (such as changing the UI according to a user's tilting operation), image stabilization at the time of photographing, game control, and inertial navigation.
Pressure sensors 913 may be disposed on the side bezel of terminal 900 and/or underneath touch display 905. When the pressure sensor 913 is disposed on the side frame of the terminal 900, the user's holding signal of the terminal 900 may be detected, and the processor 901 performs left-right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 913. When the pressure sensor 913 is disposed at a lower layer of the touch display 905, the processor 901 controls the operability control on the UI interface according to the pressure operation of the user on the touch display 905. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 914 is used for collecting a fingerprint of the user, and the processor 901 identifies the user according to the fingerprint collected by the fingerprint sensor 914, or the fingerprint sensor 914 identifies the user according to the collected fingerprint. Upon recognizing that the user's identity is a trusted identity, processor 901 authorizes the user to perform relevant sensitive operations including unlocking the screen, viewing encrypted information, downloading software, paying, and changing settings, etc. The fingerprint sensor 914 may be disposed on the front, back, or side of the terminal 900. When a physical key or vendor Logo is provided on the terminal 900, the fingerprint sensor 914 may be integrated with the physical key or vendor Logo.
The optical sensor 915 is used to collect ambient light intensity. In one embodiment, the processor 901 may control the display brightness of the touch display 905 based on the ambient light intensity collected by the optical sensor 915. Specifically, when the ambient light intensity is high, the display brightness of the touch display screen 905 is increased; when the ambient light intensity is low, the display brightness of the touch display screen 905 is turned down. In another embodiment, the processor 901 can also dynamically adjust the shooting parameters of the camera assembly 906 according to the ambient light intensity collected by the optical sensor 915.
Proximity sensor 916, also known as a distance sensor, is typically disposed on the front panel of terminal 900. The proximity sensor 916 is used to collect the distance between the user and the front face of the terminal 900. In one embodiment, when the proximity sensor 916 detects that the distance between the user and the front face of the terminal 900 gradually decreases, the processor 901 controls the touch display 905 to switch from the bright screen state to the dark screen state; when the proximity sensor 916 detects that the distance between the user and the front surface of the terminal 900 gradually becomes larger, the processor 901 controls the touch display 905 to switch from the breath screen state to the bright screen state.
Those skilled in the art will appreciate that the configuration shown in fig. 9 does not constitute a limitation of terminal 900, and may include more or fewer components than those shown, or may combine certain components, or may employ a different arrangement of components.
Fig. 10 is a schematic structural diagram of a server according to an embodiment of the present application, where the server 1000 may generate a relatively large difference due to different configurations or performances, and may include one or more processors (CPUs) 1001 and one or more memories 1002, where the memory 1002 stores at least one instruction, and the at least one instruction is loaded and executed by the processors 1001 to implement the task management method provided by each method embodiment. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input/output interface, so as to perform input/output, and the server may also include other components for implementing the functions of the device, which are not described herein again.
In an exemplary embodiment, a computer-readable storage medium, such as a memory, is also provided that includes instructions executable by a processor in a server to perform the task management method of the above embodiments. For example, the computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (30)

1. A task management method is applied to a terminal and comprises the following steps:
acquiring at least one task instruction for achieving a task from a server, wherein one task instruction is used for instructing the terminal to monitor a type of user behaviors;
for any task indication, generating a task state synchronization request based on the monitored user behavior matched with the task indication;
reporting the task state synchronization request to the server;
receiving a response message of the task state synchronization request from the server, wherein the response message is a response message of a judgment result of judging whether the task is achieved based on the task state synchronization request and a task achievement condition;
before reporting the task state synchronization request to the server, the method further includes:
and destroying all task state synchronization requests currently positioned in the request queue.
2. The task management method according to claim 1, wherein the reporting the task state synchronization request to the server comprises:
reporting the task state synchronization request to the server according to a target reporting rule;
the target reporting rule is that the first request is reported in real time, and the non-first request is reported according to a fixed time interval.
3. The task management method of claim 1, wherein the obtaining at least one task indication for fulfilling the task from the server comprises:
sending a task instruction acquisition request to the server;
and receiving at least one task instruction issued by the server, wherein the at least one task instruction is obtained by converting task description information of the task acquired based on the task instruction acquisition request.
4. The task management method according to claim 1, wherein after acquiring the at least one task indication, the method further comprises:
generating a task state structure body of the task indication for any task indication;
the task state structure is used for recording task states, and the task states are updated when user behaviors matched with the task indications are monitored.
5. The task management method according to claim 1, wherein after receiving a response message of the task state synchronization request from the server, the method further comprises:
when the task state synchronization request is reported successfully, updating the task state recorded in the task state structure body indicated by the corresponding task;
and when the report of the task state synchronization request fails, the task state contained in the task state synchronization request is stored in a local cache.
6. The method according to claim 5, wherein after saving the task state contained in the task state synchronization request to a local cache, the method further comprises any one of:
when the server is in a networking state, reporting the task state of the local cache to the server in a task state synchronization request form;
and after the application is started next time, reporting the task state of the local cache to the server in a task state synchronization request mode.
7. The task management method according to claim 2, wherein reporting the task state synchronization request to the server according to a target reporting rule comprises:
when the task state synchronization request is the first request of the task, reporting the task state synchronization request to the server in real time;
and when the task state synchronization request is a non-first request of the task, reporting the task state synchronization request to the server according to the fixed time interval, wherein the fixed time interval is issued by the server.
8. The task management method according to claim 2 or 7, wherein after acquiring the at least one task indication, the method further comprises:
starting a timer having said fixed time interval;
the reporting the task state synchronization request to the server according to the target reporting rule includes:
and reporting the task state synchronization request to the server according to the fixed time interval based on the timer.
9. The method of task management according to claim 1, wherein after generating a task state synchronization request, the method further comprises:
and after receiving a response message of the last task state synchronization request returned by the server, reporting the current task state synchronization request to the server.
10. The task management method according to claim 1, wherein the receiving a response message of the task state synchronization request from the server includes:
receiving a task instruction of a new task issued by the server, and updating a local existing task instruction by the task instruction of the new task;
and the task instruction of the new task is issued by the server after judging that the task is achieved.
11. A task management method is applied to a server and comprises the following steps:
receiving a task indication acquisition request sent by a terminal;
issuing at least one task instruction for achieving a task to the terminal, wherein one task instruction is used for instructing the terminal to monitor a class of user behaviors;
receiving a task state synchronization request reported by the terminal, wherein the task state synchronization request is generated based on a monitored user behavior matched with any task indication for any task indication, and the terminal is used for destroying each task state synchronization request currently located in a request queue before reporting the task state synchronization request;
determining whether the task is achieved based on the task state synchronization request and a task achievement condition;
and issuing a response message of the task state synchronization request to the terminal, wherein the response message is the response message of the judgment result for judging whether the task is achieved.
12. The task management method according to claim 11, wherein before issuing the at least one task instruction to the terminal, the method further comprises:
acquiring a task list from other servers, wherein the task list comprises a plurality of tasks including the task;
and acquiring task description information of the task, and converting the task description information into the at least one task instruction.
13. The task management method according to claim 11, wherein before receiving the task indication obtaining request sent by the terminal, the method further comprises: and sending a fixed time interval to the terminal.
14. A task management device, applied to a terminal, includes:
an acquisition module configured to acquire at least one task instruction for fulfilling a task from a server, one of the task instructions being for instructing the terminal to monitor a class of user behavior;
a first generation module configured to generate a task state synchronization request based on the monitored user behavior matched with the task indication for any one of the task indications;
a reporting module configured to report the task state synchronization request to the server;
a receiving module configured to receive a response message of the task state synchronization request from the server, the response message being a response message of a determination result of whether the task is achieved based on the task state synchronization request and a task achievement condition;
and the destruction module is configured to destroy each task state synchronization request currently located in the request queue before reporting the task state synchronization request to the server.
15. The task management device according to claim 14, wherein the reporting module is further configured to report the task state synchronization request to the server according to a target reporting rule;
the target reporting rule is that the first request is reported in real time, and the non-first request is reported according to a fixed time interval.
16. The task management device according to claim 14, wherein the obtaining module includes:
a sending unit configured to send a task instruction acquisition request to the server;
and the receiving unit is configured to receive the at least one task instruction issued by the server, wherein the at least one task instruction is obtained by converting task description information of a task acquired based on the task instruction acquisition request.
17. The task management apparatus according to claim 14, wherein the apparatus further comprises:
the second generation module is configured to generate a task state structural body of the task indication for any one task indication;
the task state structure is used for recording task states, and the task states are updated when user behaviors matched with the task indications are monitored.
18. The task management apparatus according to claim 14, wherein the apparatus further comprises:
the updating module is configured to update the task state recorded in the task state structural body indicated by the corresponding task when the task state synchronization request is reported successfully;
and the cache module is configured to store the task state contained in the task state synchronization request to a local cache when the report of the task state synchronization request fails.
19. The task management device according to claim 18, wherein the reporting module is further configured to report the task status of the local cache to the server in the form of a task status synchronization request when in a networking state; and after the application is started next time, reporting the task state of the local cache to the server in a task state synchronization request mode.
20. The task management device according to claim 15, wherein the reporting module is further configured to report the task state synchronization request to the server in real time when the task state synchronization request is a first request of the task; and when the task state synchronization request is a non-first request of the task, reporting the task state synchronization request to the server according to the fixed time interval, wherein the fixed time interval is issued by the server.
21. A task management apparatus according to claim 15 or 20, wherein said apparatus further comprises:
a timer module configured to start a timer having the fixed time interval;
the reporting module is further configured to report the task state synchronization request to the server at the fixed time interval based on the timer.
22. The task management device according to claim 14, wherein the reporting module is further configured to report the current task state synchronization request to the server after receiving a response message of a previous task state synchronization request returned by the server.
23. The task management device according to claim 14, wherein the receiving module comprises:
the receiving unit is configured to receive a task instruction of a new task issued by the server;
an updating unit configured to update a locally existing task indication with a task indication of the new task;
and the task instruction of the new task is issued by the server after judging that the task is achieved.
24. A task management device, applied to a server, includes:
the system comprises a first receiving module, a second receiving module and a processing module, wherein the first receiving module is configured to receive a task indication acquisition request sent by a terminal;
the first sending module is configured to issue at least one task instruction for achieving a task to the terminal, wherein one task instruction is used for instructing the terminal to monitor a class of user behaviors;
a second receiving module, configured to receive a task state synchronization request reported by the terminal, where the task state synchronization request is generated based on a monitored user behavior matched with any task indication for any task indication, and the terminal is configured to destroy each task state synchronization request currently located in a request queue before reporting the task state synchronization request;
a determination module configured to determine whether the task is fulfilled based on the task state synchronization request and a task fulfillment condition;
and the second sending module is configured to issue a response message of the task state synchronization request to the terminal, wherein the response message is a response message of a judgment result for judging whether the task is achieved.
25. A task management apparatus according to claim 24, wherein said apparatus further comprises:
the acquisition module is configured to acquire a task list from other servers, wherein the task list comprises a plurality of tasks including the task;
the acquisition module is further configured to acquire task description information of the task;
a conversion module configured to convert the task description information into the at least one task indication.
26. The task management device according to claim 24, wherein the sending module is further configured to issue a fixed time interval to the terminal.
27. A terminal, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the task management method of any of claims 1 to 10.
28. A server, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the task management method of any of claims 11 to 13.
29. A storage medium in which instructions, when executed by a processor of a terminal, enable the terminal to perform the task management method according to any one of claims 1 to 10.
30. A storage medium in which instructions, when executed by a processor of a server, enable the server to perform the task management method of any one of claims 11 to 13.
CN201910678839.3A 2019-07-25 2019-07-25 Task management method, device, storage medium and terminal Active CN110381155B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910678839.3A CN110381155B (en) 2019-07-25 2019-07-25 Task management method, device, storage medium and terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910678839.3A CN110381155B (en) 2019-07-25 2019-07-25 Task management method, device, storage medium and terminal

Publications (2)

Publication Number Publication Date
CN110381155A CN110381155A (en) 2019-10-25
CN110381155B true CN110381155B (en) 2022-03-25

Family

ID=68256082

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910678839.3A Active CN110381155B (en) 2019-07-25 2019-07-25 Task management method, device, storage medium and terminal

Country Status (1)

Country Link
CN (1) CN110381155B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111638982B (en) * 2020-05-27 2024-03-01 百度在线网络技术(北京)有限公司 Flow guiding method, flow guiding device and electronic equipment
CN112925578B (en) * 2021-01-28 2024-01-30 北京达佳互联信息技术有限公司 Task processing method, device and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104572661A (en) * 2013-10-14 2015-04-29 联想(北京)有限公司 Terminal equipment and information processing method
CN105873194A (en) * 2015-11-30 2016-08-17 乐视网信息技术(北京)股份有限公司 Method and device for reporting behaviours of mobile terminal
CN107770756A (en) * 2017-10-23 2018-03-06 中兴通讯股份有限公司 A kind of monitoring method, terminal, server, gateway device and system
CN107800754A (en) * 2016-09-07 2018-03-13 腾讯科技(深圳)有限公司 Data transfer task processing, data transfer task monitoring method and device
CN108306771A (en) * 2018-02-09 2018-07-20 腾讯科技(深圳)有限公司 Log reporting method, apparatus and system
CN108600516A (en) * 2018-03-29 2018-09-28 努比亚技术有限公司 Collecting method, mobile terminal and computer readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140073420A1 (en) * 2012-09-07 2014-03-13 Downing Matthew System and method for optimizing user value in an online environment

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104572661A (en) * 2013-10-14 2015-04-29 联想(北京)有限公司 Terminal equipment and information processing method
CN105873194A (en) * 2015-11-30 2016-08-17 乐视网信息技术(北京)股份有限公司 Method and device for reporting behaviours of mobile terminal
CN107800754A (en) * 2016-09-07 2018-03-13 腾讯科技(深圳)有限公司 Data transfer task processing, data transfer task monitoring method and device
CN107770756A (en) * 2017-10-23 2018-03-06 中兴通讯股份有限公司 A kind of monitoring method, terminal, server, gateway device and system
CN108306771A (en) * 2018-02-09 2018-07-20 腾讯科技(深圳)有限公司 Log reporting method, apparatus and system
CN108600516A (en) * 2018-03-29 2018-09-28 努比亚技术有限公司 Collecting method, mobile terminal and computer readable storage medium

Also Published As

Publication number Publication date
CN110381155A (en) 2019-10-25

Similar Documents

Publication Publication Date Title
CN111225042B (en) Data transmission method and device, computer equipment and storage medium
CN110674022B (en) Behavior data acquisition method and device and storage medium
CN109246123B (en) Media stream acquisition method and device
CN110368689B (en) Game interface display method, system, electronic equipment and storage medium
CN110278464B (en) Method and device for displaying list
CN108762881B (en) Interface drawing method and device, terminal and storage medium
CN111327694B (en) File uploading method and device, storage medium and electronic equipment
CN107896337B (en) Information popularization method and device and storage medium
CN109697113B (en) Method, device and equipment for requesting retry and readable storage medium
WO2020088542A1 (en) Data management method, apparatus and system, and server, terminal and storage medium
CN111159604A (en) Picture resource loading method and device
CN111061550A (en) Task processing method, device, equipment and storage medium
CN110381155B (en) Task management method, device, storage medium and terminal
CN111106902B (en) Data message transmission method, device, equipment and computer readable storage medium
CN112738475B (en) Video playing method and device and electronic equipment
CN112770177B (en) Multimedia file generation method, multimedia file release method and device
CN113144622A (en) Node switching method, device, equipment and computer readable storage medium
CN111131272B (en) Scheduling method, device and system of stream server, computing equipment and storage medium
CN111881423A (en) Method, device and system for limiting function use authorization
CN111258683A (en) Detection method, detection device, computer equipment and storage medium
CN110597840A (en) Partner relationship establishing method, device, equipment and storage medium based on block chain
CN114785766B (en) Control method, terminal and server of intelligent equipment
CN112181915A (en) Method, device, terminal and storage medium for executing service
CN110971692B (en) Method and device for opening service and computer storage medium
CN112995587B (en) Electronic equipment monitoring method, system, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant