CN113780704A - Task processing method and device - Google Patents

Task processing method and device Download PDF

Info

Publication number
CN113780704A
CN113780704A CN202011135660.2A CN202011135660A CN113780704A CN 113780704 A CN113780704 A CN 113780704A CN 202011135660 A CN202011135660 A CN 202011135660A CN 113780704 A CN113780704 A CN 113780704A
Authority
CN
China
Prior art keywords
task
data file
service
execution
generating
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
CN202011135660.2A
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 Jingdong Zhenshi Information Technology Co Ltd
Original Assignee
Beijing Jingdong Zhenshi 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 Jingdong Zhenshi Information Technology Co Ltd filed Critical Beijing Jingdong Zhenshi Information Technology Co Ltd
Priority to CN202011135660.2A priority Critical patent/CN113780704A/en
Publication of CN113780704A publication Critical patent/CN113780704A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/06Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
    • G06Q10/063Operations research, analysis or management
    • G06Q10/0631Resource planning, allocation, distributing or scheduling for enterprises or organisations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q10/00Administration; Management
    • G06Q10/10Office automation; Time management
    • G06Q10/101Collaborative creation, e.g. joint development of products or services

Landscapes

  • Business, Economics & Management (AREA)
  • Human Resources & Organizations (AREA)
  • Engineering & Computer Science (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Strategic Management (AREA)
  • Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Marketing (AREA)
  • Operations Research (AREA)
  • Quality & Reliability (AREA)
  • Tourism & Hospitality (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Development Economics (AREA)
  • Educational Administration (AREA)
  • Game Theory and Decision Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a task processing method and a task processing device, wherein the method comprises the following steps: acquiring task information and initialization data collected by a management platform; generating a task main table according to the task information, and creating a task detail table; generating service data according to the initialization data and the task information; generating data files corresponding to a plurality of tasks from the service data, generating a task list of each task, and storing the task list in the task list; when any task is executed, acquiring a corresponding data file according to the storage address of the data file of the task; calling a corresponding execution method according to the task type, and calling a corresponding service according to the service calling mode to execute the task; and when the task is completely executed, updating the task state in the task detail of the task and the task state in the task main table according to the execution result. The method can reduce cost, save time and reduce error rate.

Description

Task processing method and device
Technical Field
The invention relates to the technical field of internet, in particular to a task processing method and a task processing device.
Background
At present, in some systems requiring a large amount of configuration initialization, for example, in a large-scale electrical warehouse opening system, an operator is required to send mails to related systems such as authority system research personnel, WMS research personnel, scheduling research personnel and the like to perform related setting work, the setting work is complex, the setting time is long, generally, a large-scale electrical appliance WMS system needs to wait for warehouse operation to complete and then configure a series of settings, according to the experience of warehouse opening for many times, the average time length of one time needs to be researched and developed, products, operation and maintenance and the like are not less than about 4 people, the average time of each person is about half a day, along with the increase of large-scale electrical business, the number of warehouse opening is increased every year, and large personnel cost is brought to the related personnel such as research and development, operation and maintenance and the like.
In the process of implementing the present application, the inventor finds that the implementation of such manual configuration initialization is labor-consuming, long in implementation time, and prone to errors.
Disclosure of Invention
In view of the above, the present application provides a task processing method and apparatus, which can reduce cost, save time, and reduce error rate.
In order to solve the technical problem, the technical scheme of the application is realized as follows:
in one embodiment, a task processing method is provided, the method comprising:
acquiring task information and initialization data collected by a management platform;
generating a task main table according to the task information, and creating a task detail table;
generating service data according to the initialization data and the task information;
generating data files corresponding to a plurality of tasks from the service data, generating a task list of each task, and storing the task list in the task list; wherein the task details include: the storage address, the task type, the service calling mode and the execution state of the data file;
when any task is executed, acquiring a corresponding data file according to the storage address of the data file of the task; calling a corresponding execution method according to the task type, and calling a corresponding service according to the service calling mode to execute the task;
and when the task is executed, updating the task state in the task detail of the task and the task state in the task main table according to an execution result, wherein the task state in the task main table is determined by the task states in all the task details.
In another embodiment, there is provided a task processing apparatus including: the device comprises an acquisition unit, a first generation unit, a second generation unit, a third generation unit and an execution unit;
the acquisition unit is used for acquiring the task information and the initialization data collected by the management platform;
the first generating unit is used for generating a task main table according to the task information acquired by the acquiring unit;
the second generating unit is used for generating service data according to the initialization data and the task information acquired by the acquiring unit;
the third generating unit is used for creating a task list; generating a data file corresponding to a plurality of tasks from the service data generated by the second generating unit, generating a task list of each task, and storing the task list in the task list; wherein the task details include: the storage address, the task type, the service calling mode and the execution state of the data file; when the execution unit finishes executing the task, updating the task state in the task detail of the task and the task state in the task main table according to an execution result, wherein the task state in the task main table is determined by the task states in all the task details;
the execution unit is used for acquiring a corresponding data file according to the storage address of the data file of the task in the third generation unit when any task is executed; and calling a corresponding execution method according to the task type, and calling a corresponding service according to the service calling mode to execute the task.
In another embodiment, an electronic device is provided, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the task processing method when executing the program.
In another embodiment, a computer-readable storage medium is provided, on which a computer program is stored which, when being executed by a processor, carries out the steps of the task processing method.
According to the technical scheme, the task information and the initialization data collected by the management platform are obtained, the business data are generated according to the task information and the initialization data, the business data are converted into a plurality of tasks to be processed, and the business data are processed when all the tasks are processed. The scheme can reduce cost, save time and reduce error rate.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive labor.
FIG. 1 is a schematic diagram illustrating a task processing flow according to an embodiment of the present application;
FIG. 2 is a schematic view of a configuration interface provided in an embodiment of the present application;
FIG. 3 is a schematic diagram illustrating a task processing flow according to a second embodiment of the present application;
FIG. 4 is a schematic diagram of an apparatus for implementing the above technique in an embodiment of the present application;
fig. 5 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "first," "second," "third," "fourth," and the like in the description and in the claims, as well as in the drawings, if any, 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 invention described herein are, for example, capable of operation in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprising" and "having," as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements explicitly listed, but may include other steps or elements not explicitly listed or inherent to such process, method, article, or apparatus.
The technical solution of the present invention will be described in detail with specific examples. Several of the following embodiments may be combined with each other and some details of the same or similar concepts or processes may not be repeated in some embodiments.
The embodiment of the application provides a task processing method, which converts system initialization work into tasks and realizes automatic processing of the tasks so as to realize automatic processing of system initialization. The method can be applied to a system which needs a large amount of configuration initialization, such as large household appliance opening and other scenes. According to the scheme, system initialization is realized automatically, the cost can be reduced, the time is saved, and the error rate is reduced.
The task processing method in the embodiment of the application is applied to a task processing system, and comprises the following steps: a management platform and a service background;
the management platform is used for receiving task information configured by a user and uploaded initialization data and sending the task information and the uploaded initialization data to the service background;
after the service background acquires the task information and the initialization data collected by the management platform, a task main table is generated according to the task information, and a task detail table is created;
generating service data according to the initialization data and the task information;
generating data files corresponding to a plurality of tasks from the service data, generating a task list of each task, and storing the task list in the task list; wherein the task details include: the storage address, the task type, the service calling mode and the execution state of the data file; when any task is executed, acquiring a corresponding data file according to the storage address of the data file of the task; calling a corresponding execution method according to the task type, and calling a corresponding service according to the service calling mode to execute the task; and when the task is executed, updating the task state in the task detail of the task and the task state in the task main table according to an execution result, wherein the task state in the task main table is determined by the task states in all the task details.
The following describes in detail a task processing procedure in an embodiment of the present application with reference to the drawings.
Example one
Referring to fig. 1, fig. 1 is a schematic diagram illustrating a task processing flow in a first embodiment of the present application. The method comprises the following specific steps:
step 101, acquiring task information and initialization data collected by a management platform.
And the management platform presents the configuration page to the user, so that the user configures task information on the configuration interface according to actual needs and uploads initialization data.
The specific information about the configuration can be set according to actual needs.
Referring to fig. 2, fig. 2 is a schematic view of a configuration interface provided in the embodiment of the present application. Taking the system opening as an example in the configuration interface of fig. 2, the configurable task information is:
a facility, such as may be Beijing XX corporation;
the area can be provided with selectable items according to actual division, such as northeast, southwest, China and other areas;
the method comprises the following steps that distribution center codes and distribution center names are configured or XX distribution centers are selected according to actual needs, and corresponding codes and names are input;
the warehouse type, such as a large warehouse, is divided according to actual needs and can be input through configured options;
the name of the warehouse corresponds to the name of the warehouse opened, such as the XX warehouse.
If the initialization data exists, the initialization data can be uploaded in the form of an uploading attachment, such as a WMS file.
The initialization data refers to initialization data which is configured according to some specified requirements corresponding to the current application scene and is the basis of the initialization of the whole system.
When the user finishes configuring the data to be configured and uploaded, selecting a confirmation execution button, and acquiring a configuration interface, namely, sending the acquired task information and the initialization data to a service background through a transmission interface between a management platform and the service background;
and the service background acquires the task information and the initialization data acquired by the management platform.
And 102, generating a task main table according to the task information and creating a task detail table.
And generating a task main table according to the task information, wherein the task main table comprises the task information and the task state.
If the task information includes organization, region, distribution center code, distribution center name, warehouse type and warehouse name, the contents contained in the task master table are shown in table 1.
Figure BDA0002736535830000061
TABLE 1
Wherein the task state comprises: success, partial failure, and failure.
And 103, generating service data according to the initialization data and the task information.
The service data refers to the service data required by the current whole open-warehouse service. The service data corresponds to the range defined by the task information and is data based on the initialization data.
And 104, generating data files corresponding to a plurality of tasks from the service data, generating a task list of each task, and storing the task list in the task list.
The business data of the whole warehouse opening system is divided into a plurality of tasks to be executed, and a corresponding data file is generated for each task.
The generated data file can be an sql file or a big data file;
the method further comprises the following steps:
when the data file is an sql file and the size of the sql file is larger than a preset threshold value, performing cloud storage on the data file, and generating a storage address of the data file;
when the data file is an sql file and the size of the sql file is not larger than a preset threshold value, storing the data file locally and generating a storage address of the data file;
the preset threshold value may be set according to practical applications, such as 5M.
And when the data file is a big data file, carrying out cloud storage on the data file, and generating a storage address of the data file.
When the data file is stored in the cloud, the data file can be stored in a file storage system (jfs), so that the large data file can be conveniently stored and read, and the occupation of storage resources when the local file is stored is reduced.
The task detail of the task generated for each task includes: the storage address, the task type, the service calling mode and the execution state of the data file;
when the data file is an sql file, the task types comprise adding, deleting, modifying, inquiring and caching; when the data file is a big data file, the task type comprises adding and caching;
the task type may be represented by using different fields or a certain value, such as add use 0, modify use 2, delete use 3, etc., which is not limited in the embodiment of the present application.
The service calling mode comprises local calling and remote calling.
Referring to table 2, table 2 shows the details of the task list.
Figure BDA0002736535830000071
TABLE 2
A task detail is given in table 2, the data file corresponding to the task is an sql file, the sql file is stored locally and corresponds to a local storage address, the corresponding task type is a query, the calling mode is a remote call, a remote service needs to be called to execute the task, and the execution state is an execution success, that is, the task is executed and the execution success is indicated.
In specific implementation, the task list may further include a record of the number of executed lines (which line is executed), an execution time, and the like, and the entries in the task list may be added according to actual needs, which is not limited in this embodiment of the present application.
105, when any task is executed, acquiring a corresponding data file according to a storage address of the data file of the task; and calling a corresponding execution method according to the task type, and calling a corresponding service according to the service calling mode to execute the task.
Presetting execution methods corresponding to different task types; and after the task type of the task is determined, calling an execution method corresponding to the corresponding task type.
If the service calling mode is local calling, calling a local service to execute the task includes:
when the local service is called to process the data file, if the data file is stored in a cloud end, the data file is downloaded to the local;
when the local service is called to refresh the cache, the local service is informed to refresh the cache;
if the service calling mode is remote calling, calling a remote service to execute the task, wherein the task comprises the following steps:
when the data file which is processed by the remote service is called as an sql file and the sql file is stored in a cloud, sending a storage address of the data file to equipment deployed by the remote service;
when the data file which is processed by the remote service is called to be an sql file and the sql file is stored locally, the data file is sent to equipment deployed by the remote service;
when the remote service is called to process the data file into a big data file, sending the storage address of the data file to equipment deployed by the remote service;
and when the remote service is called to refresh the cache, sending a cache refreshing command to equipment deployed by the remote service.
If the service calling mode is remote calling, before calling the remote service, the method further comprises:
determining a cluster identifier according to the area information in the task information;
the invoked remote service is dynamically registered according to the microservice (jsf).
Jsf is a microservice that provides a method of interface invocation where remote services are invoked dynamically through the jsf remote service invocation principle.
And 106, when the task is completely executed, updating the task state in the task detail of the task and the task state in the task main table according to the execution result.
The task state in the task detail is the execution success or the execution failure of the execution result of the current task,
the task state in the task main table is determined by the task states in all task details, so that the consistency of task execution is ensured, and the method specifically comprises the following steps:
when the execution states of all tasks in the task list are successful, the task state in the task main list is successful;
when the execution state of part of tasks in the task detail table is execution failure, the task state in the task main table is part failure;
and when the execution states of all tasks in the task detail table are execution failures, the task state in the task main table is a failure.
For the implementation manners of updating the task state in the task specification of the task according to the execution result of the task and the task state in the task master table, the following implementation manners are given as examples, without limitation in the embodiment of the present application:
if 5 tasks are assumed, if the execution result of the task 1 is successful, the state of the task 1 is updated to be successful, and if the task is the first task, the state of the task in the task main table is updated to be successful;
if the execution result of the task 2 is successful, the state of the task 2 is updated to be successful, and if the task is the second task, the task state in the task main table is updated to be successful;
if the execution result of the task 3 is failure, the state of the task 3 is updated to be execution failure, and if the task is the third task, the task state in the task main table is updated to be partial failure;
if the execution result of the task 4 is successful, updating the state of the task 4 to be successful, and if the task is the fourth task, the task state in the task main table is partial failure and remains unchanged;
if the execution result of the executed task 5 is failure, the state of the updated task 5 is execution failure, and if the task is the fifth task, the task state in the task master table is partial failure and remains unchanged.
If the 1 st task to the 5 th task are executed successfully, the task state in the task main table is successful; if the 1 st task to the 5 th task are all executed in failure, the task state in the task main table is failure; if the tasks which fail to be executed and the tasks which succeed to be executed exist in the 1 st to 5 th tasks, the task status in the task main table is partial failure.
During the task execution process, a task execution log can be recorded so as to facilitate the query of the task execution process.
The method and the device for processing the business data have the advantages that the task information and the initialization data collected by the management platform are obtained, the business data are generated according to the task information and the initialization data, the business data are converted into a plurality of tasks to be processed, and when all the tasks are processed, the business data are processed. The scheme can reduce cost, save time and reduce error rate.
The scheme can be applied to initialization systems which need a large amount of configuration, and common data configuration such as configuration cache data, sql files, large files, cluster calling modes and the like is included.
For example, in a warehouse opening scene, warehouse opening processes are reduced, the warehouse opening time is shortened, and the warehouse opening automation is improved, so that the warehouse operation cost and the labor cost are reduced, and the warehouse opening process is already applied to a large warehouse opening system and is shortened to 5 minutes per time from 2 days per time.
Example two
Configuring a polling timer; when the polling timing is up, the present embodiment is started.
Referring to fig. 3, fig. 3 is a schematic diagram of a task processing flow in the second embodiment of the present application. The method comprises the following specific steps:
step 301, when the polling timing time is up, acquiring the task state in the task master table.
Step 302, when the task state is a partial failure, acquiring a task detail of which the execution state is a failure in execution from the task detail table, and executing the task corresponding to the task detail again. Step 301 is performed.
And executing step 301, namely, when waiting for the timing time of the next polling timer to arrive, acquiring the task state in the task master table again, and determining the executed step according to the task state.
And 303, when the task state is failure, executing all tasks corresponding to the task details again. Step 301 is performed.
And executing step 301, namely, when waiting for the timing time of the next polling timer to arrive, acquiring the task state in the task master table again, and determining the executed step according to the task state.
And step 304, closing a polling timer when the task status is successful.
And when the task state is successful, the task is executed completely, and the task processing is finished if the tasks are executed successfully.
If the large household appliance is opened, namely the opening is successful, the data initialization is finished, and the operations of warehousing and ex-warehouse of articles can be performed.
According to the embodiment, when the tasks are automatically executed, all the tasks are successfully executed finally through the timed polling.
Based on the same inventive concept, the embodiment of the application also provides a task processing device. Referring to fig. 4, fig. 4 is a schematic structural diagram of an apparatus applied to the above technology in the embodiment of the present application. The device comprises: an acquisition unit 401, a first generation unit 402, a second generation unit 403, a third generation unit 404, and an execution unit 405;
an obtaining unit 401, configured to obtain task information and initialization data collected by a management platform;
a first generating unit 402, configured to generate a task master table according to the task information acquired by the acquiring unit 401;
a second generating unit 403, configured to generate service data according to the initialization data and the task information acquired by the acquiring unit 401;
a third generating unit 404, configured to create a task list; generating a data file corresponding to a plurality of tasks from the service data generated by the second generating unit 403, generating a task list of each task, and storing the task list in the task list; wherein the task details include: the storage address, the task type, the service calling mode and the execution state of the data file; when the execution unit 405 completes the task, updating the task state in the task detail of the task and the task state in the task master table according to the execution result, wherein the task state in the task master table is determined by the task states in all the task details;
an executing unit 405, configured to, when executing any one of the tasks, obtain a corresponding data file according to a storage address of the data file of the task in the third generating unit 404; and calling a corresponding execution method according to the task type, and calling a corresponding service according to the service calling mode to execute the task.
Preferably, the first and second electrodes are formed of a metal,
the data file is an sql file or a big data file;
when the data file is an sql file, the task types comprise adding, deleting, modifying, caching and inquiring; when the data file is a big data file, the task type comprises adding and caching;
the service calling mode comprises local calling and remote calling;
the execution status includes execution success and execution failure.
Preferably, the first and second electrodes are formed of a metal,
a second generating unit 403, configured to perform cloud storage on the data file and generate a storage address of the data file when the data file is an sql file and the size of the sql file is greater than a preset threshold; when the data file is an sql file and the size of the sql file is not larger than a preset threshold value, storing the data file locally and generating a storage address of the data file; and when the data file is a big data file, carrying out cloud storage on the data file, and generating a storage address of the data file.
Preferably, the first and second electrodes are formed of a metal,
the execution unit 405 is specifically configured to, if the service invocation mode is local invocation, invoke a local service to execute the task, and includes: when the local service is called to process the data file, if the data file is stored in a cloud end, the data file is downloaded to the local; when the local service is called to refresh the cache, the local service is informed to refresh the cache; if the service calling mode is remote calling, calling a remote service to execute the task, wherein the task comprises the following steps: when the data file which is processed by the remote service is called as an sql file and the sql file is stored in a cloud, sending a storage address of the data file to equipment deployed by the remote service; when the data file which is processed by the remote service is called to be an sql file and the sql file is stored locally, the data file is sent to equipment deployed by the remote service; when the remote service is called to process the data file into a big data file, sending the storage address of the data file to equipment deployed by the remote service; and when the remote service is called to refresh the cache, sending a cache refreshing command to equipment deployed by the remote service.
Preferably, the first and second electrodes are formed of a metal,
the execution unit 405 is further configured to determine a cluster identifier according to area information in task information before the remote service is called if the service calling mode is remote calling; the invoked remote service is dynamically registered according to the microservice jsf.
Preferably, the first and second electrodes are formed of a metal,
when the execution states of all tasks in the task list are successful, the task state in the task main list is successful;
when the execution state of part of tasks in the task detail table is execution failure, the task state in the task main table is part failure;
and when the execution states of all tasks in the task detail table are execution failures, the task state in the task main table is a failure.
Preferably, the apparatus further comprises: a polling unit 406;
a polling unit 406 for configuring a polling timer; when the polling timing time is up, acquiring a task state in a task master table in the first generation unit 402; when the task state is successful, closing the polling timer;
the executing unit 405 is further configured to, when the task status polled by the polling unit 406 is a partial failure, obtain a task list of which the execution status is a failure, from the task list, and execute the task corresponding to the task list again; waiting for the polling timing time to arrive again; when the task state is failure, executing all tasks corresponding to the task details again; again waiting for the polling timing time to arrive.
The units of the above embodiments may be integrated into one body, or may be separately deployed; may be combined into one unit or further divided into a plurality of sub-units.
In another embodiment, an electronic device is also provided, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the task processing method when executing the program.
In another embodiment, a computer readable storage medium is also provided having stored thereon computer instructions which, when executed by a processor, may implement the steps of the task method.
Fig. 5 is a schematic physical structure diagram of an electronic device according to an embodiment of the present invention. As shown in fig. 5, the electronic device may include: a Processor (Processor)510, a communication Interface (Communications Interface)520, a Memory (Memory)530 and a communication bus 540, wherein the Processor 510, the communication Interface 520 and the Memory 530 communicate with each other via the communication bus 540. Processor 510 may call logic instructions in memory 530 to perform the following method:
acquiring task information and initialization data collected by a management platform;
generating a task main table according to the task information, and creating a task detail table;
generating service data according to the initialization data and the task information;
generating data files corresponding to a plurality of tasks from the service data, generating a task list of each task, and storing the task list in the task list; wherein the task details include: the storage address, the task type, the service calling mode and the execution state of the data file;
when any task is executed, acquiring a corresponding data file according to the storage address of the data file of the task; calling a corresponding execution method according to the task type, and calling a corresponding service according to the service calling mode to execute the task;
and when the task is executed, updating the task state in the task detail of the task and the task state in the task main table according to an execution result, wherein the task state in the task main table is determined by the task states in all the task details.
Furthermore, the logic instructions in the memory 530 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method for processing a task, the method comprising:
acquiring task information and initialization data collected by a management platform;
generating a task main table according to the task information, and creating a task detail table;
generating service data according to the initialization data and the task information;
generating data files corresponding to a plurality of tasks from the service data, generating a task list of each task, and storing the task list in the task list; wherein the task details include: the storage address, the task type, the service calling mode and the execution state of the data file;
when any task is executed, acquiring a corresponding data file according to the storage address of the data file of the task; calling a corresponding execution method according to the task type, and calling a corresponding service according to the service calling mode to execute the task;
and when the task is executed, updating the task state in the task detail of the task and the task state in the task main table according to an execution result, wherein the task state in the task main table is determined by the task states in all the task details.
2. The method of claim 1,
the data file is an sql file or a big data file;
when the data file is an sql file, the task types comprise adding, deleting, modifying, caching and inquiring; when the data file is a big data file, the task type comprises adding and caching;
the service calling mode comprises local calling and remote calling;
the execution status includes execution success and execution failure.
3. The method of claim 2,
when the data file is an sql file and the size of the sql file is larger than a preset threshold value, performing cloud storage on the data file, and generating a storage address of the data file;
when the data file is an sql file and the size of the sql file is not larger than a preset threshold value, storing the data file locally and generating a storage address of the data file;
and when the data file is a big data file, carrying out cloud storage on the data file, and generating a storage address of the data file.
4. The method of claim 2,
if the service calling mode is local calling, calling a local service to execute the task includes:
when the local service is called to process the data file, if the data file is stored in a cloud end, the data file is downloaded to the local;
when the local service is called to refresh the cache, the local service is informed to refresh the cache;
if the service calling mode is remote calling, calling a remote service to execute the task, wherein the task comprises the following steps:
when the data file which is processed by the remote service is called as an sql file and the sql file is stored in a cloud, sending a storage address of the data file to equipment deployed by the remote service;
when the data file which is processed by the remote service is called to be an sql file and the sql file is stored locally, the data file is sent to equipment deployed by the remote service;
when the remote service is called to process the data file into a big data file, sending the storage address of the data file to equipment deployed by the remote service;
and when the remote service is called to refresh the cache, sending a cache refreshing command to equipment deployed by the remote service.
5. The method of claim 4, wherein if the service invocation mode is remote invocation, before invoking the remote service, the method further comprises:
determining a cluster identifier according to the area information in the task information;
the invoked remote service is dynamically registered according to the microservice jsf.
6. The method of claim 1,
when the execution states of all tasks in the task list are successful, the task state in the task main list is successful;
when the execution state of part of tasks in the task detail table is execution failure, the task state in the task main table is part failure;
and when the execution states of all tasks in the task detail table are execution failures, the task state in the task main table is a failure.
7. The method of claim 6, further comprising:
configuring a polling timer;
when the polling timing time is up, acquiring a task state in the task master table;
when the task state is partial failure, acquiring a task detail of which the execution state is execution failure in the task detail table, and executing the task corresponding to the task detail again; waiting for the polling timing time to arrive again;
when the task state is failure, executing all tasks corresponding to the task details again; waiting for the polling timing time to arrive again;
and when the task state is successful, closing the polling timer.
8. A task processing apparatus, characterized in that the apparatus comprises: the device comprises an acquisition unit, a first generation unit, a second generation unit, a third generation unit and an execution unit;
the acquisition unit is used for acquiring the task information and the initialization data collected by the management platform;
the first generating unit is used for generating a task main table according to the task information acquired by the acquiring unit;
the second generating unit is used for generating service data according to the initialization data and the task information acquired by the acquiring unit;
the third generating unit is used for creating a task list; generating a data file corresponding to a plurality of tasks from the service data generated by the second generating unit, generating a task list of each task, and storing the task list in the task list; wherein the task details include: the storage address, the task type, the service calling mode and the execution state of the data file; when the execution unit finishes executing the task, updating the task state in the task detail of the task and the task state in the task main table according to an execution result, wherein the task state in the task main table is determined by the task states in all the task details;
the execution unit is used for acquiring a corresponding data file according to the storage address of the data file of the task in the third generation unit when any task is executed; and calling a corresponding execution method according to the task type, and calling a corresponding service according to the service calling mode to execute the task.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1-7 when executing the program.
10. A computer-readable storage medium, on which a computer program is stored, which program, when being executed by a processor, is adapted to carry out the method of any one of claims 1 to 7.
CN202011135660.2A 2020-10-22 2020-10-22 Task processing method and device Pending CN113780704A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011135660.2A CN113780704A (en) 2020-10-22 2020-10-22 Task processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011135660.2A CN113780704A (en) 2020-10-22 2020-10-22 Task processing method and device

Publications (1)

Publication Number Publication Date
CN113780704A true CN113780704A (en) 2021-12-10

Family

ID=78835086

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011135660.2A Pending CN113780704A (en) 2020-10-22 2020-10-22 Task processing method and device

Country Status (1)

Country Link
CN (1) CN113780704A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104077084A (en) * 2014-07-22 2014-10-01 中国科学院上海微***与信息技术研究所 Distributed random file accessing system and accessing control method thereof
CN106055315A (en) * 2016-05-19 2016-10-26 乐视控股(北京)有限公司 Method and system for processing batched tasks
CN109951370A (en) * 2017-12-21 2019-06-28 博元森禾信息科技(北京)有限公司 Much data centers are layered the method and device that interconnects
CN111600957A (en) * 2020-05-20 2020-08-28 中国工商银行股份有限公司 File transmission method, device and system and electronic equipment
WO2020186809A1 (en) * 2019-03-19 2020-09-24 深圳壹账通智能科技有限公司 Big data platform-based hive task scheduling method and apparatus, device, and storage medium
CN111736775A (en) * 2020-06-22 2020-10-02 平安医疗健康管理股份有限公司 Multi-source storage method, device, computer system and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104077084A (en) * 2014-07-22 2014-10-01 中国科学院上海微***与信息技术研究所 Distributed random file accessing system and accessing control method thereof
CN106055315A (en) * 2016-05-19 2016-10-26 乐视控股(北京)有限公司 Method and system for processing batched tasks
CN109951370A (en) * 2017-12-21 2019-06-28 博元森禾信息科技(北京)有限公司 Much data centers are layered the method and device that interconnects
WO2020186809A1 (en) * 2019-03-19 2020-09-24 深圳壹账通智能科技有限公司 Big data platform-based hive task scheduling method and apparatus, device, and storage medium
CN111600957A (en) * 2020-05-20 2020-08-28 中国工商银行股份有限公司 File transmission method, device and system and electronic equipment
CN111736775A (en) * 2020-06-22 2020-10-02 平安医疗健康管理股份有限公司 Multi-source storage method, device, computer system and storage medium

Similar Documents

Publication Publication Date Title
CN109413127B (en) Data synchronization method and device
CN112019369A (en) Dynamic configuration management method and system under micro-service framework
CN107391142B (en) Application splitting method and device
CN101179622B (en) Multi-order processing arrangement in communication system and processing method thereof
CN105653425A (en) Complicated event processing engine based monitoring system
CN102984049A (en) Client and method for user group partition and information transfer according to subjects
CN102891768A (en) Method and network element for network management
CN102208081A (en) Method for making business process management (BPM) application to be suitable for being used by multi-tenancy (MT) usages and apparatus thereof
CN103001855A (en) Method for dividing client and user group and transferring information
CN106888264B (en) A kind of method for interchanging data and device
CN104639669A (en) Method and device for configuring electronic mail box
CN108259605B (en) Data calling system and method based on multiple data centers
CN108334547B (en) Data sharing exchange system and method based on big data
CN106569914A (en) Data backup method, data restoration method and systems
CN109391658A (en) A kind of account data synchronous method and its equipment, storage medium, terminal
CN113780704A (en) Task processing method and device
CN107968798A (en) A kind of network management resources label acquisition method, cache synchronization method, apparatus and system
CN110347659A (en) Data processing method and device, transaction data processing method and device
CN107786661B (en) Information synchronization method
CN113256240B (en) Message processing method and device and server
US20150120607A1 (en) System and method for customer event email consolidation and delivery
CN110650033B (en) Distributed application configuration management method and distributed computing system
CN105912137A (en) Method and device for character input
CN111885206A (en) Cloud platform supporting multi-power-provider platform and pushing data to appointed environment
CN113760487A (en) Service processing method and device

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