[go: up one dir, main page]

CN115248817A - Task processing method, apparatus, electronic device and readable storage medium - Google Patents

Task processing method, apparatus, electronic device and readable storage medium Download PDF

Info

Publication number
CN115248817A
CN115248817A CN202110461735.4A CN202110461735A CN115248817A CN 115248817 A CN115248817 A CN 115248817A CN 202110461735 A CN202110461735 A CN 202110461735A CN 115248817 A CN115248817 A CN 115248817A
Authority
CN
China
Prior art keywords
task
processing
processed
processing result
server
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.)
Pending
Application number
CN202110461735.4A
Other languages
Chinese (zh)
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 Kingsoft Cloud Network Technology Co Ltd
Original Assignee
Beijing Kingsoft Cloud Network 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 Kingsoft Cloud Network Technology Co Ltd filed Critical Beijing Kingsoft Cloud Network Technology Co Ltd
Priority to CN202110461735.4A priority Critical patent/CN115248817A/en
Publication of CN115248817A publication Critical patent/CN115248817A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2453Query optimisation
    • G06F16/24534Query rewriting; Transformation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2458Special types of queries, e.g. statistical queries, fuzzy queries or distributed queries
    • G06F16/2471Distributed queries

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Fuzzy Systems (AREA)
  • Mathematical Physics (AREA)
  • Probability & Statistics with Applications (AREA)
  • Software Systems (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application relates to the technical field of task processing, and discloses a task processing method, a task processing device, an electronic device and a readable storage medium, wherein the task processing method comprises the following steps: receiving a processing request aiming at a task to be processed, which is sent by a terminal; the processing request carries the repeated sending times of the processing request; if the repeated sending times meet the preset conditions, acquiring a processing result aiming at the task to be processed; and if the processing result is that the task to be processed is successfully processed, returning a processing success status message to the terminal. The task processing method can avoid repeated processing of the tasks to be processed, improve task processing efficiency and save processing resources of the server.

Description

任务处理方法、装置、电子设备及可读存储介质Task processing method, apparatus, electronic device and readable storage medium

技术领域technical field

本申请涉及任务处理技术领域,具体而言,本申请涉及一种任务处理方法、装置、电子设备及可读存储介质。The present application relates to the technical field of task processing, and in particular, the present application relates to a task processing method, apparatus, electronic device, and readable storage medium.

背景技术Background technique

随着信息技术的不断发展,越来越多的业务都涉及交互处理,例如,系统之间的数据交互。With the continuous development of information technology, more and more businesses involve interactive processing, for example, data interaction between systems.

目前的系统之间进行交互时,可能会产生重复交互的情况,例如,服务器可能已经成功处理终端发送的任务处理请求,但终端可能再次发送任务处理请求到服务器,造成服务器对任务进行重复处理,降低任务处理效率,且导致服务器处理资源的浪费。In the current interaction between systems, repeated interactions may occur. For example, the server may have successfully processed the task processing request sent by the terminal, but the terminal may send the task processing request to the server again, causing the server to process the task repeatedly. The task processing efficiency is reduced, and the server processing resources are wasted.

发明内容SUMMARY OF THE INVENTION

本申请的目的旨在至少能解决上述的技术缺陷之一,特提出以下技术方案:The purpose of this application is to solve at least one of the above-mentioned technical defects, and the following technical solutions are specially proposed:

第一方面,提供了一种任务处理方法,包括:In a first aspect, a task processing method is provided, including:

接收终端发送的针对待处理任务的处理请求;处理请求中携带有处理请求的重复发送次数;Receiving the processing request sent by the terminal for the task to be processed; the processing request carries the number of repeated transmissions of the processing request;

若重复发送次数符合预设条件,则获取针对待处理任务的处理结果;If the number of repeated sending meets the preset condition, obtain the processing result for the task to be processed;

若处理结果为待处理任务已成功处理,则返回处理成功状态消息至终端。If the processing result is that the pending task has been successfully processed, a processing success status message is returned to the terminal.

在第一方面的可选实施例中,处理请求中还携带有与待处理任务对应的唯一识别码;获取针对待处理任务的处理结果,包括:In an optional embodiment of the first aspect, the processing request also carries a unique identification code corresponding to the task to be processed; obtaining a processing result for the task to be processed includes:

基于唯一识别码在预设的数据库中查询针对待处理任务的处理结果;Query the processing result for the task to be processed in the preset database based on the unique identification code;

其中,数据库中存储有每个已处理任务对应的唯一识别码和处理结果,每个唯一识别码与该唯一识别码对应的已处理任务的处理结果相关联。The database stores a unique identification code and a processing result corresponding to each processed task, and each unique identification code is associated with the processing result of the processed task corresponding to the unique identification code.

在第一方面的可选实施例中,还包括:In an optional embodiment of the first aspect, it also includes:

若出现以下情况中的任一种,则对待处理任务进行处理:If any of the following situations occur, the task to be processed is processed:

重复发送次数不符合预设条件;The number of repeated sending does not meet the preset conditions;

未获取到针对待处理任务的处理结果;The processing result for the pending task is not obtained;

获取到针对待处理任务的处理结果为未成功处理。The processing result obtained for the pending task is unsuccessful processing.

在第一方面的可选实施例中,还包括:In an optional embodiment of the first aspect, it also includes:

在对待处理任务进行处理后,将待处理任务的唯一识别码、以及针对待处理任务的处理结果写入数据库中,以更新数据库。After the to-be-processed task is processed, the unique identification code of the to-be-processed task and the processing result for the to-be-processed task are written into the database to update the database.

在第一方面的可选实施例中,还包括:In an optional embodiment of the first aspect, it also includes:

若针对待处理任务的处理结果写入数据库失败,则返回对应的状态消息至终端。If the processing result of the pending task fails to be written into the database, a corresponding status message is returned to the terminal.

在第一方面的可选实施例中,重复发送次数符合预设条件包括:In an optional embodiment of the first aspect, the number of times of repeated sending meeting the preset condition includes:

重复发送次数大于预设次数。The number of repeated transmissions is greater than the preset number of times.

第二方面,提供了一种任务处理方法,包括:In a second aspect, a task processing method is provided, including:

发送针对待处理任务的处理请求至服务器;处理请求中携带有处理请求的重复发送次数;Send the processing request for the pending task to the server; the processing request carries the number of repeated sending of the processing request;

接收服务器在处理结果为待处理任务已成功处理时,返回的处理成功状态消息。The processing success status message returned by the receiving server when the processing result is that the pending task has been processed successfully.

在第二方面的可选实施例中,还包括:In an optional embodiment of the second aspect, it also includes:

确定针对待处理任务的处理请求的已发送次数,基于已发送次数确定重复发送次数。Determines the number of times the processing request for the pending task has been sent, and based on the number of sent times, determines the number of re-sends.

在第二方面的可选实施例中,还包括:In an optional embodiment of the second aspect, it also includes:

生成针对待处理任务的唯一识别码,将唯一识别码添加至处理请求中。Generate a unique identifier for the pending task and add the unique identifier to the processing request.

第三方面,提供了一种任务处理装置,包括:In a third aspect, a task processing device is provided, including:

第一接收模块,用于接收终端发送的针对待处理任务的处理请求;处理请求中携带有处理请求的重复发送次数;a first receiving module, configured to receive a processing request sent by the terminal for the task to be processed; the processing request carries the number of times of repeated sending of the processing request;

获取模块,用于若重复发送次数符合预设条件,则获取针对待处理任务的处理结果;an obtaining module, configured to obtain the processing result for the task to be processed if the number of repeated sending meets the preset condition;

第一返回模块,用于若处理结果为待处理任务已成功处理,则返回处理成功状态消息至终端。The first returning module is configured to return a processing success status message to the terminal if the processing result is that the to-be-processed task has been successfully processed.

在第三方面的可选实施例中,处理请求中还携带有与待处理任务对应的唯一识别码;获取模块在获取针对待处理任务的处理结果时,具体用于:In an optional embodiment of the third aspect, the processing request also carries a unique identification code corresponding to the task to be processed; when the acquisition module acquires the processing result for the task to be processed, it is specifically used for:

基于唯一识别码在预设的数据库中查询针对待处理任务的处理结果;Query the processing result for the task to be processed in the preset database based on the unique identification code;

其中,数据库中存储有每个已处理任务对应的唯一识别码和处理结果,每个唯一识别码与该唯一识别码对应的已处理任务的处理结果相关联。The database stores a unique identification code and a processing result corresponding to each processed task, and each unique identification code is associated with the processing result of the processed task corresponding to the unique identification code.

在第三方面的可选实施例中,还包括处理模块,用于若出现以下情况中的任一种,则对待处理任务进行处理:In an optional embodiment of the third aspect, a processing module is further included, configured to process the to-be-processed task if any of the following situations occurs:

重复发送次数不符合预设条件;The number of repeated sending does not meet the preset conditions;

未获取到针对待处理任务的处理结果;The processing result for the pending task is not obtained;

获取到针对待处理任务的处理结果为未成功处理。The processing result obtained for the pending task is unsuccessful processing.

在第三方面的可选实施例中,还包括写入模块,用于:In an optional embodiment of the third aspect, a writing module is also included for:

在对所述待处理任务进行处理后,将所述待处理任务的唯一识别码、以及针对所述待处理任务的处理结果写入所述数据库中,以更新所述数据库。After the to-be-processed task is processed, the unique identification code of the to-be-processed task and the processing result for the to-be-processed task are written into the database to update the database.

在第三方面的可选实施例中,还包括第二返回模块,用于:In an optional embodiment of the third aspect, a second return module is further included for:

若针对待处理任务的处理结果写入数据库失败,则返回对应的状态消息至终端。If the processing result of the pending task fails to be written into the database, a corresponding status message is returned to the terminal.

在第三方面的可选实施例中,重复发送次数符合预设条件包括:In an optional embodiment of the third aspect, the number of times of repeated sending meeting the preset condition includes:

重复发送次数大于预设次数。The number of repeated transmissions is greater than the preset number of times.

第四方面,提供了一种任务处理装置,包括:In a fourth aspect, a task processing device is provided, including:

发送模块,用于发送针对待处理任务的处理请求至服务器;处理请求中携带有处理请求的重复发送次数;The sending module is used to send the processing request for the task to be processed to the server; the processing request carries the number of times of repeated sending of the processing request;

第二接收模块,用于接收服务器在处理结果为待处理任务已成功处理时,返回的处理成功状态消息。The second receiving module is configured to receive a processing success status message returned by the server when the processing result is that the to-be-processed task has been successfully processed.

在第四方面的可选实施例中,还包括确定模块,用于:In an optional embodiment of the fourth aspect, it further includes a determining module for:

确定针对待处理任务的处理请求的已发送次数,基于已发送次数确定重复发送次数。Determines the number of times the processing request for the pending task has been sent, and based on the number of sent times, determines the number of re-sends.

在第四方面的可选实施例中,还包括生成模块,用于:In an optional embodiment of the fourth aspect, a generating module is also included for:

生成针对待处理任务的唯一识别码,将唯一识别码添加至处理请求中。Generate a unique identifier for the pending task and add the unique identifier to the processing request.

第五方面,提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行程序时实现本申请第一方面所示的任务处理方法。In a fifth aspect, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and running on the processor. The processor implements the task processing method shown in the first aspect of the present application when the processor executes the program.

第六方面,提供了一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,处理器执行程序时实现本申请第二方面所示的任务处理方法。In a sixth aspect, an electronic device is provided, including a memory, a processor, and a computer program stored in the memory and running on the processor. The processor implements the task processing method shown in the second aspect of the present application when the processor executes the program.

第七方面,提供了一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,该程序被处理器执行时实现本申请第一方面所示的任务处理方法。In a seventh aspect, a computer-readable storage medium is provided, where a computer program is stored on the computer-readable storage medium, and when the program is executed by a processor, the task processing method shown in the first aspect of the present application is implemented.

第八方面,提供了一种计算机可读存储介质,计算机可读存储介质上存储有计算机程序,该程序被处理器执行时实现本申请第二方面所示的任务处理方法。In an eighth aspect, a computer-readable storage medium is provided, where a computer program is stored on the computer-readable storage medium, and when the program is executed by a processor, the task processing method shown in the second aspect of the present application is implemented.

本申请提供的技术方案带来的有益效果是:The beneficial effects brought by the technical solution provided by the application are:

终端发送的处理请求中携带有针对待处理任务的重复发送次数,服务器结合重复发送次数和待处理任务的处理结果判断本次处理是否为重复处理,若重复发送次数符合预设条件,且处理结果为已成功处理,则服务器无需再对待处理任务进行处理,直接返回已成功处理状态消息至终端,可以避免针对待处理任务的重复处理,提高任务处理效率,同时节省服务器的处理资源。The processing request sent by the terminal carries the number of repeated transmissions for the task to be processed. The server combines the number of repeated transmissions and the processing result of the task to be processed to determine whether the current processing is repeated processing. If the number of repeated transmissions meets the preset conditions, and the processing result If it has been successfully processed, the server does not need to process the pending task, and directly returns a successfully processed status message to the terminal, which can avoid repeated processing of pending tasks, improve task processing efficiency, and save server processing resources.

进一步的,服务器每针对一个任务进行处理后,则获取该任务的处理结果,并将处理结果与该任务的唯一识别码进行关联,存储于预设的数据库中,以便于下次对待处理任务进行处理时通过唯一识别码查询对应的处理结果,提高查询效率。Further, after each task is processed by the server, it obtains the processing result of the task, associates the processing result with the unique identification code of the task, and stores it in a preset database, so as to facilitate the processing of the task to be processed next time. During processing, the corresponding processing result is queried through the unique identification code, so as to improve the query efficiency.

进一步的,若处理结果写入数据库失败,则直接返回对应的状态消息至终端,以使终端直接接收对应的处理结果,避免重新发送处理请求重复处理,进一步节省服务器的处理资源。Further, if the processing result fails to be written into the database, the corresponding status message is directly returned to the terminal, so that the terminal can directly receive the corresponding processing result, avoid re-sending the processing request for repeated processing, and further save the processing resources of the server.

本申请附加的方面和优点将在下面的描述中部分给出,这些将从下面的描述中变得明显,或通过本申请的实践了解到。Additional aspects and advantages of the present application will be set forth in part in the following description, which will become apparent from the following description, or may be learned by practice of the present application.

附图说明Description of drawings

本申请上述的和/或附加的方面和优点从下面结合附图对实施例的描述中将变得明显和容易理解,其中:The above and/or additional aspects and advantages of the present application will become apparent and readily understood from the following description of embodiments taken in conjunction with the accompanying drawings, wherein:

图1为本申请实施例提供的一种任务处理方法的应用场景图;1 is an application scenario diagram of a task processing method provided by an embodiment of the present application;

图2为本申请实施例提供的一种任务处理方法的流程示意图;2 is a schematic flowchart of a task processing method provided by an embodiment of the present application;

图3为本申请实施例提供的任务处理方案的示意图;3 is a schematic diagram of a task processing solution provided by an embodiment of the present application;

图4为本申请一个示例提供的任务处理方案的示意图;4 is a schematic diagram of a task processing solution provided by an example of this application;

图5为实施例提供的一种任务处理方法的流程示意图;5 is a schematic flowchart of a task processing method provided by an embodiment;

图6为本申请实施例提供的一种任务处理装置的结构示意图;FIG. 6 is a schematic structural diagram of a task processing apparatus provided by an embodiment of the present application;

图7为本申请实施例提供的一种任务处理装置的结构示意图;FIG. 7 is a schematic structural diagram of a task processing apparatus provided by an embodiment of the present application;

图8为本申请实施例提供的一种任务处理的电子设备的结构示意图。FIG. 8 is a schematic structural diagram of an electronic device for task processing provided by an embodiment of the present application.

具体实施方式Detailed ways

下面详细描述本申请的实施例,实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,仅用于解释本申请,而不能解释为对本申请的限制。Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, but not to be construed as a limitation on the present application.

本技术领域技术人员可以理解,除非特意声明,这里使用的单数形式“一”、“一个”、“所述”和“该”也可包括复数形式。应该进一步理解的是,本申请的说明书中使用的措辞“包括”是指存在特征、整数、步骤、操作、元件和/或组件,但是并不排除存在或添加一个或多个其他特征、整数、步骤、操作、元件、组件和/或它们的组。应该理解,当我们称元件被“连接”或“耦接”到另一元件时,它可以直接连接或耦接到其他元件,或者也可以存在中间元件。此外,这里使用的“连接”或“耦接”可以包括无线连接或无线耦接。这里使用的措辞“和/或”包括一个或更多个相关联的列出项的全部或任一单元和全部组合。It will be understood by those skilled in the art that the singular forms "a", "an", "the" and "the" as used herein can include the plural forms as well, unless expressly stated otherwise. It should be further understood that the word "comprising" used in the specification of this application refers to the presence of features, integers, steps, operations, elements and/or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and/or groups thereof. It will be understood that when we refer to an element as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Furthermore, "connected" or "coupled" as used herein may include wirelessly connected or wirelessly coupled. As used herein, the term "and/or" includes all or any element and all combination of one or more of the associated listed items.

为使本申请的目的、技术方案和优点更加清楚,下面将结合附图对本申请实施方式作进一步地详细描述。In order to make the objectives, technical solutions and advantages of the present application clearer, the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.

本申请实施例提供的方案涉及任务处理技术,具体通过如下实施例进行说明。The solutions provided by the embodiments of the present application relate to task processing technologies, which are specifically described by the following embodiments.

下面以具体地实施例对本申请的技术方案以及本申请的技术方案如何解决上述技术问题进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。下面将结合附图,对本申请的实施例进行描述。The technical solutions of the present application and how the technical solutions of the present application solve the above-mentioned technical problems will be described in detail below with specific examples. The following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below with reference to the accompanying drawings.

如图1所示,本申请的任务处理方法,可以应用于图1所示的场景中,具体的,终端101确定针对待处理任务的处理请求的重复发送次数,并将针对待处理任务的处理请求发送至服务器102,处理请求中携带有所述处理请求的重复发送次数;若重复发送次数大于预设次数,服务器102从预设的数据库中获取针对所述待处理任务的处理结果;若所述处理结果为所述待处理任务已成功处理,则服务器102返回处理成功状态消息至所述终端101。As shown in FIG. 1 , the task processing method of the present application can be applied to the scenario shown in FIG. 1 . Specifically, the terminal 101 determines the number of times of repeated sending of the processing request for the task to be processed, and sends the processing request for the task to be processed. The request is sent to the server 102, and the processing request carries the number of repeated transmissions of the processing request; if the number of repeated transmissions is greater than the preset number, the server 102 obtains the processing result for the task to be processed from the preset database; If the processing result is that the to-be-processed task has been successfully processed, the server 102 returns a processing success status message to the terminal 101 .

图1所示的场景中,上述任务处理方法可以在终端与服务器中进行,在其他的场景中,也可以在终端与终端、服务器与服务器中进行,还可以在同一终端中的不同软件中进行。例如,终端A可以发送针对待处理任务的处理请求到终端B,由终端B对待处理任务进行处理。In the scenario shown in FIG. 1, the above task processing method can be performed in the terminal and the server. In other scenarios, it can also be performed in the terminal and the terminal, the server and the server, and can also be performed in different software in the same terminal. . For example, terminal A may send a processing request for the to-be-processed task to terminal B, and terminal B processes the to-be-processed task.

本技术领域技术人员可以理解,这里所使用的“终端”可以是手机、平板电脑、PDA(Personal Digital Assistant,个人数字助理)、MID(Mobile Internet Device,移动互联网设备)等;“服务器”可以用独立的服务器或者是多个服务器组成的服务器集群来实现。Those skilled in the art can understand that the "terminal" used here can be a mobile phone, a tablet computer, a PDA (Personal Digital Assistant, personal digital assistant), MID (Mobile Internet Device, mobile Internet device), etc.; It can be implemented by an independent server or a server cluster composed of multiple servers.

本申请实施例中提供了一种可能的实现方式,如图2所示,提供了一种任务处理方法,以该方法应用于图1所示的服务器为例,可以包括以下步骤:A possible implementation manner is provided in the embodiment of the present application. As shown in FIG. 2 , a task processing method is provided. Taking the method applied to the server shown in FIG. 1 as an example, the following steps may be included:

步骤S201,接收终端发送的针对待处理任务的处理请求。Step S201, receiving a processing request sent by the terminal for the task to be processed.

其中,处理请求中携带有处理请求的重复发送次数。The processing request carries the number of times of repeated sending of the processing request.

其中,重复发送次数是指针对待处理任务的处理请求的第一次发送次数以外,多余的发送次数,例如,针对待处理任务的处理请求一共发送2次,则重复发送次数为1;针对待处理任务的处理请求仅发送一次,则重复发送次数为0。Among them, the number of repeated sending is the number of times of sending the processing request for the task to be processed for the first time, and the number of redundant sending. For example, if the processing request for the task to be processed is sent 2 times, the number of repeated sending is 1; The processing request of the task is only sent once, and the number of repeated sending is 0.

具体的,终端可以在发送处理请求之前,确定针对待处理任务的已发送次数,根据待处理任务的已发送次数确定处理请求的重复发送次数。Specifically, before sending the processing request, the terminal may determine the number of times of sending the task to be processed, and determine the number of times of repeated sending of the processing request according to the number of times that the task to be processed has been sent.

步骤S202,若重复发送次数符合预设条件,则获取针对待处理任务的处理结果。Step S202, if the number of repeated sending times meets a preset condition, obtain a processing result for the to-be-processed task.

在一些实施方式中,预设条件可以是重复发送次数大于预设次数,预设次数可以基于预先设置的服务器需要对任务处理的次数来确定,例如,若只需要服务器对任务处理1次,则预设次数为0,即重复发送次数大于0,就认为服务器已经收到过1次处理请求。In some embodiments, the preset condition may be that the number of repeated sending times is greater than the preset number of times, and the preset number of times may be determined based on the preset number of times the server needs to process the task. For example, if the server only needs to process the task once, then The preset number of times is 0, that is, if the number of repeated transmissions is greater than 0, it is considered that the server has received a processing request once.

具体的,若重复发送次数大于预设次数,则需要判断针对待处理任务的处理结果是否为已成功处理。Specifically, if the number of repeated transmissions is greater than the preset number of times, it is necessary to determine whether the processing result for the task to be processed is successfully processed.

在另一些实施方式中,预设条件也可以是重复发送次数等于预设次数,例如预设次数为0,只要重复发送次数为0,则服务器需要对待处理任务进行处理;只要重复发送次数不为0,则服务无需对待处理任务进行处理。In other implementations, the preset condition may also be that the number of repeated transmissions is equal to the preset number of times, for example, the preset number of times is 0, as long as the number of repeated transmissions is 0, the server needs to process the task to be processed; as long as the number of repeated transmissions is not 0 0, the service does not need to process the pending task.

步骤S203,若处理结果为待处理任务已成功处理,则返回处理成功状态消息至终端。Step S203, if the processing result is that the task to be processed has been successfully processed, a processing success status message is returned to the terminal.

具体的,若待处理任务已成功处理,则服务器无需再对待处理任务进行重复处理,终端也无需再重复发送处理请求,服务器可以直接返回处理成功状态消息至终端,终端接收到处理成功状态消息后,不再发送针对待处理任务的处理请求至服务器。Specifically, if the task to be processed has been successfully processed, the server does not need to repeatedly process the task to be processed, and the terminal does not need to repeatedly send a processing request. The server can directly return a processing success status message to the terminal. After the terminal receives the processing success status message , no longer send processing requests for pending tasks to the server.

若待处理任务未成功处理,则服务器需要对待处理任务进行处理。If the pending task is not successfully processed, the server needs to process the pending task.

以下将结合示例进一步阐述上述实施例。The above embodiments will be further described below with reference to examples.

如图3所示,服务器接收终端发送的处理请求,处理请求中携带有重复发送次数;服务器判断重复发送次数是否大于预设次数;若是,则查询待处理任务的处理结果,判断处理结果是否为已成功处理,若是,则返回处理成功状态消息至终端;若否,则对待处理任务进行处理。As shown in Figure 3, the server receives the processing request sent by the terminal, and the processing request carries the number of repeated transmissions; the server determines whether the number of repeated transmissions is greater than the preset number of times; if so, it queries the processing result of the task to be processed, and determines whether the processing result is If it has been processed successfully, if it is, return a processing success status message to the terminal; if not, process the task to be processed.

上述实施例中,终端发送的处理请求中携带有针对待处理任务的重复发送次数,服务器结合重复发送次数和待处理任务的处理结果判断本次处理是否为重复处理,若重复发送次数符合预设条件,且处理结果为已成功处理,则服务器无需再对待处理任务进行处理,直接返回已成功处理状态消息至终端,可以避免针对待处理任务的重复处理,提高任务处理效率,同时节省服务器的处理资源。In the above embodiment, the processing request sent by the terminal carries the number of repeated transmissions for the task to be processed, and the server determines whether the current processing is repeated processing based on the number of repeated transmissions and the processing result of the task to be processed, and if the number of repeated transmissions meets the preset value. condition, and the processing result is successfully processed, the server does not need to process the pending task, and directly returns a successfully processed status message to the terminal, which can avoid repeated processing of pending tasks, improve task processing efficiency, and save server processing. resource.

本申请实施例中提供了一种可能的实现方式,处理请求中还携带有与待处理任务对应的唯一识别码;步骤S202的获取针对待处理任务的处理结果,可以包括:A possible implementation manner is provided in the embodiment of the present application, and the processing request also carries a unique identification code corresponding to the task to be processed; the obtaining of the processing result for the task to be processed in step S202 may include:

基于唯一识别码在预设的数据库中查询针对待处理任务的处理结果。Based on the unique identification code, the processing result for the to-be-processed task is queried in the preset database.

其中,数据库中存储有每个已处理任务对应的唯一识别码和处理结果,每个唯一识别码与该唯一识别码对应的已处理任务的处理结果相关联。The database stores a unique identification code and a processing result corresponding to each processed task, and each unique identification code is associated with the processing result of the processed task corresponding to the unique identification code.

具体的,服务器每针对一个任务进行处理后,则获取该任务的处理结果,并将处理结果与该任务的唯一识别码进行关联,存储于预设的数据库中。Specifically, after each task is processed by the server, the server obtains the processing result of the task, associates the processing result with the unique identification code of the task, and stores it in a preset database.

例如,可以用UUID(Universally Unique Identifier,通用唯一识别码)来表示唯一识别码,针对每一个任务进行处理后,将UUID写入数据库中,例如写入redis(一种分布式内存数据库)中,将键值(key)设为UUID,处理结果value设置为0或1,如处理成功value设为0,处理失败value设为1,这样每一个处理过的任务都在redis数据库中存储有对应的UUID和value值,用以表示对应的唯一识别码和对应的处理结果。For example, UUID (Universally Unique Identifier, Universal Unique Identifier) can be used to represent the unique identifier, and after each task is processed, the UUID is written into the database, such as redis (a distributed memory database), Set the key value (key) to UUID, and set the value of the processing result to 0 or 1. For example, if the processing is successful, the value is set to 0, and if the processing fails, the value is set to 1, so that each processed task is stored in the redis database. UUID and value are used to represent the corresponding unique identification code and the corresponding processing result.

上述实施例中,服务器每针对一个任务进行处理后,则获取该任务的处理结果,并将处理结果与该任务的唯一识别码进行关联,存储于预设的数据库中,以便于下次对待处理任务进行处理时通过唯一识别码查询对应的处理结果,提高查询效率。In the above embodiment, after each task is processed by the server, the server obtains the processing result of the task, associates the processing result with the unique identification code of the task, and stores it in a preset database so as to be processed next time. When the task is processed, the corresponding processing result is queried through the unique identification code, which improves the query efficiency.

本申请实施例中提供了一种可能的实现方式,还包括:A possible implementation is provided in the embodiment of the present application, which further includes:

若出现以下情况中的任一种,则对待处理任务进行处理:If any of the following situations occur, the task to be processed is processed:

(1)重复发送次数不符合预设条件;(1) The number of repeated transmissions does not meet the preset conditions;

(2)未获取到针对待处理任务的处理结果;(2) The processing result for the task to be processed is not obtained;

(3)获取到针对待处理任务的处理结果为未成功处理。(3) It is obtained that the processing result for the task to be processed is unsuccessful processing.

其中,重复发送次数不符合预设条件,可以是重复发送次数小于或等于预设次数,也可以是重复发送次数不等于预设次数,则服务器需要对待处理任务进行处理,例如,预设次数为0,重复发送次数为0,服务器还未处理待处理任务,则需要进行处理。Among them, the number of repeated sending does not meet the preset conditions, it may be that the number of repeated sending is less than or equal to the preset number, or the number of repeated sending is not equal to the preset number, then the server needs to process the task to be processed, for example, the preset number of times is 0, the number of repeated sending is 0, and the server has not yet processed the pending task, it needs to be processed.

若未查询到针对待处理任务的处理结果,则服务器还未对待处理任务成功完成处理,则需要对待处理任务处理;若未成功处理,也需要对待处理任务进行处理。If the processing result for the to-be-processed task is not queried, the server has not successfully completed the processing of the to-be-processed task, and needs to process the to-be-processed task;

本申请实施例中提供了一种可能的实现方式,还包括:A possible implementation is provided in the embodiment of the present application, which further includes:

在对所述待处理任务进行处理后,将待处理任务的唯一识别码、以及针对待处理任务的处理结果更新写入数据库中。After the to-be-processed task is processed, the unique identification code of the to-be-processed task and the processing result for the to-be-processed task are updated and written into the database.

具体的,服务器每针对一个任务进行处理后,则获取该任务的处理结果,并将处理结果与该任务的唯一识别码进行关联,存储于预设的数据库中。Specifically, after each task is processed by the server, the server obtains the processing result of the task, associates the processing result with the unique identification code of the task, and stores it in a preset database.

若数据库中已存储有针对任务的处理结果,则将本次处理结果更新至所存储的结果中。If the processing result for the task has been stored in the database, the processing result of this time is updated to the stored result.

例如,数据库中针对任务C已存储有key为UUID,处理结果value为1,即处理失败;本次处理结果为处理成功,则将所存储的处理结果value更新为1。For example, the key is UUID stored in the database for task C, and the processing result value is 1, that is, the processing fails; if the processing result is successful this time, the stored processing result value is updated to 1.

本申请实施例中提供了一种可能的实现方式,还包括:A possible implementation is provided in the embodiment of the present application, which further includes:

若针对待处理任务的处理结果写入数据库失败,则返回对应的状态消息至终端。If the processing result of the pending task fails to be written into the database, a corresponding status message is returned to the terminal.

其中,对应不同的处理结果,状态消息包括处理成功状态消息和处理失败状态消息;若处理成功,则返回处理成功状态消息;若处理失败,则返回处理失败状态消息。Wherein, corresponding to different processing results, the status message includes a processing success status message and a processing failure status message; if the processing is successful, a processing success status message is returned; if the processing fails, a processing failure status message is returned.

具体的,返回对应的状态消息至终端,可以包括:Specifically, returning a corresponding status message to the terminal may include:

(1)若针对待处理任务处理成功,则返回处理成功状态消息至终端。(1) If the task to be processed is successfully processed, a processing success status message is returned to the terminal.

具体的,若针对待处理任务处理成功,且针对待处理任务的处理结果写入数据库失败,则返回处理成功状态消息至终端,即便数据库中未能存储到对应的处理结果,终端将不再发送针对待处理任务的处理请求到服务器。Specifically, if the task to be processed is successfully processed and the processing result of the task to be processed fails to be written into the database, a processing success status message will be returned to the terminal. Even if the corresponding processing result cannot be stored in the database, the terminal will no longer send it. Processing requests to the server for pending tasks.

(2)若针对待处理任务处理失败,则返回处理失败状态消息至终端。(2) If the processing of the task to be processed fails, a processing failure status message is returned to the terminal.

具体的,若针对待处理任务处理失败,且针对待处理任务的处理结果写入数据库失败,则返回处理失败状态消息至终端,即便数据库中未能存储到对应的处理结果,终端也将重新发送针对待处理任务的处理请求到服务器,直至待处理任务处理成功。Specifically, if the processing of the pending task fails, and the processing result of the pending task fails to be written into the database, a processing failure status message is returned to the terminal. Even if the corresponding processing result cannot be stored in the database, the terminal will re-send it. Processing requests for pending tasks are sent to the server until the pending tasks are processed successfully.

具体的,服务器还可以发出写入异常提示消息到维修终端,或警告终端,以便针对本次写入异常情况进行处理。Specifically, the server may also send a writing exception prompt message to the maintenance terminal, or warn the terminal, so as to deal with the current writing exception.

上述实施例中,若处理结果写入数据库失败,则直接返回对应的状态消息至终端,以使终端直接接收对应的处理结果,避免重新发送处理请求重复处理,进一步节省服务器的处理资源。In the above embodiment, if the processing result fails to be written into the database, the corresponding status message is directly returned to the terminal, so that the terminal can directly receive the corresponding processing result, avoid re-sending the processing request for repeated processing, and further save the processing resources of the server.

为了更好地理解上述任务处理方法,如图4所示,以下详细阐述一个本发明的任务处理方法的示例:In order to better understand the above task processing method, as shown in FIG. 4 , an example of the task processing method of the present invention is described in detail below:

在一个示例中,本申请提供的任务处理方法,可以包括如下步骤:In an example, the task processing method provided by this application may include the following steps:

1)服务器接收客户端发送的处理请求,处理请求中携带有针对待处理任务的处理请求的重复发送次数,该重复发送次数以图中所示的serialld表示;1) The server receives the processing request sent by the client, and the processing request carries the number of times of repeated sending of the processing request for the task to be processed, and the number of repeated sending is represented by the serialld shown in the figure;

2)服务器判断该重复发送次数是否等于0,若是,则进入步骤5);若否,则进入步骤3);2) The server judges whether the repeated sending times is equal to 0, if yes, then enters step 5); if not, then enters step 3);

3)获取待处理任务的处理结果,即图中所示的查询redis数据库中对应的UUID的value值;若成功获取且value值为0(表示已成功处理任务),则进入步骤4);若未能成功获取,或者获取到的value值不为0(表示未成功处理任务),则进入步骤5);3) Obtain the processing result of the task to be processed, that is, the value of the corresponding UUID in the query redis database shown in the figure; if it is successfully obtained and the value is 0 (indicating that the task has been successfully processed), then go to step 4); if If the acquisition fails, or the acquired value is not 0 (indicating that the task was not successfully processed), then go to step 5);

4)返回处理成功状态消息至客户端,例如可以以图中所示的状态码200表示;4) Return the processing success status message to the client, for example, it can be represented by the status code 200 shown in the figure;

5)对待处理任务进行处理;5) Process the tasks to be processed;

6)判断是否对待处理任务处理成功;若是,则进入步骤7);若否,则进入步骤9);6) judge whether the processing of the task to be processed is successful; if so, enter step 7); if not, enter step 9);

7)将待处理任务对应的UUID写入redis数据库,并设置value为0;7) Write the UUID corresponding to the task to be processed into the redis database, and set the value to 0;

8)若写入redis数据库失败,则返回处理成功状态消息至客户端,例如,可以以状态码200表示;8) If writing to the redis database fails, return a processing success status message to the client, for example, it can be represented by status code 200;

9)将待处理任务对应的UUID写入redis数据库,并设置value为1;9) Write the UUID corresponding to the task to be processed into the redis database, and set the value to 1;

10)若写入redis数据库失败,则返回处理失败状态消息至客户端,例如,可以以状态码500表示。10) If the writing to the redis database fails, a processing failure status message is returned to the client, for example, it can be represented by status code 500.

上述的任务处理方法,终端发送的处理请求中携带有针对待处理任务的重复发送次数,服务器结合重复发送次数和待处理任务的处理结果判断本次处理是否为重复处理,若重复发送次数符合预设条件,且处理结果为已成功处理,则服务器无需再对待处理任务进行处理,直接返回已成功处理状态消息至终端,可以避免针对待处理任务的重复处理,提高任务处理效率,同时节省服务器的处理资源。In the above task processing method, the processing request sent by the terminal carries the number of repeated transmissions for the task to be processed. If the conditions are set, and the processing result is successfully processed, the server does not need to process the pending task, and directly returns the successfully processed status message to the terminal, which can avoid repeated processing of pending tasks, improve task processing efficiency, and save server time. Process resources.

进一步的,服务器每针对一个任务进行处理后,则获取该任务的处理结果,并将处理结果与该任务的唯一识别码进行关联,存储于预设的数据库中,以便于下次对待处理任务进行处理时通过唯一识别码查询对应的处理结果,提高查询效率。Further, after each task is processed by the server, it obtains the processing result of the task, associates the processing result with the unique identification code of the task, and stores it in a preset database, so as to facilitate the processing of the task to be processed next time. During processing, the corresponding processing result is queried through the unique identification code, so as to improve the query efficiency.

进一步的,若处理结果写入数据库失败,则直接返回对应的状态消息至终端,以使终端直接接收对应的处理结果,避免重新发送处理请求重复处理,进一步节省服务器的处理资源。Further, if the processing result fails to be written into the database, the corresponding status message is directly returned to the terminal, so that the terminal can directly receive the corresponding processing result, avoid re-sending the processing request for repeated processing, and further save the processing resources of the server.

上述实施例以服务器的角度阐述了本申请的任务处理方法,以下将以终端的角度阐述本申请的任务处理方法。The above embodiments describe the task processing method of the present application from the perspective of the server, and the following describes the task processing method of the present application from the perspective of the terminal.

本申请实施例中提供了一种可能的实现方式,如图5所示,提供了一种任务处理方法,以该方法应用于图1所示的终端为例,可以包括以下步骤:A possible implementation manner is provided in the embodiment of the present application. As shown in FIG. 5 , a task processing method is provided. Taking the method applied to the terminal shown in FIG. 1 as an example, the following steps may be included:

步骤S501,发送针对待处理任务的处理请求至服务器。Step S501, sending a processing request for the to-be-processed task to the server.

其中,处理请求中携带有处理请求的重复发送次数。The processing request carries the number of times of repeated sending of the processing request.

具体的,处理请求用于使服务器在重复发送次数大于预设次数时获取针对待处理任务的处理结果。Specifically, the processing request is used to enable the server to obtain the processing result for the to-be-processed task when the number of repeated sending times is greater than the preset number of times.

其中,重复发送次数是指针对待处理任务的处理请求的第一次发送次数以外,多余的发送次数,例如,针对待处理任务的处理请求一共发送2次,则重复发送次数为1;针对待处理任务的处理请求仅发送一次,则重复发送次数为0。Among them, the number of repeated sending is the number of times of sending the processing request for the task to be processed for the first time, and the number of redundant sending. For example, if the processing request for the task to be processed is sent 2 times, the number of repeated sending is 1; The processing request of the task is only sent once, and the number of repeated sending is 0.

具体的,终端可以在发送处理请求之前,确定针对待处理任务的已发送次数,根据待处理任务的已发送次数确定处理请求的重复发送次数。Specifically, before sending the processing request, the terminal may determine the number of times of sending the task to be processed, and determine the number of times of repeated sending of the processing request according to the number of times that the task to be processed has been sent.

在一些实施方式中,预设条件可以是重复发送次数大于预设次数,预设次数可以基于预先设置的服务器需要对任务处理的次数来确定,例如,若只需要服务器对任务处理1次,则预设次数为0,即重复发送次数大于0,就认为服务器已经收到过1次处理请求。In some embodiments, the preset condition may be that the number of repeated sending times is greater than the preset number of times, and the preset number of times may be determined based on the preset number of times the server needs to process the task. For example, if the server only needs to process the task once, then The preset number of times is 0, that is, if the number of repeated transmissions is greater than 0, it is considered that the server has received a processing request once.

具体的,若重复发送次数大于预设次数,则需要判断针对待处理任务的处理结果是否为已成功处理。Specifically, if the number of repeated transmissions is greater than the preset number of times, it is necessary to determine whether the processing result for the task to be processed is successfully processed.

在另一些实施方式中,预设条件也可以是重复发送次数等于预设次数,例如预设次数为0,只要重复发送次数为0,则服务器需要对待处理任务进行处理;只要重复发送次数不为0,则服务无需对待处理任务进行处理。In other implementations, the preset condition may also be that the number of repeated transmissions is equal to the preset number of times, for example, the preset number of times is 0, as long as the number of repeated transmissions is 0, the server needs to process the task to be processed; as long as the number of repeated transmissions is not 0 0, the service does not need to process the pending task.

步骤S502,接收服务器在处理结果为待处理任务已成功处理时,返回的处理成功状态消息。Step S502, receiving a processing success status message returned by the server when the processing result is that the to-be-processed task has been successfully processed.

具体的,若待处理任务已成功处理,则服务器无需再对待处理任务进行重复处理,终端也无需再重复发送处理请求,服务器可以直接返回处理成功状态消息至终端,终端接收到处理成功状态消息后,不再发送针对待处理任务的处理请求至服务器。Specifically, if the task to be processed has been successfully processed, the server does not need to repeatedly process the task to be processed, and the terminal does not need to repeatedly send a processing request. The server can directly return a processing success status message to the terminal. After the terminal receives the processing success status message , no longer send processing requests for pending tasks to the server.

若待处理任务未成功处理,则服务器需要对待处理任务进行处理。If the pending task is not successfully processed, the server needs to process the pending task.

本申请实施例中提供了一种可能的实现方式,步骤S501的发送针对待处理任务的处理请求至服务器之前,还可以包括:A possible implementation manner is provided in the embodiment of the present application. Before sending the processing request for the to-be-processed task to the server in step S501, it may further include:

确定针对待处理任务的处理请求的已发送次数,基于已发送次数确定重复发送次数。Determines the number of times the processing request for the pending task has been sent, and based on the number of sent times, determines the number of re-sends.

具体的,可以将已发送次数减1,即得到重复发送次数。Specifically, the number of times of sending can be reduced by 1, that is, the number of times of repeated sending can be obtained.

本申请实施例中提供了一种可能的实现方式,步骤S501的发送针对待处理任务的处理请求至服务器之前,还可以包括:A possible implementation manner is provided in the embodiment of the present application. Before sending the processing request for the to-be-processed task to the server in step S501, it may further include:

生成针对待处理任务的唯一识别码,将唯一识别码添加至处理请求中。Generate a unique identifier for the pending task and add the unique identifier to the processing request.

具体的,可以用UUID来表示针对待处理任务的唯一识别码。Specifically, a UUID can be used to represent the unique identification code for the task to be processed.

在具体实施过程中,针对每一个任务进行处理后,将UUID写入数据库中,例如写入redis(一种分布式内存数据库)中,将键值(key)设为UUID,处理结果value设置为0或1,如处理成功value设为0,处理失败value设为1,这样每一个处理过的任务都在redis数据库中存储有对应的UUID和value值,用以表示对应的唯一识别码和对应的处理结果。In the specific implementation process, after processing each task, write the UUID into the database, such as redis (a distributed memory database), set the key value (key) as the UUID, and set the processing result value as 0 or 1, if the processing is successful, the value is set to 0, and if the processing fails, the value is set to 1, so that each processed task stores the corresponding UUID and value in the redis database to indicate the corresponding unique identification code and corresponding processing result.

本实施例中以终端角度描述的任务处理方法与上述实施例中以服务器角度描述的任务处理方法是相对应的,因此,本实施例中针对任务处理方法的细节,此处不再赘述。The task processing method described from the perspective of the terminal in this embodiment corresponds to the task processing method described from the perspective of the server in the above embodiment. Therefore, the details of the task processing method in this embodiment will not be repeated here.

本申请实施例中提供了一种可能的实现方式,如图6所示,提供了一种任务处理装置60,该任务处理装置60可以包括:第一接收模块601、获取模块602和第一返回模块603,其中,A possible implementation manner is provided in the embodiment of the present application. As shown in FIG. 6, a task processing apparatus 60 is provided. The task processing apparatus 60 may include: a first receiving module 601, an obtaining module 602, and a first returning Module 603, where,

第一接收模块601,用于接收终端发送的针对待处理任务的处理请求;处理请求中携带有处理请求的重复发送次数;The first receiving module 601 is configured to receive a processing request sent by a terminal for a task to be processed; the processing request carries the number of times of repeated sending of the processing request;

获取模块602,用于若重复发送次数符合预设条件,则获取针对待处理任务的处理结果;an obtaining module 602, configured to obtain a processing result for the task to be processed if the number of repeated sending times meets a preset condition;

第一返回模块603,用于若处理结果为待处理任务已成功处理,则返回处理成功状态消息至终端。The first returning module 603 is configured to return a processing success status message to the terminal if the processing result is that the to-be-processed task has been successfully processed.

本申请实施例中提供了一种可能的实现方式,处理请求中还携带有与待处理任务对应的唯一识别码;获取模块602在获取针对待处理任务的处理结果时,具体用于:A possible implementation manner is provided in the embodiment of the present application, and the processing request also carries a unique identification code corresponding to the task to be processed; when acquiring the processing result for the task to be processed, the acquiring module 602 is specifically used for:

基于唯一识别码在预设的数据库中查询针对待处理任务的处理结果;Query the processing result for the task to be processed in the preset database based on the unique identification code;

其中,数据库中存储有每个已处理任务对应的唯一识别码和处理结果,每个所述唯一识别码与该唯一识别码对应的已处理任务的处理结果相关联。The database stores a unique identification code and a processing result corresponding to each processed task, and each unique identification code is associated with the processing result of the processed task corresponding to the unique identification code.

本申请实施例中提供了一种可能的实现方式,还包括处理模块,用于若出现以下情况中的任一种,则对待处理任务进行处理:A possible implementation manner is provided in the embodiment of the present application, which further includes a processing module, configured to process the task to be processed if any of the following situations occurs:

重复发送次数不符合预设条件;The number of repeated sending does not meet the preset conditions;

未获取到针对待处理任务的处理结果;The processing result for the pending task is not obtained;

获取到针对待处理任务的处理结果为未成功处理。The processing result obtained for the pending task is unsuccessful processing.

本申请实施例中提供了一种可能的实现方式,还包括写入模块,用于:A possible implementation is provided in the embodiment of the present application, which further includes a writing module for:

在对待处理任务进行处理后,将待处理任务的唯一识别码、以及针对待处理任务的处理结果更新写入数据库中。After the to-be-processed task is processed, the unique identification code of the to-be-processed task and the processing result for the to-be-processed task are updated and written into the database.

本申请实施例中提供了一种可能的实现方式,还包括第二返回模块,用于:A possible implementation is provided in the embodiment of the present application, which further includes a second return module for:

若针对待处理任务的处理结果写入数据库失败,则返回对应的状态消息至终端。If the processing result of the pending task fails to be written into the database, a corresponding status message is returned to the terminal.

本申请实施例中提供了一种可能的实现方式,所述重复发送次数符合预设条件包括:A possible implementation manner is provided in the embodiment of the present application, and the number of times of repeated transmission meeting the preset condition includes:

所述重复发送次数大于预设次数。The number of repeated transmissions is greater than the preset number of times.

上述的任务处理装置,终端发送的处理请求中携带有针对待处理任务的重复发送次数,服务器结合重复发送次数和待处理任务的处理结果判断本次处理是否为重复处理,若重复发送次数符合预设条件,且处理结果为已成功处理,则服务器无需再对待处理任务进行处理,直接返回已成功处理状态消息至终端,可以避免针对待处理任务的重复处理,提高任务处理效率,同时节省服务器的处理资源。In the above-mentioned task processing device, the processing request sent by the terminal carries the number of repeated transmissions for the task to be processed, and the server determines whether the current processing is repeated processing based on the number of repeated transmissions and the processing result of the task to be processed. If the conditions are set, and the processing result is successfully processed, the server does not need to process the pending task, and directly returns the successfully processed status message to the terminal, which can avoid repeated processing of pending tasks, improve task processing efficiency, and save server time. Process resources.

进一步的,服务器每针对一个任务进行处理后,则获取该任务的处理结果,并将处理结果与该任务的唯一识别码进行关联,存储于预设的数据库中,以便于下次对待处理任务进行处理时通过唯一识别码查询对应的处理结果,提高查询效率。Further, after each task is processed by the server, it obtains the processing result of the task, associates the processing result with the unique identification code of the task, and stores it in a preset database, so as to facilitate the processing of the task to be processed next time. During processing, the corresponding processing result is queried through the unique identification code, so as to improve the query efficiency.

进一步的,若处理结果写入数据库失败,则直接返回对应的状态消息至终端,以使终端直接接收对应的处理结果,避免重新发送处理请求重复处理,进一步节省服务器的处理资源。Further, if the processing result fails to be written into the database, the corresponding status message is directly returned to the terminal, so that the terminal can directly receive the corresponding processing result, avoid re-sending the processing request for repeated processing, and further save the processing resources of the server.

本申请实施例中提供了一种可能的实现方式,如图7所示,提供了一种任务处理装置70,该任务处理装置70可以包括:发送模块701和第二接收模块702,其中,A possible implementation manner is provided in the embodiment of the present application. As shown in FIG. 7 , a task processing apparatus 70 is provided. The task processing apparatus 70 may include: a sending module 701 and a second receiving module 702, wherein,

发送模块701,用于发送针对待处理任务的处理请求至服务器;处理请求中携带有处理请求的重复发送次数;A sending module 701, configured to send a processing request for the task to be processed to the server; the processing request carries the number of times of repeated sending of the processing request;

第二接收模块702,用于接收服务器在处理结果为待处理任务已成功处理时,返回的处理成功状态消息。The second receiving module 702 is configured to receive a processing success status message returned by the server when the processing result is that the to-be-processed task has been successfully processed.

本申请实施例中提供了一种可能的实现方式,还包括确定模块,用于:A possible implementation is provided in the embodiment of the present application, which further includes a determination module for:

确定针对待处理任务的处理请求的已发送次数,基于已发送次数确定重复发送次数。Determines the number of times the processing request for the pending task has been sent, and based on the number of sent times, determines the number of re-sends.

本申请实施例中提供了一种可能的实现方式,还包括生成模块,用于:A possible implementation is provided in the embodiment of the present application, which further includes a generating module for:

生成针对待处理任务的唯一识别码,将唯一识别码添加至处理请求中。Generate a unique identifier for the pending task and add the unique identifier to the processing request.

本公开实施例的任务处理装置可执行本公开的实施例所提供的一种任务处理方法,其实现原理相类似,本公开各实施例中的任务处理装置中的各模块所执行的动作是与本公开各实施例中的任务处理方法中的步骤相对应的,对于任务处理装置的各模块的详细功能描述具体可以参见前文中所示的对应的任务处理方法中的描述,此处不再赘述。The task processing apparatus in the embodiments of the present disclosure can execute a task processing method provided by the embodiments of the present disclosure, and the implementation principle is similar. The actions performed by each module in the task processing apparatus in the embodiments of the present disclosure are the same as Corresponding to the steps in the task processing method in each embodiment of the present disclosure, for the detailed functional description of each module of the task processing apparatus, please refer to the description in the corresponding task processing method shown above, which will not be repeated here. .

基于与本公开的实施例中所示的方法相同的原理,本公开的实施例中还提供了一种电子设备,该电子设备可以包括但不限于:处理器和存储器;存储器,用于存储计算机操作指令;处理器,用于通过调用计算机操作指令执行实施例所示的任务处理方法。与现有技术相比,本申请中的任务处理方法可以避免针对待处理任务的重复处理,提高任务处理效率,同时节省服务器的处理资源。Based on the same principles as the methods shown in the embodiments of the present disclosure, the embodiments of the present disclosure also provide an electronic device, which may include but is not limited to: a processor and a memory; a memory for storing a computer An operation instruction; a processor, configured to execute the task processing method shown in the embodiment by invoking the computer operation instruction. Compared with the prior art, the task processing method in the present application can avoid repeated processing of tasks to be processed, improve task processing efficiency, and save processing resources of the server at the same time.

在一个可选实施例中提供了一种电子设备,如图8所示,图8所示的电子设备4000包括:处理器4001和存储器4003。其中,处理器4001和存储器4003相连,如通过总线4002相连。可选地,电子设备4000还可以包括收发器4004。需要说明的是,实际应用中收发器4004不限于一个,该电子设备4000的结构并不构成对本申请实施例的限定。In an optional embodiment, an electronic device is provided. As shown in FIG. 8 , the electronic device 4000 shown in FIG. 8 includes: a processor 4001 and a memory 4003 . The processor 4001 is connected to the memory 4003, for example, through the bus 4002. Optionally, the electronic device 4000 may also include a transceiver 4004 . It should be noted that, in practical applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation to the embodiments of the present application.

处理器4001可以是CPU(Central Processing Unit,中央处理器),通用处理器,DSP(Digital Signal Processor,数据信号处理器),ASIC(Application SpecificIntegrated Circuit,专用集成电路),FPGA(Field Programmable Gate Array,现场可编程门阵列)或者其他可编程逻辑器件、晶体管逻辑器件、硬件部件或者其任意组合。其可以实现或执行结合本申请公开内容所描述的各种示例性的逻辑方框,模块和电路。处理器4001也可以是实现计算功能的组合,例如包含一个或多个微处理器组合,DSP和微处理器的组合等。The processor 4001 may be a CPU (Central Processing Unit, central processing unit), a general-purpose processor, a DSP (Digital Signal Processor, data signal processor), an ASIC (Application Specific Integrated Circuit, an application-specific integrated circuit), an FPGA (Field Programmable Gate Array, Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute the various exemplary logical blocks, modules and circuits described in connection with this disclosure. The processor 4001 may also be a combination for realizing computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

总线4002可包括一通路,在上述组件之间传送信息。总线4002可以是PCI(Peripheral Component Interconnect,外设部件互连标准)总线或EISA(ExtendedIndustry Standard Architecture,扩展工业标准结构)总线等。总线4002可以分为地址总线、数据总线、控制总线等。为便于表示,图8中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The bus 4002 may include a path to transfer information between the components described above. The bus 4002 may be a PCI (Peripheral Component Interconnect, Peripheral Component Interconnect Standard) bus or an EISA (Extended Industry Standard Architecture, Extended Industry Standard Architecture) bus or the like. The bus 4002 can be divided into an address bus, a data bus, a control bus, and the like. For ease of presentation, only one thick line is used in FIG. 8, but it does not mean that there is only one bus or one type of bus.

存储器4003可以是ROM(Read Only Memory,只读存储器)或可存储静态信息和指令的其他类型的静态存储设备,RAM(Random Access Memory,随机存取存储器)或者可存储信息和指令的其他类型的动态存储设备,也可以是EEPROM(Electrically ErasableProgrammable Read Only Memory,电可擦可编程只读存储器)、CD-ROM(Compact DiscRead Only Memory,只读光盘)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。The memory 4003 can be a ROM (Read Only Memory, read only memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory, random access memory) or other types that can store information and instructions. A dynamic storage device can also be an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory, a CD-ROM) or other CD-ROM storage, CD-ROM storage (including compressed CDs, Laser Disc, Optical Disc, Digital Versatile Disc, Blu-ray Disc, etc.), magnetic disk storage medium or other magnetic storage device, or any other capable of carrying or storing desired program code in the form of instructions or data structures and capable of being accessed by a computer medium, but not limited to this.

存储器4003用于存储执行本申请方案的应用程序代码,并由处理器4001来控制执行。处理器4001用于执行存储器4003中存储的应用程序代码,以实现前述方法实施例所示的内容。The memory 4003 is used for storing the application program code for executing the solution of the present application, and the execution is controlled by the processor 4001 . The processor 4001 is configured to execute the application program code stored in the memory 4003 to implement the content shown in the foregoing method embodiments.

其中,电子设备包括但不限于:移动电话、笔记本电脑、数字广播接收器、PDA(个人数字助理)、PAD(平板电脑)、PMP(便携式多媒体播放器)、车载终端(例如车载导航终端)等等的移动终端以及诸如数字TV、台式计算机等等的固定终端。图8示出的电子设备仅仅是一个示例,不应对本公开实施例的功能和使用范围带来任何限制。Among them, electronic devices include but are not limited to: mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (such as in-vehicle navigation terminals), etc. Mobile terminals such as digital TVs, desktop computers, etc., as well as stationary terminals. The electronic device shown in FIG. 8 is only an example, and should not impose any limitation on the function and scope of use of the embodiments of the present disclosure.

本申请实施例提供了一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,当其在计算机上运行时,使得计算机可以执行前述方法实施例中相应内容。与现有技术相比,本申请中的任务处理方法可以避免针对待处理任务的重复处理,提高任务处理效率,同时节省服务器的处理资源。Embodiments of the present application provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program runs on the computer, the computer can execute the corresponding content in the foregoing method embodiments. Compared with the prior art, the task processing method in the present application can avoid repeated processing of tasks to be processed, improve task processing efficiency, and save processing resources of the server at the same time.

应该理解的是,虽然附图的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,其可以以其他的顺序执行。而且,附图的流程图中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,其执行顺序也不必然是依次进行,而是可以与其他步骤或者其他步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flowchart of the accompanying drawings are sequentially shown in the order indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless explicitly stated herein, the execution of these steps is not strictly limited to the order and may be performed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but may be executed at different times, and the execution sequence is also It does not have to be performed sequentially, but may be performed alternately or alternately with other steps or at least a portion of sub-steps or stages of other steps.

需要说明的是,本公开上述的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本公开中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本公开中,计算机可读信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读信号介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:电线、光缆、RF(射频)等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the above two. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or a combination of any of the above. More specific examples of computer readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer disks, hard disks, random access memory (RAM), read only memory (ROM), erasable Programmable read only memory (EPROM or flash memory), fiber optics, portable compact disk read only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing. In this disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present disclosure, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave with computer-readable program code embodied thereon. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device . Program code embodied on a computer readable medium may be transmitted using any suitable medium including, but not limited to, electrical wire, optical fiber cable, RF (radio frequency), etc., or any suitable combination of the foregoing.

上述计算机可读介质可以是上述电子设备中所包含的;也可以是单独存在,而未装配入该电子设备中。The above-mentioned computer-readable medium may be included in the above-mentioned electronic device; or may exist alone without being assembled into the electronic device.

上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被该电子设备执行时,使得该电子设备执行上述实施例所示的方法。The aforementioned computer-readable medium carries one or more programs, and when the aforementioned one or more programs are executed by the electronic device, causes the electronic device to execute the methods shown in the foregoing embodiments.

本申请实施例提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行时实现如下情况:Embodiments of the present application provide a computer program product or computer program, where the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that when the computer device executes, the following conditions are realized:

接收终端发送的针对待处理任务的处理请求;所述处理请求中携带有所述处理请求的重复发送次数;receiving a processing request for the task to be processed sent by the terminal; the processing request carries the number of times of repeated sending of the processing request;

若所述重复发送次数符合预设条件,则获取针对所述待处理任务的处理结果;If the number of times of repeated sending meets a preset condition, obtaining a processing result for the to-be-processed task;

若所述处理结果为所述待处理任务已成功处理,则返回处理成功状态消息至所述终端。If the processing result is that the to-be-processed task has been successfully processed, a processing success status message is returned to the terminal.

本申请实施例提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行时实现如下情况:Embodiments of the present application provide a computer program product or computer program, where the computer program product or computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that when the computer device executes, the following conditions are realized:

发送针对待处理任务的处理请求至服务器;所述处理请求中携带有所述处理请求的重复发送次数;Send a processing request for the task to be processed to the server; the processing request carries the number of times of repeated sending of the processing request;

接收所述服务器在处理结果为所述待处理任务已成功处理时,返回的处理成功状态消息。Receive a processing success status message returned by the server when the processing result is that the to-be-processed task has been successfully processed.

可以以一种或多种程序设计语言或其组合来编写用于执行本公开的操作的计算机程序代码,上述程序设计语言包括面向对象的程序设计语言—诸如Java、Smalltalk、C++,还包括常规的过程式程序设计语言—诸如“C”语言或类似的程序设计语言。程序代码可以完全地在用户计算机上执行、部分地在用户计算机上执行、作为一个独立的软件包执行、部分在用户计算机上部分在远程计算机上执行、或者完全在远程计算机或服务器上执行。在涉及远程计算机的情形中,远程计算机可以通过任意种类的网络——包括局域网(LAN)或广域网(WAN)—连接到用户计算机,或者,可以连接到外部计算机(例如利用因特网服务提供商来通过因特网连接)。Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including object-oriented programming languages—such as Java, Smalltalk, C++, but also conventional Procedural programming language - such as the "C" language or similar programming language. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer, or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (eg, using an Internet service provider through Internet connection).

附图中的流程图和框图,图示了按照本公开各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,该模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more logical functions for implementing the specified functions executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the blocks may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It is also noted that each block of the block diagrams and/or flowchart illustrations, and combinations of blocks in the block diagrams and/or flowchart illustrations, can be implemented in dedicated hardware-based systems that perform the specified functions or operations , or can be implemented in a combination of dedicated hardware and computer instructions.

描述于本公开实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。其中,模块的名称在某种情况下并不构成对该模块本身的限定,例如,第一接收模块还可以被描述为“用于接收处理请求的模块”。The modules involved in the embodiments of the present disclosure may be implemented in software or hardware. Wherein, the name of the module does not constitute a limitation of the module itself under certain circumstances, for example, the first receiving module may also be described as "a module for receiving processing requests".

以上描述仅为本公开的较佳实施例以及对所运用技术原理的说明。本领域技术人员应当理解,本公开中所涉及的公开范围,并不限于上述技术特征的特定组合而成的技术方案,同时也应涵盖在不脱离上述公开构思的情况下,由上述技术特征或其等同特征进行任意组合而形成的其它技术方案。例如上述特征与本公开中公开的(但不限于)具有类似功能的技术特征进行互相替换而形成的技术方案。The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, and should also cover, without departing from the above-mentioned disclosed concept, the technical solutions formed by the above-mentioned technical features or Other technical solutions formed by any combination of its equivalent features. For example, a technical solution is formed by replacing the above features with the technical features disclosed in the present disclosure (but not limited to) with similar functions.

Claims (13)

1.一种任务处理方法,其特征在于,包括:1. a task processing method, is characterized in that, comprises: 接收终端发送的针对待处理任务的处理请求;所述处理请求中携带有所述处理请求的重复发送次数;receiving a processing request for the task to be processed sent by the terminal; the processing request carries the number of times of repeated sending of the processing request; 若所述重复发送次数符合预设条件,则获取针对所述待处理任务的处理结果;If the number of times of repeated sending meets a preset condition, obtaining a processing result for the to-be-processed task; 若所述处理结果为所述待处理任务已成功处理,则返回处理成功状态消息至所述终端。If the processing result is that the to-be-processed task has been successfully processed, a processing success status message is returned to the terminal. 2.根据权利要求1所述的任务处理方法,其特征在于,所述处理请求中还携带有与所述待处理任务对应的唯一识别码;所述获取针对所述待处理任务的处理结果,包括:2. The task processing method according to claim 1, wherein the processing request also carries a unique identification code corresponding to the task to be processed; the acquisition of the processing result for the task to be processed, include: 基于所述唯一识别码在预设的数据库中查询针对所述待处理任务的处理结果;query the processing result for the to-be-processed task in a preset database based on the unique identification code; 其中,所述数据库中存储有每个已处理任务对应的唯一识别码和处理结果,每个所述唯一识别码与该唯一识别码对应的已处理任务的处理结果相关联。Wherein, the database stores a unique identification code and a processing result corresponding to each processed task, and each unique identification code is associated with the processing result of the processed task corresponding to the unique identification code. 3.根据权利要求1所述的任务处理方法,其特征在于,还包括:3. task processing method according to claim 1, is characterized in that, also comprises: 若出现以下情况中的任一种,则对所述待处理任务进行处理:If any of the following situations occurs, the to-be-processed task is processed: 所述重复发送次数不符合所述预设条件;The number of repeated transmissions does not meet the preset condition; 未获取到针对所述待处理任务的处理结果;The processing result for the task to be processed is not obtained; 获取到针对所述待处理任务的处理结果为未成功处理。The acquired processing result for the to-be-processed task is unsuccessful processing. 4.根据权利要求3所述的任务处理方法,其特征在于,还包括:4. task processing method according to claim 3, is characterized in that, also comprises: 在对所述待处理任务进行处理后,将所述待处理任务的唯一识别码、以及针对所述待处理任务的处理结果写入所述数据库中,以更新所述数据库。After the to-be-processed task is processed, the unique identification code of the to-be-processed task and the processing result for the to-be-processed task are written into the database to update the database. 5.根据权利要求4所述的任务处理方法,其特征在于,还包括:5. task processing method according to claim 4, is characterized in that, also comprises: 若针对所述待处理任务的处理结果写入所述数据库失败,则返回对应的状态消息至所述终端。If the processing result of the task to be processed fails to be written into the database, a corresponding status message is returned to the terminal. 6.根据权利要求1所述的任务处理方法,其特征在于,所述重复发送次数符合预设条件包括:6. The task processing method according to claim 1, wherein the repeated sending times conforming to a preset condition comprises: 所述重复发送次数大于预设次数。The number of repeated transmissions is greater than the preset number of times. 7.一种任务处理方法,其特征在于,包括:7. A task processing method, comprising: 发送针对待处理任务的处理请求至服务器;所述处理请求中携带有所述处理请求的重复发送次数;Send a processing request for the task to be processed to the server; the processing request carries the number of times of repeated sending of the processing request; 接收所述服务器在处理结果为所述待处理任务已成功处理时,返回的处理成功状态消息。Receive a processing success status message returned by the server when the processing result is that the to-be-processed task has been successfully processed. 8.根据权利要求7所述的任务处理方法,其特征在于,所述发送针对待处理任务的处理请求至服务器之前,还包括:8. The task processing method according to claim 7, wherein before the sending the processing request for the task to be processed to the server, the method further comprises: 确定针对所述待处理任务的处理请求的已发送次数,基于所述已发送次数确定所述重复发送次数。The number of times the processing request for the task to be processed has been sent is determined, and the number of times of repeated sending is determined based on the number of times of sending. 9.根据权利要求7所述的任务处理方法,其特征在于,所述发送针对待处理任务的处理请求至服务器之前,还包括:9. The task processing method according to claim 7, wherein before the sending the processing request for the task to be processed to the server, the method further comprises: 生成针对所述待处理任务的唯一识别码,将所述唯一识别码添加至所述处理请求中。A unique identification code for the task to be processed is generated, and the unique identification code is added to the processing request. 10.一种任务处理装置,其特征在于,包括:10. A task processing device, comprising: 第一接收模块,用于接收终端发送的针对待处理任务的处理请求;所述处理请求中携带有所述处理请求的重复发送次数;a first receiving module, configured to receive a processing request sent by a terminal for a task to be processed; the processing request carries the number of times of repeated sending of the processing request; 获取模块,用于若所述重复发送次数符合预设条件,则获取针对所述待处理任务的处理结果;an obtaining module, configured to obtain a processing result for the task to be processed if the number of times of repeated sending meets a preset condition; 返回模块,用于若所述处理结果为所述待处理任务已成功处理,则返回处理成功状态消息至所述终端。The returning module is configured to return a processing success status message to the terminal if the processing result is that the to-be-processed task has been successfully processed. 11.一种任务处理装置,其特征在于,包括:11. A task processing device, comprising: 发送模块,用于发送针对待处理任务的处理请求至服务器;所述处理请求中携带有所述处理请求的重复发送次数;a sending module, configured to send a processing request for the task to be processed to the server; the processing request carries the number of times of repeated sending of the processing request; 第二接收模块,用于接收所述服务器在处理结果为所述待处理任务已成功处理时,返回的处理成功状态消息。The second receiving module is configured to receive a processing success status message returned by the server when the processing result is that the to-be-processed task has been successfully processed. 12.一种电子设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机程序,其特征在于,所述处理器执行所述程序时实现权利要求1-9任一项所述的任务处理方法。12. An electronic device comprising a memory, a processor and a computer program stored on the memory and running on the processor, wherein the processor implements any one of claims 1-9 when executing the program The described task processing method. 13.一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,该程序被处理器执行时实现权利要求1-9任一项所述的任务处理方法。13. A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the program is executed by a processor, the task processing method according to any one of claims 1-9 is implemented.
CN202110461735.4A 2021-04-27 2021-04-27 Task processing method, apparatus, electronic device and readable storage medium Pending CN115248817A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110461735.4A CN115248817A (en) 2021-04-27 2021-04-27 Task processing method, apparatus, electronic device and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110461735.4A CN115248817A (en) 2021-04-27 2021-04-27 Task processing method, apparatus, electronic device and readable storage medium

Publications (1)

Publication Number Publication Date
CN115248817A true CN115248817A (en) 2022-10-28

Family

ID=83697018

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110461735.4A Pending CN115248817A (en) 2021-04-27 2021-04-27 Task processing method, apparatus, electronic device and readable storage medium

Country Status (1)

Country Link
CN (1) CN115248817A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100042675A1 (en) * 2008-08-12 2010-02-18 Hitachi, Ltd. Request processing method and computer system
WO2017076193A1 (en) * 2015-11-05 2017-05-11 北京奇虎科技有限公司 Method and apparatus for processing request from client
CN110147934A (en) * 2019-04-17 2019-08-20 深圳壹账通智能科技有限公司 Service request processing method, device, computer equipment and storage medium
CN112233002A (en) * 2019-06-26 2021-01-15 中国移动通信集团江西有限公司 A task processing method, device, storage medium and server
CN112579620A (en) * 2020-12-23 2021-03-30 上海上实龙创智能科技股份有限公司 Message queue-based distributed system data final consistency method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20100042675A1 (en) * 2008-08-12 2010-02-18 Hitachi, Ltd. Request processing method and computer system
WO2017076193A1 (en) * 2015-11-05 2017-05-11 北京奇虎科技有限公司 Method and apparatus for processing request from client
CN110147934A (en) * 2019-04-17 2019-08-20 深圳壹账通智能科技有限公司 Service request processing method, device, computer equipment and storage medium
CN112233002A (en) * 2019-06-26 2021-01-15 中国移动通信集团江西有限公司 A task processing method, device, storage medium and server
CN112579620A (en) * 2020-12-23 2021-03-30 上海上实龙创智能科技股份有限公司 Message queue-based distributed system data final consistency method

Similar Documents

Publication Publication Date Title
CN113840012B (en) Block chain-based screen recording evidence obtaining method and system and electronic equipment
CN111309747A (en) Data synchronization method, system and device
CN112138376A (en) Cloud game archiving method and device and electronic equipment
CN113641873B (en) Data processing method and device, electronic equipment and readable storage medium
CN109685508B (en) Transaction data processing method, device, electronic device and readable storage medium
CN110580305A (en) Method, device, system and medium for generating identifier
CN111444148B (en) Data transmission method and device based on MapReduce
CN114817409A (en) Label generation method, device, equipment and medium
CN111338834A (en) Data storage method and device
CN111679892A (en) Distributed transaction processing method, device, equipment and medium
CN110781159B (en) Ceph directory file information reading method and device, server and storage medium
CN116700907A (en) Service call requirements document storage method, device, electronic device and readable medium
CN114625402A (en) Application update method, apparatus, electronic device, and computer-readable storage medium
CN115248817A (en) Task processing method, apparatus, electronic device and readable storage medium
CN109741069B (en) Transaction data processing method, device, electronic device and readable storage medium
CN110147368A (en) Data acquisition method and apparatus for server
CN111460020B (en) Method, device, electronic equipment and medium for resolving message
CN117055528A (en) Vehicle fault diagnosis method and device, electronic equipment and readable storage medium
CN115348260A (en) Information processing method, device, equipment and medium based on campus information security
CN115729824A (en) Script testing method, device, equipment and storage medium
CN116522200A (en) Data circulation method, device, equipment, storage medium and product
CN115934375A (en) An information processing method, device, electronic device, and computer-readable medium
CN112799863B (en) Method and device for outputting information
CN118093218A (en) Device driver management method, device, equipment and storage medium
CN112182085A (en) Data export method, device, 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