Task analysis method, system, and electronic equipment
By parsing the configuration file to generate scheduling information and dynamically calling the analysis module to process task requests, the problem of insufficient flexibility in module arrangement in the task analysis system is solved, and flexible processing logic adjustment and efficient task processing are achieved.
Patent Information
- Application Number
- CN202210923829.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-02
- Publication Date
- 2025-09-23
- Estimated Expiration
- 2042-08-02
AI Technical Summary
The module arrangement flexibility of the task analysis system in the existing technology is low, the processing logic cannot be adjusted in time, and it cannot adapt to the scenarios and demand changes of parallel processing of multiple functional modules.
By parsing the pre-configured configuration file, the scheduling information is generated. Based on the analysis sequence and result judgment information, the analysis module is dynamically called to process external task requests and generate a target analysis report.
It realizes the flexible arrangement of task processing logic, can adjust the processing algorithm at any time according to the changes in demand scenarios, and improves the arrangement flexibility and processing efficiency of the analysis module.
Smart Images

Figure CN115220897B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a task analysis method and system thereof, and electronic equipment. Background Art
[0002] Currently, external devices initiate task requests, hoping that the task analysis system can provide analysis results and answers to questions involved in the task request. In related technologies, there are the following ways to process received task requests: (1) Based on the obtained task information, the task scheduling middleware can dynamically load, reconstruct, and orchestrate algorithm components on demand, or receive algorithm components input by external devices to achieve task reconstruction scheduling. However, although the above scheme mentions the concepts of task scheduling and functional modularization, its dynamically loaded and reconstructed components do not support horizontal expansion, that is, the algorithm components can only be orchestrated between the functional modules provided by the system. At the same time, the task scheduling of this scheme can only support serial scheduling and is not suitable for scenarios where multiple functional modules need to be processed in parallel; (2) Based on the attributes of each task, an abstract class is generated by abstracting common attributes, and specific implementation objects are generated by different attributes. Then, the task is split into the smallest granularity, and the subtasks after splitting are abstracted. Finally, the abstract subtasks are modularized and componentized. However, although the above solution mentions task modularization and task formulation, its essence is to granularize tasks, and the granularized subtasks still need to be executed according to the original established process, that is, there is still a correlation between the subtasks, and the progress of the subsequent subtasks needs to depend on the completion of the previous subtasks. It is not suitable for scenarios where there is no correlation between the functional modules themselves but there are high requirements for the flexibility of functional module arrangement, and it is also impossible to adjust the processing logic of tasks in time according to changes in the demand scenario.
[0003] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0004] The embodiments of the present invention provide a task analysis method and system thereof, and an electronic device, to at least solve the technical problems in related technologies of low flexibility in arranging analysis modules and inability to adjust task processing logic in a timely manner.
[0005] According to one aspect of an embodiment of the present invention, a task analysis method is provided, comprising: parsing a pre-configured configuration file to obtain configuration information, wherein the configuration information at least includes: result determination information and analysis sequence information; obtaining an external task request from a preset sorting queue, and generating scheduling information corresponding to the external task request based on the analysis sequence information, wherein the scheduling information at least includes: a calling sequence and an analysis module identifier, and each analysis module indicated by the analysis module identifier corresponds to one calling sequence; based on the calling sequence, transmitting the external task request to the analysis module indicated by the corresponding analysis module identifier, wherein the analysis module processes the external task request based on a preset processing logic and generates an initial analysis result; based on the result determination information and the initial analysis result, determining the processing status of the external task request, and generating a target analysis report when the processing status indicates that the request processing is completed.
[0006] Optionally, before parsing a pre-configured configuration file to obtain configuration information, it also includes: detecting multiple pre-established analysis modules to obtain detection results, wherein each of the analysis modules has pre-established processing logic and is configured with a unified abstract interface; determining that the processing logic indicated by the detection result is a normal target analysis module, and obtaining a target analysis module set; based on the target analysis module set, adopting a preset format strategy to generate analysis module information, wherein the analysis module information includes: an analysis module identifier corresponding to each target analysis module in the target analysis module set; when generating the analysis module information, adopting the preset format strategy to configure the result judgment information and the analysis sequence information, wherein the analysis modules involved in the result judgment information and the analysis sequence information are the pre-started target analysis modules indicated by the analysis module identifier in the analysis module information; based on the analysis module information, the result judgment information and the analysis sequence information, generate the configuration file.
[0007] Optionally, the step of generating scheduling information corresponding to the external task request based on the analysis sequence information includes: analyzing the analysis sequence information to obtain the analysis module identifier for processing the external task request and the calling sequence corresponding to the analysis module indicated by the analysis module identifier, wherein the calling sequence includes: serial calling and / or parallel calling; generating the scheduling information based on the analysis module identifier and the calling sequence.
[0008] Optionally, after transmitting the external task request to the analysis module indicated by the corresponding analysis module identifier based on the calling sequence, it also includes: when the calling sequence only includes the serial call, each time an initial analysis result is received, based on the result judgment information, the correctness of the initial analysis result is determined, and a judgment result is generated; or, when the calling sequence includes the serial call and the parallel call, after receiving all analysis results transmitted by all parallel processed analysis modules indicated by the parallel call, all analysis results are aggregated to obtain a comprehensive analysis result, and based on the result judgment information, the correctness of the comprehensive analysis result is determined, and a judgment result is generated.
[0009] Optionally, the step of determining the processing status of the external task request based on the result judgment information and the initial analysis result includes: when the judgment result indicates that the analysis value carried by the initial analysis result or the comprehensive analysis result is not within the preset threshold range carried by the result judgment information, determining that the processing status of the external task request is request processing incomplete; when the judgment result indicates that the analysis value carried by the initial analysis result or the comprehensive analysis result is within the preset threshold range carried by the result judgment information, determining that the processing status of the external task request is request processing completed.
[0010] Optionally, after determining that the processing status of the external task request is that the request processing is not completed, it also includes: when the processing status of the external task request is that the request processing is not completed, summarizing the initial analysis result or the comprehensive analysis result into a summary analysis result, and continuing to receive the next analysis result until the processing status of the external task request is that the request processing is completed, or all analysis modules involved in the scheduling information are processed; based on the summary analysis result, generating the target analysis report.
[0011] According to another aspect of an embodiment of the present invention, a task analysis system is further provided, comprising: a task receiving queue for sorting received external task requests and placing them into a preset sorting queue; a configuration management subsystem for parsing a pre-configured configuration file to obtain configuration information, wherein the configuration information at least includes: analysis module information, result determination information, and analysis sequence information; a scheduling subsystem for receiving the analysis sequence information transmitted by the configuration management subsystem, and generating scheduling information corresponding to each external task request based on the analysis sequence information; an analysis module management subsystem for starting an analysis module set indicated by an analysis module identifier set carried by the analysis module information, and calling an analysis module indicated by an analysis module identifier carried by the scheduling information transmitted by the scheduling subsystem, using the analysis module to process the external task request to obtain an initial analysis result; and a result determination subsystem for receiving the result determination information and the initial analysis result, and determining a processing status of the external task request based on the result determination information and the initial analysis result, and generating a target analysis report if the processing status indicates that the request processing is complete, and transmitting the target analysis report to the scheduling subsystem.
[0012] Optionally, the scheduling subsystem includes: a first acquisition unit, used to obtain the external task request from the preset sorting queue; a first analysis unit, used to analyze the analysis sequence information, obtain the analysis module identifier for processing the external task request and the calling sequence corresponding to the analysis module indicated by the analysis module identifier, wherein the calling sequence includes: serial call and / or parallel call; a first generation unit, used to generate the scheduling information based on the analysis module identifier and the calling sequence; a first transmission unit, used to transmit the scheduling information and the external task request to the analysis module management subsystem.
[0013] Optionally, the scheduling subsystem also includes: a second transmission unit, used to transmit the first analysis result transmitted by the analysis module management subsystem to the result judgment subsystem; a first receiving unit, used to receive the first judgment result corresponding to the first analysis result transmitted by the result judgment subsystem; a first output unit, used to output the target analysis report transmitted by the result judgment subsystem to an external device when the first judgment result indicates that the processing status of the external task request is request processing completed; a third transmission unit, used to continue to transmit the second analysis result transmitted by the analysis module management subsystem to the result judgment subsystem when the first judgment result indicates that the processing status of the external task request is request processing incomplete, until the second judgment result indicates that the processing status of the external task request is request processing completed, or all analysis modules involved in the scheduling information are processed.
[0014] Optionally, the analysis module management subsystem includes: a first calling unit, used to call the analysis module corresponding to the analysis module identifier carried by the scheduling information based on an abstract interface and according to the calling order carried by the scheduling information, and transmit the external task request to the analysis module, wherein the analysis module processes the external task request based on a preset processing logic and generates an initial analysis result; a fourth transmitting unit, used to transmit the initial analysis result to the scheduling subsystem.
[0015] Optionally, the result judgment subsystem includes: a first judgment unit, used to judge the initial analysis result transmitted by the scheduling subsystem based on the result judgment information, and generate a judgment result; a first determination unit, used to determine that the processing status of the external task request is request processing incomplete when the judgment result indicates that the analysis value carried by the initial analysis result is not within the preset threshold range carried by the result judgment information; a second receiving unit, used to summarize the initial analysis result into a summary analysis result when it is determined that the processing status of the external task request is request processing incomplete, and continue to receive the next analysis result until the processing status of the external task request is request processing completed, or the scheduling subsystem no longer transmits the analysis result; a second generation unit, used to generate the target analysis report based on the summary analysis result; and a fifth transmission unit, used to transmit the target analysis report to the scheduling subsystem.
[0016] According to another aspect of an embodiment of the present invention, an electronic device for task analysis is also provided, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the task analysis method described above.
[0017] In the present disclosure, a pre-configured configuration file is parsed to obtain configuration information, an external task request is obtained from a preset sorting queue, and based on the analysis sequence information, scheduling information corresponding to the external task request is generated, and based on the calling sequence, the external task request is transmitted to the analysis module indicated by the corresponding analysis module identifier, wherein the analysis module processes the external task request based on a preset processing logic and generates an initial analysis result, and determines the processing status of the external task request based on the result determination information and the initial analysis result, and generates a target analysis report when the processing status indicates that the request processing is completed. In the present application, the configuration file can be parsed first to obtain information such as analysis sequence information and result judgment information, and then, based on the analysis sequence information, the scheduling information corresponding to the external task request is generated. The analysis module is called in sequence according to the scheduling information, so that the analysis module processes the external task request according to the preset processing logic and generates analysis results. Then, based on the result judgment information and the analysis results, the processing status of the external task request is determined. After the external task request is processed, a target analysis report is generated. By configuring the processing algorithm of the task request, the processing algorithm can be adjusted at any time according to changes in the demand scenario, thereby improving the flexibility of the processing logic orchestration, thereby solving the technical problem in the related technology that the analysis module orchestration flexibility is low and the task processing logic cannot be adjusted in time. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0019] Figure 1 is a flowchart of an optional task analysis method according to an embodiment of the present invention;
[0020] Figure 2 is a schematic diagram of an optional task analysis system according to an embodiment of the present invention;
[0021] Figure 3 is a schematic diagram of an optional task analysis system loading initialization according to an embodiment of the present invention;
[0022] Figure 4 is a schematic diagram of an optional serial task analysis scenario according to an embodiment of the present invention;
[0023] Figure 5 is a schematic diagram of another optional serial task analysis scenario according to an embodiment of the present invention;
[0024] Figure 6 is a schematic diagram of an optional parallel task analysis scenario according to an embodiment of the present invention;
[0025] Figure 7 This is a hardware structure block diagram of an electronic device (or mobile device) for task analysis according to an embodiment of the present invention. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0027] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0028] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display and analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties. For example, an interface is set up between this system and the relevant user or organization. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or organization through the interface, and obtain the relevant information after receiving the consent information fed back by the aforementioned user or organization.
[0029] It should be noted that the present invention refers to requests from external devices (i.e., devices outside the task analysis system (application / device)) as tasks, and the response expected from the task analysis system as analysis results. Tasks may include: data that needs to be processed by the logic in the task analysis system, the basis for auxiliary analysis logic processing, and questions that the task analysis system is expected to answer, etc.; analysis results may include: analysis results given by the task analysis system and answers given by the task analysis system to questions expected to be answered in the corresponding tasks, etc. Among them, there may not be answers to the questions, and corresponding answers will only be given within the capabilities of the task analysis system, which may correspond to intermediate process data generated by a certain analysis module in actual scenarios. In the present invention, tasks and analysis results can be json format data, but this does not mean that the present invention only supports data in this format. The specific format can be determined according to actual needs and is not limited here.
[0030] The following embodiments of the present invention can be applied to various systems / applications / devices for analyzing tasks. The present invention divides the processing logic, implements the various sub-function logics after division according to multiple analysis modules, and then integrates the sub-function logics after division with the help of customizable and flexibly arranged logic configuration to complete the complete processing logic. It can make the related logics be processed serially and the unrelated logics be processed in parallel to save analysis time. At the same time, it can realize the functions of separate management, on-demand deployment, and timely start and stop of the functions after division. In addition, the present invention configures the processing algorithm. After the processing logic is modularized, the algorithms of the processing logic such as which modules are enabled, the arrangement order between modules, and how the output results of each module are related and summarized can be migrated to the configuration file. By adjusting the contents of each configuration item in the configuration file, the processing logic can be rearranged, thereby improving the flexibility of the arrangement of the processing logic.
[0031] The present invention will be described in detail below with reference to various embodiments.
[0032] Example 1
[0033] According to an embodiment of the present invention, an embodiment of a task analysis method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0034] Figure 1 is a flowchart of an optional task analysis method according to an embodiment of the present invention. Figure 1 As shown, the method includes the following steps:
[0035] Step S101 , parsing a pre-configured configuration file to obtain configuration information, wherein the configuration information at least includes: result determination information and analysis sequence information.
[0036] Step S102, obtain the external task request from the preset sorting queue, and generate scheduling information corresponding to the external task request based on the analysis sequence information, wherein the scheduling information at least includes: a calling sequence, an analysis module identifier, and each analysis module identifier indicates an analysis module corresponding to a calling sequence.
[0037] Step S103 : Based on the calling sequence, the external task request is transmitted to the analysis module indicated by the corresponding analysis module identifier, wherein the analysis module processes the external task request based on a preset processing logic and generates an initial analysis result.
[0038] Step S104 : Based on the result determination information and the initial analysis result, the processing status of the external task request is determined. If the processing status indicates that the request processing is completed, a target analysis report is generated.
[0039] Through the above steps, the pre-configured configuration file can be parsed to obtain configuration information, the external task request can be obtained from the preset sorting queue, and based on the analysis sequence information, the scheduling information corresponding to the external task request can be generated. Based on the calling order, the external task request can be transmitted to the analysis module indicated by the corresponding analysis module identifier, wherein the analysis module processes the external task request based on the preset processing logic and generates an initial analysis result. Based on the result judgment information and the initial analysis result, the processing status of the external task request is determined, and when the processing status indicates that the request processing is completed, a target analysis report is generated. In an embodiment of the present invention, the configuration file can be parsed first to obtain information such as analysis sequence information and result judgment information, and then scheduling information corresponding to the external task request is generated based on the analysis sequence information. The analysis module is called in sequence according to the scheduling information, so that the analysis module processes the external task request according to the preset processing logic and generates an analysis result. Then, the processing status of the external task request is determined based on the result judgment information and the analysis result. After the external task request is processed, a target analysis report is generated. By configuring the processing algorithm of the task request, the processing algorithm can be adjusted at any time according to changes in the demand scenario, thereby improving the flexibility of the processing logic orchestration, and thus solving the technical problem in the related technology that the analysis module orchestration flexibility is low and the task processing logic cannot be adjusted in time.
[0040] The embodiment of the present invention is described in detail below in conjunction with the above steps.
[0041] In an embodiment of the present invention, optionally, before parsing a pre-configured configuration file to obtain configuration information, it also includes: detecting multiple pre-established analysis modules to obtain detection results, wherein each analysis module has pre-established processing logic and is configured with a unified abstract interface; determining that the processing logic indicated by the detection result is a normal target analysis module, and obtaining a target analysis module set; based on the target analysis module set, using a preset format strategy to generate analysis module information, wherein the analysis module information includes: an analysis module identifier corresponding to each target analysis module in the target analysis module set; when generating the analysis module information, using a preset format strategy to configure result judgment information and analysis sequence information, wherein the analysis modules involved in the result judgment information and the analysis sequence information are the pre-started target analysis modules indicated by the analysis module identifier in the analysis module information; based on the analysis module information, the result judgment information and the analysis sequence information, generate a configuration file.
[0042] In an embodiment of the present invention, multiple analysis modules can be established first. Each analysis module is a unit that can actually process tasks and can implement a sub-functional logic (i.e., each analysis module has pre-established processing logic), including: processing logic for processing tasks, interfaces for receiving tasks and returning analysis results, etc. In this embodiment, units with different processing logics and units with the same processing logic but different interfaces can be regarded as different analysis modules. In order to enable the analysis module management subsystem to uniformly maintain different analysis modules, the analysis module is also an abstract design. The concrete analysis modules that can be loaded and maintained by the analysis module management subsystem must uniformly comply with this abstract design and implement their respective analysis processing logic on this basis. That is, the abstract design standardizes the interface of the analysis module, and all concrete analysis modules uniformly provide a consistent interface for receiving tasks and returning analysis results (i.e., all analysis modules are configured with a unified abstract interface, which facilitates the analysis module management subsystem to uniformly maintain and call different analysis modules). In addition, the consistency of the interface is limited to the structural design of the interface entrance and exit. The entrance is the task, and the exit is the analysis result, allowing different analysis modules to implement different task processing logic in the interface logic. The analysis module itself is the actual task processing unit, so at least one concrete analysis module must be implemented to enable the task analysis system to have analysis capabilities.
[0043] In an embodiment of the present invention, for an analysis module with problems in the analysis and processing logic that cannot be repaired in time, if the analysis module is not taken offline, it will affect the application scenario of the final analysis result of the task. This embodiment can prohibit such analysis modules in the configuration file, and then restart the task analysis system, so that the problematic analysis module can be taken offline in time. At the same time, sufficient time is provided to the problematic analysis module to solve the problem. After the problem is fixed, the configuration file can be modified again and the system can be restarted to recover.
[0044] Therefore, this embodiment can detect multiple pre-established analysis modules and obtain detection results. Through the detection results, it can determine the target analysis module with normal processing logic and obtain a target analysis module set. Then, a preset format strategy (i.e., a preset format specification, which can be set according to actual conditions) can be adopted to generate analysis module information based on the obtained target analysis module set (the analysis module information includes: an analysis module identifier corresponding to each target analysis module in the target analysis module set, so as to find the corresponding analysis module). In this way, by configuring the analysis module information, analysis modules with problems in the processing logic can be taken offline in a timely manner. In addition, for application scenarios with different requirements for enabling analysis modules at different times, different analysis modules can be started by adjusting the analysis module information. For example, a task is initially set to be processed by analysis module A and analysis module B, but due to changes in requirements, the task needs to be adjusted to be processed by analysis module A, analysis module B, and analysis module C. Therefore, the analysis module information can be adjusted to add analysis module C to the analysis module information to start analysis module C, and then analysis module C can be added to the analysis sequence configuration. Restarting the task analysis system can meet the changed requirements.
[0045] In this embodiment, when generating analysis module information, a preset format strategy can be used to configure result judgment information (used to determine whether the current analysis result meets the conditions for ending the analysis work, which can be quantitatively determined by setting an expected threshold) and analysis sequence information (used to determine which stages and order the task needs to be submitted to the corresponding analysis module for analysis and processing). In addition, the analysis module involved in the result judgment information and the analysis sequence information is the pre-started target analysis module indicated by the analysis module identifier in the analysis module information (that is, the analysis module specified and mentioned in the result judgment rule and analysis sequence must be an enabled analysis module). At the same time, the result judgment information and the analysis sequence information can be updated according to the preset scenario requirements. For example, scenario one requires: the task is first processed by analysis module A, then handed over to analysis module B for processing, and finally handed over to analysis module C for processing; scenario two requires: the task is first processed by analysis module C, then handed over to analysis module B for processing, and finally handed over to analysis module A for processing. Therefore, for different application scenarios, there are different requirements for the task analysis order. By adjusting the analysis sequence information and then restarting the task analysis system, the requirements under different scenarios can be met.
[0046] In this embodiment, a configuration file can be generated based on the determined analysis module information, result determination information, and analysis sequence information. The configuration file records the enabled analysis modules, result determination rules, analysis sequence, and other information in a predefined format. When the task analysis system starts, the configuration management system loads and parses the configuration file and drives the operation of other subsystems based on the parsed information. Therefore, the configuration file also serves as a means of customizing and dynamically deploying the functions of the task analysis system.
[0047] Step S101 , parsing a pre-configured configuration file to obtain configuration information, wherein the configuration information at least includes: result determination information and analysis sequence information.
[0048] In this embodiment of the present invention, the configuration management subsystem can parse the configuration file and pass the parsed configuration information to other subsystems for use. The parsed configuration information includes analysis module information, result determination information, and analysis sequence information. The analysis module information is transmitted to the analysis module management subsystem to inform the current task analysis system which analysis modules need to be activated and maintained; the result determination information is transmitted to the result determination subsystem to assist in determining the staged analysis results of the task; and the analysis sequence information is transmitted to the scheduling subsystem to inform the corresponding analysis modules in which stages and order the task should be submitted for analysis and processing.
[0049] Step S102, obtain the external task request from the preset sorting queue, and generate scheduling information corresponding to the external task request based on the analysis sequence information, wherein the scheduling information at least includes: a calling sequence, an analysis module identifier, and each analysis module identifier indicates an analysis module corresponding to a calling sequence.
[0050] In an embodiment of the present invention, an external task request initiated by an external device can be added to a preset sorting queue, which can play a queuing and buffering role. After that, the external task request to be processed is obtained from the preset sorting queue (the request can be obtained in a first-in-first-out order), and then the scheduling subsystem generates scheduling information corresponding to the external task request according to the analysis sequence information transmitted by the configuration management subsystem. The scheduling information includes: calling sequence, analysis module identification, etc. The analysis module indicated by each analysis module identification corresponds to a calling sequence, that is, by pre-setting the execution order of the analysis module that needs to process the task, the task can be gradually completed in the order indicated by the configuration file. Analysis processing.
[0051] Optionally, the step of generating scheduling information corresponding to the external task request based on the analysis sequence information includes: analyzing the analysis sequence information to obtain the analysis module identifier for processing the external task request and the calling sequence corresponding to the analysis module indicated by the analysis module identifier, wherein the calling sequence includes: serial calling and / or parallel calling; generating scheduling information based on the analysis module identifier and the calling sequence.
[0052] In an embodiment of the present invention, analysis sequence information can be analyzed to obtain the analysis module identifier for processing external task requests and the calling sequence corresponding to the analysis module indicated by the analysis module identifier (that is, the calling sequence of the analysis modules that need to process the task is obtained, and the sequence includes: serial calling, and / or parallel calling, that is, related analysis modules can be processed serially, and non-related analysis modules can be processed in parallel, which can save time and achieve the purpose of rapid task analysis). Then, scheduling information is generated based on the obtained analysis module identifier and calling sequence, so that the analysis module management subsystem accurately delivers the task to the analysis module specified in the scheduling information for processing.
[0053] Step S103 : Based on the calling sequence, the external task request is transmitted to the analysis module indicated by the corresponding analysis module identifier, wherein the analysis module processes the external task request based on a preset processing logic and generates an initial analysis result.
[0054] In this embodiment of the present invention, the analysis module management subsystem can interact with each analysis module simultaneously, submitting task analysis and obtaining the generated analysis results by calling the analysis module interface. The analysis module management subsystem can accurately deliver external task requests to the corresponding analysis module based on the call sequence in the received scheduling information. The analysis module then processes the external task request according to pre-configured processing logic and generates initial analysis results. The analysis module management subsystem then waits for the analysis module to produce the analysis results before feeding them back to the scheduling subsystem.
[0055] Optionally, after transmitting the external task request to the analysis module indicated by the corresponding analysis module identifier based on the calling sequence, it also includes: when the calling sequence only includes serial calls, each time an initial analysis result is received, the correctness of the initial analysis result is determined based on the result judgment information, and a judgment result is generated; or, when the calling sequence includes serial calls and parallel calls, after receiving all analysis results transmitted by all parallel processed analysis modules indicated by the parallel call, all analysis results are summarized to obtain a comprehensive analysis result, and based on the result judgment information, the correctness of the comprehensive analysis result is determined to generate a judgment result.
[0056] In an embodiment of the present invention, during the scheduling period, the scheduling subsystem needs to work in conjunction with the result judgment subsystem. The result judgment subsystem gives a judgment result (for giving information on whether the analysis work can be terminated) for each analysis result to assist the scheduling subsystem in completing the scheduling work of the task. When the result judgment subsystem determines that the current analysis result meets the expected termination, the scheduling subsystem outputs the analysis result to the outside. Specifically, when the call sequence only includes serial calls (that is, the analysis module can only be processed serially), the result judgment subsystem can determine the correctness of the initial analysis result based on the result judgment information each time it receives an initial analysis result and generate a judgment result; when the call sequence includes serial calls and parallel calls (that is, multiple analysis modules can be processed in parallel), the result judgment subsystem receives all the analysis results transmitted by all parallel processing analysis modules indicated by the parallel call, summarizes all the analysis results, obtains a comprehensive analysis result, and determines the correctness of the comprehensive analysis result based on the result judgment information and generates a judgment result.
[0057] Step S104 : Based on the result determination information and the initial analysis result, the processing status of the external task request is determined. If the processing status indicates that the request processing is completed, a target analysis report is generated.
[0058] Optionally, the step of determining the processing status of the external task request based on the result judgment information and the initial analysis result includes: when the judgment result indicates that the analysis value carried by the initial analysis result or the comprehensive analysis result is not within the preset threshold range carried by the result judgment information, determining that the processing status of the external task request is request processing incomplete; when the judgment result indicates that the analysis value carried by the initial analysis result or the comprehensive analysis result is within the preset threshold range carried by the result judgment information, determining that the processing status of the external task request is request processing completed.
[0059] In an embodiment of the present invention, the processing status of the external task request can be determined by comparing the preset threshold value carried by the result judgment information (that is, the expected threshold value, which can be set according to actual conditions) and the analysis value carried by the initial analysis result (that is, the actual value obtained by the analysis module processing the task). That is, when the judgment result indicates that the analysis value carried by the initial analysis result or the comprehensive analysis result is not within the preset threshold range carried by the result judgment information, the processing status of the external task request is determined to be request processing incomplete; otherwise, the processing status of the external task request is determined to be request processing completed.
[0060] Optionally, after determining that the processing status of the external task request is that the request processing is not completed, it also includes: when the processing status of the external task request is that the request processing is not completed, summarizing the initial analysis results or the comprehensive analysis results into summary analysis results, and continuing to receive the next analysis results until the processing status of the external task request is that the request processing is completed, or all analysis modules involved in the scheduling information are processed; based on the summary analysis results, generating a target analysis report.
[0061] In an embodiment of the present invention, when the determination result indicates that the determination task still needs to continue analysis and processing (i.e., when the processing status of the external task request is that the request processing is not completed), the result determination subsystem will summarize the analysis results of the analysis modules currently completed in the comprehensive task and form a phased summary record (i.e., summarize the initial analysis results or the comprehensive analysis results into the summary analysis results) so that when the analysis results of the next analysis module of the task arrive, the processing of the analysis results can be accelerated and the accuracy can be improved. When the determination task no longer needs to continue analysis and processing (i.e., the processing status of the external task request is that the request processing is completed, or, when all analysis modules involved in the scheduling information are completed), the result determination subsystem will form the final analysis result of the task (i.e., the target analysis report) and output it to the scheduling subsystem.
[0062] In an embodiment of the present invention, a task analysis method is proposed that has the characteristics of functional modularization, pluggable functional modules, and easy dynamic expansion. The method can adapt to scenarios that require high flexibility in the orchestration of functional modules and the adjustment of processing algorithms at any time. At the same time, it can ensure that the orchestration of functional modules is invisible to the outside world. Even if the processing algorithm is adjusted, the input and output of the task analysis system remain consistent before and after the adjustment, so as to meet the usage requirements of the task analysis system without the need for synchronous adjustment of upper-level businesses after changes.
[0063] The following describes it in detail with reference to another embodiment.
[0064] Example 2
[0065] Figure 2 is a schematic diagram of an optional task analysis system according to an embodiment of the present invention. Figure 2 As shown, it includes: a task receiving queue, a configuration management subsystem, a scheduling subsystem, an analysis module management subsystem, a result determination subsystem, one or more analysis modules (such as analysis module A, ..., analysis module N) and a configuration file, wherein,
[0066] The task receiving queue is used to sort the received external task requests and put them into the preset sorting queue;
[0067] The configuration management subsystem is used to parse the pre-configured configuration file to obtain configuration information, wherein the configuration information at least includes: analysis module information, result determination information, and analysis sequence information;
[0068] The scheduling subsystem is configured to receive the analysis sequence information transmitted by the configuration management subsystem and generate scheduling information corresponding to each external task request based on the analysis sequence information;
[0069] The analysis module management subsystem is used to start the analysis module set indicated by the analysis module identification set carried in the analysis module information, call the analysis module indicated by the analysis module identification carried in the scheduling information transmitted by the scheduling subsystem, use the analysis module to process the external task request, and obtain the initial analysis result;
[0070] The result determination subsystem is used to receive result determination information and initial analysis results, and based on the result determination information and initial analysis results, determine the processing status of the external task request. When the processing status indicates that the request processing is completed, a target analysis report is generated and transmitted to the scheduling subsystem.
[0071] The following combination Figure 2 Describe the task analysis system in detail.
[0072] The task receiving queue is used to receive tasks from external devices, and plays a role of queuing and buffering.
[0073] The configuration management subsystem is responsible for parsing configuration files and passing the parsed content to other subsystems for use. This parsed content includes analysis module information, result determination information, and analysis sequence information. The analysis module information is provided to the analysis module management subsystem, informing the current task analysis system which analysis modules to activate and maintain. Result determination information is provided to the result determination subsystem to assist in determining the staged analysis results of the task. Analysis sequence information is provided to the scheduling subsystem, informing the task analysis module in which stages and order to submit the task for analysis and processing.
[0074] In this embodiment, a configuration file records analysis module information, result determination information, analysis sequence information, and other content in a predefined format. When the task analysis system starts, the configuration management system loads and parses this configuration file and drives the operations of other subsystems based on the parsed information. Therefore, the configuration file also serves as a means for customizing and dynamically deploying the functionality of the task analysis system. The analysis modules specified and mentioned in the result determination information and analysis sequence information sections of the configuration file must be the enabled analysis modules provided in the analysis module information, that is, they must be listed in the "Enabled Analysis Modules" section of the configuration file.
[0075] Based on the analysis sequence information transmitted by the configuration management subsystem, the scheduling subsystem analyzes the order of tasks in the task acceptance queue one by one, obtains the corresponding scheduling information, and dispatches it to the analysis module management subsystem, so that the tasks can gradually complete the analysis and processing in the established order indicated by the configuration file. At the same time, during the scheduling period, the scheduling subsystem needs to work in coordination with the result judgment subsystem. The result judgment subsystem will give a judgment result for each analysis result received. The judgment result includes information such as whether the analysis work can be terminated. This information can assist the scheduling subsystem in completing the scheduling of tasks. When the result judgment subsystem determines that the analysis result of the current task meets the expected end, the analysis ends, and the scheduling subsystem outputs the analysis result to the outside.
[0076] Optionally, the scheduling subsystem includes: a first acquisition unit, used to obtain external task requests from a preset sorting queue; a first analysis unit, used to analyze analysis sequence information, obtain the analysis module identifier for processing the external task request and the calling sequence corresponding to the analysis module indicated by the analysis module identifier, wherein the calling sequence includes: serial call and / or parallel call; a first generation unit, used to generate scheduling information based on the analysis module identifier and the calling sequence; a first transmission unit, used to transmit the scheduling information and the external task request to the analysis module management subsystem.
[0077] In this embodiment, external task requests that need to be processed can be obtained from a preset sorting queue (requests can be obtained in a first-in-first-out order), and then the first analysis unit in the scheduling subsystem analyzes the analysis sequence information to obtain the analysis module identifier for processing the external task request and the calling sequence corresponding to the analysis module indicated by the analysis module identifier (that is, the calling sequence of the analysis module that needs to process the task is obtained, and the sequence includes: serial call, and / or parallel call, that is, related analysis modules can be processed serially, and non-related analysis modules can be processed in parallel, which can save time and achieve the purpose of rapid task analysis). Afterwards, the first generation unit generates scheduling information based on the obtained analysis module identifier and calling sequence, so that the analysis module management subsystem accurately delivers the task to the analysis module specified in the scheduling information for processing.
[0078] Alternatively, the scheduling subsystem further includes: a second transmission unit for transmitting the first analysis result transmitted by the analysis module management subsystem to the result judgment subsystem; a first receiving unit for receiving a first judgment result corresponding to the first analysis result transmitted by the result judgment subsystem; a first output unit for outputting a target analysis report transmitted by the result judgment subsystem to an external device when the first judgment result indicates that the processing status of the external task request is request processing completed; a third transmission unit for continuing to transmit the second analysis result transmitted by the analysis module management subsystem to the result judgment subsystem when the first judgment result indicates that the processing status of the external task request is request processing incomplete, until the second judgment result indicates that the processing status of the external task request is request processing completed, or all analysis modules involved in the scheduling information are processed.
[0079] In this embodiment, the scheduling subsystem needs to work with the result determination subsystem during the scheduling period, and the result determination subsystem gives a determination result (for giving information on whether the analysis work can be ended) for each analysis result to assist the scheduling subsystem in completing the scheduling work of the task. When the result determination subsystem determines that the current analysis result meets the end expectation, the scheduling subsystem outputs the analysis result to the outside. However, when the determination result indicates that the task still needs to continue the analysis and processing (i.e., when the processing status of the external task request is the request processing is not completed), the result determination subsystem will summarize the analysis results of the analysis modules currently completed by the comprehensive task to form a staged summary record (i.e., the initial analysis result or the comprehensive analysis result is summarized into the summary analysis result) so that when the analysis result of the next analysis module of the task arrives, the processing of the analysis result is accelerated and the accuracy is improved. When the task no longer needs to continue the analysis and processing (i.e., the processing status of the external task request is the request processing is completed, or, when all analysis modules involved in the scheduling information are processed and completed), the result determination subsystem will form the final analysis result of the task (i.e., the target analysis report) and output it to the scheduling subsystem.
[0080] The result determination subsystem is responsible for further deducing and processing the analysis results transmitted by the scheduling subsystem. Based on the result determination information indicated in the configuration file, it outputs a determination result to the scheduling subsystem to determine whether the task meets the analysis termination conditions. If the task still requires further analysis and processing, the result determination subsystem summarizes the analysis results of the task's currently completed analysis modules to form a staged summary record. This allows for faster processing and improved accuracy when the analysis results of the next analysis module for the task arrive. If the task no longer requires further analysis and processing, the result determination subsystem generates the task's final analysis result and outputs it to the scheduling subsystem.
[0081] Optionally, the result judgment subsystem includes: a first judgment unit, used to determine the initial analysis result transmitted by the scheduling subsystem based on the result judgment information, and generate a judgment result; a first determination unit, used to determine that the processing status of the external task request is request processing incomplete when the judgment result indicates that the analysis value carried by the initial analysis result is not within the preset threshold range carried by the result judgment information; a second receiving unit, used to summarize the initial analysis result into a summary analysis result when it is determined that the processing status of the external task request is request processing incomplete, and continue to receive the next analysis result until the processing status of the external task request is request processing completed, or the scheduling subsystem no longer transmits the analysis result; a second generation unit, used to generate a target analysis report based on the summary analysis result; and a fifth transmission unit, used to transmit the target analysis report to the scheduling subsystem.
[0082] In this embodiment, the processing status of the external task request can be determined by comparing the preset threshold value carried by the result judgment information (i.e., the expected threshold value, which can be set according to actual conditions) and the analysis value carried by the initial analysis result (i.e., the actual value obtained by the analysis module processing the task). That is, when the judgment result indicates that the analysis value carried by the initial analysis result or the comprehensive analysis result is not within the preset threshold range carried by the result judgment information, the processing status of the external task request is determined to be request processing incomplete; otherwise, the processing status of the external task request is determined to be request processing completed.
[0083] Furthermore, when the determination result indicates that the determination task still needs to continue analysis and processing (i.e., when the processing status of the external task request is that the request processing is not completed), the result determination subsystem will summarize the analysis results of the analysis modules currently completed in the comprehensive task and form a phased summary record (i.e., summarize the initial analysis results or comprehensive analysis results into the summary analysis results) so that when the analysis results of the next analysis module of the task arrive, the processing of the analysis results can be accelerated and the accuracy can be improved. When the determination task no longer needs to continue analysis and processing (i.e., the processing status of the external task request is that the request processing is completed, or all analysis modules involved in the scheduling information are completed), the result determination subsystem will form the final analysis result of the task (i.e., the target analysis report) and output it to the scheduling subsystem.
[0084] The analysis module management subsystem loads and manages designated analysis modules based on the analysis module information passed by the configuration management subsystem. It is also responsible for interacting with each analysis module, submitting task analysis and obtaining the generated analysis results by calling the analysis module interface. During initialization, the analysis module management subsystem loads and maintains all enabled analysis modules. Throughout its lifecycle, it continuously receives scheduling information from the scheduling subsystem, accurately delivers tasks to the analysis modules specified in the scheduling information, and waits for the analysis modules to generate analysis results before feeding them back to the scheduling subsystem.
[0085] In this embodiment, optionally, the analysis module management subsystem includes: a first calling unit, used to call the analysis module corresponding to the analysis module identifier carried by the scheduling information based on the abstract interface and the calling order carried by the scheduling information, and transmit the external task request to the analysis module, wherein the analysis module processes the external task request based on a preset processing logic and generates an initial analysis result; a fourth transmitting unit, used to transmit the initial analysis result to the scheduling subsystem.
[0086] In this embodiment, the analysis module is the unit that actually processes tasks and includes task processing logic, an interface for receiving tasks and returning analysis results, and so on. Units with different processing logic, or units with the same processing logic but different interfaces, are considered different analysis modules. To enable the analysis module management subsystem to uniformly maintain different analysis modules, the analysis module is also an abstract design. The concrete analysis modules that can be loaded and maintained by the analysis module management subsystem can uniformly follow this abstract design and implement their own analysis processing logic based on it. In other words, the abstract design standardizes the analysis module interface, and all concrete analysis modules uniformly provide a consistent interface for receiving tasks and returning analysis results. This interface consistency is limited to the structural design of the interface entry and exit: the entry represents the task, and the exit represents the analysis result. This allows different analysis modules to implement different task processing logic within the interface logic. The analysis module itself serves as the actual task processing unit, and therefore, implementing at least one concrete analysis module is essential for the task analysis system to possess analytical capabilities.
[0087] By having each of the above parts perform their respective functions, the task analysis system can achieve the effects of customized orchestration of task analysis sequence, dynamic adjustment of task analysis modules, and free selection of task analysis results, thereby realizing a pluggable and modular task analysis scheduling system, which is suitable for complex scenarios where the serial and parallel processing of task analysis modules can be freely adjusted.
[0088] Figure 3 This is a schematic diagram of an optional task analysis system loading initialization according to an embodiment of the present invention, which clarifies the initialization work of the task analysis system and the relationship and startup sequence between various subsystems.
[0089] In this embodiment, when the task analysis system starts running, the configuration management subsystem will be loaded and initialized as the first subsystem, and other subsystems will be in a suspended state after loading. Then, the initialization of the task analysis system will be completed according to the following process.
[0090] The following combination Figure 3 The initialization work of the task analysis system is explained in detail.
[0091] (1) The configuration management subsystem starts and loads the file contents in the configuration file.
[0092] (2) The configuration management subsystem parses the configuration file content to obtain information such as the analysis sequence, result judgment rules, and enabled analysis modules.
[0093] (3) The configuration management subsystem transmits analysis sequence information to the scheduling subsystem and wakes up the scheduling subsystem; the configuration management subsystem transmits enabled analysis module information to the analysis module management subsystem and wakes up the analysis module management subsystem; the configuration management subsystem transmits result judgment rule information to the result judgment subsystem and wakes up the result judgment subsystem. The information transmission process can be understood as a concurrent processing process.
[0094] (4) After receiving the analysis sequence information, the scheduling subsystem initializes the subsystem and then enters the ready state. After receiving the enabled analysis module information, the analysis module management subsystem initializes the subsystem and then enters the ready state. After receiving the enabled analysis module information, the result judgment subsystem initializes the subsystem and then enters the ready state. The subsystem initialization process can be understood as a concurrent process.
[0095] (5) When all subsystems enter the ready state, the task analysis system begins to process the tasks in the task receiving queue. If there are no tasks in the task receiving queue, it waits for the tasks to arrive.
[0096] Figure 4 is a schematic diagram of an optional serial task analysis scenario according to an embodiment of the present invention, Figure 5 is a schematic diagram of another optional serial task analysis scenario according to an embodiment of the present invention, such as Figure 4 、 5 As shown in the figure, the analysis scenarios described are all scenarios where tasks are processed serially (sequentially), that is, the task completes the analysis process of each analysis module in a predetermined order, and after the analysis of an analysis module is completed, it is handed over to the next analysis module for analysis until the task is determined to be completed. In this embodiment, there are two situations in which a task is determined to be completed. One is that the result determination subsystem determines that the task can be completed (such as Figure 4 The other is that all analysis modules have been analyzed and errors are considered to be completed (such as Figure 5 The task serial processing flow is as follows:
[0097] (1) The external system submits a task to the task analysis system, and the task enters the task receiving queue;
[0098] (2) The scheduling subsystem obtains the head task in the task receiving queue for processing. According to the configuration of the analysis order (for example, the analysis order records A first and B later), it should be sent to analysis module A for analysis first and then to analysis module B for analysis;
[0099] (3) The scheduling subsystem submits the task to the analysis module management subsystem for processing, and informs the analysis module management subsystem that this task will be sent to analysis module A for analysis;
[0100] (4) The analysis module management subsystem calls the analysis module A interface to submit the task to the analysis module A for analysis and processing;
[0101] (5) Analysis module A analyzes and processes the task;
[0102] (6) Analysis module A returns the analysis results of the task to the analysis module management subsystem;
[0103] (7) The analysis module management subsystem returns the analysis results of the task to the scheduling subsystem;
[0104] (8) The scheduling subsystem submits the tasks and analysis results to the result determination subsystem;
[0105] (9) The result judgment subsystem determines whether the current task can be analyzed based on the result judgment rules and summarizes the task analysis results. If it can be completed, jump to step (22) for processing. This process branch corresponds to Figure 4 The scenario shown; if it cannot be ended, jump to step (10) for processing. This process branch corresponds to Figure 5 The scene shown;
[0106] (10) The result judgment subsystem submits the summarized analysis results and the "cannot end" information to the scheduling subsystem;
[0107] (11) After receiving the "cannot end" message, the scheduling subsystem clearly needs to continue task analysis and sends the task to analysis module B for analysis according to the configuration of analysis sequence (for example, the analysis sequence records A first and B later);
[0108] (12) The scheduling subsystem submits the task to the analysis module management subsystem for processing, and informs the analysis module management subsystem that this task will be sent to analysis module B for analysis;
[0109] (13) The analysis module management subsystem calls the analysis module B interface and submits the task to the analysis module B for analysis and processing;
[0110] (14) Analysis module B analyzes and processes the task;
[0111] (15) Analysis module B returns the analysis results of the task to the analysis module management subsystem;
[0112] (16) The analysis module management subsystem returns the analysis results of the task to the scheduling subsystem;
[0113] (17) The scheduling subsystem submits the tasks and analysis results to the result determination subsystem;
[0114] (18) The result judgment subsystem determines whether the analysis of the current task can be completed according to the result judgment rules, and summarizes the task analysis results. If it can be completed, jump to step (21) for processing; if it cannot be completed, jump to step (19) for processing;
[0115] (19) The result judgment subsystem submits the analysis results and the "cannot end" message to the scheduling subsystem;
[0116] (20) After receiving the "cannot end" message, the scheduling subsystem clearly needs to continue the task analysis. However, at this time, there are no available analysis modules according to the configuration of the analysis order. Therefore, the scheduling subsystem will determine that the task is finished and jump to step (23);
[0117] (21) The result judgment subsystem submits the summarized task analysis results and the “can be ended” information to the scheduling subsystem;
[0118] (22) After receiving the “can end” message and the analysis results, the scheduling subsystem clearly states that there is no need to continue the task analysis;
[0119] (23) The scheduling subsystem returns the task analysis results to the external system.
[0120] Figure 6 is a schematic diagram of an optional parallel task analysis scenario according to an embodiment of the present invention, such as Figure 6 The analysis scenario described is one where tasks are processed in parallel (simultaneously). This means that tasks are no longer sent to each analysis module one by one in a predetermined order, and no longer processed in one module before being sent to the next. Instead, tasks are sent to multiple analysis modules simultaneously for analysis. A task is considered complete only when all analysis modules have completed their analysis. The process for parallel task processing is as follows:
[0121] (1) The external system submits a task to the task analysis system, and the task enters the task receiving queue;
[0122] (2) The scheduling subsystem obtains the head task of the task receiving queue for processing. According to the configuration of the analysis order (for example, the analysis order records A and B at the same time), it should be sent to analysis module A and analysis module B for analysis at the same time;
[0123] (3) The scheduling subsystem submits the task to the analysis module management subsystem for processing, and informs the analysis module management subsystem that this task needs to be sent to both analysis module A and analysis module B for analysis;
[0124] (4) The analysis module management subsystem starts a concurrent thread, calls the analysis module A interface to submit the task to analysis module A for analysis and processing, and calls the analysis module B interface to submit the task to analysis module B for analysis and processing;
[0125] (5) Analysis module A analyzes and processes the task, and analysis module B analyzes and processes the task;
[0126] (6) Analysis module A returns the analysis results of the task to the analysis module management subsystem;
[0127] (7) The analysis module management subsystem returns the analysis results of the task in analysis module A to the scheduling subsystem;
[0128] (8) The scheduling subsystem waits for analysis module B to complete the analysis;
[0129] (9) Analysis module B returns the analysis results of the task to the analysis module management subsystem;
[0130] (10) The analysis module management subsystem returns the analysis results of the task in analysis module B to the scheduling subsystem;
[0131] (11) The scheduling subsystem submits the task and two analysis results from different analysis modules to the result determination subsystem;
[0132] (12) The result judgment subsystem summarizes the analysis results from the two analysis modules to form a summary analysis result, and judges whether the current analysis task can be ended according to the result judgment rules. If it can be ended, jump to step (15); if it cannot be ended, jump to step (13);
[0133] (13) The result judgment subsystem submits the analysis results and the "cannot end" message to the scheduling subsystem;
[0134] (14) After receiving the "cannot end" message, the scheduling subsystem clearly needs to continue the task analysis. However, at this time, there are no available analysis modules according to the configuration of the analysis order. Therefore, the scheduling subsystem will determine that the task is finished and jump to step (17);
[0135] (15) The result judgment subsystem submits the summarized analysis results and the "end possible" information to the scheduling subsystem;
[0136] (16) After receiving the “end” message, the scheduling subsystem clearly states that there is no need to continue task analysis;
[0137] (17) The scheduling subsystem returns the task analysis results to the outside.
[0138] In this embodiment, Figure 4 、 Figure 5 、 Figure 6 The described scenarios can be mixed and matched, that is, the analysis order of tasks can be customized at will, combining serial and parallel operations.
[0139] The task analysis system proposed in this embodiment can be applied to different application scenarios, including but not limited to the following application scenarios:
[0140] (1) Application scenarios where there are logical problems in the analysis module and it needs to be taken offline for processing.
[0141] In scenarios where an analysis module has a problem with its analysis processing logic that cannot be fixed quickly and will affect the final analysis results of a task if it is not taken offline, this embodiment can disable such an analysis module in the configuration file and then restart the task analysis system to promptly take the problematic analysis module offline. This also provides the problematic analysis module with ample time to resolve the problem. Once the problem is fixed, the system can be restored by re-modifying the configuration file and restarting the system.
[0142] (2) Application scenarios where the final judgment of the results needs to be adjusted from time to time.
[0143] In the task analysis system, tasks are analyzed and processed by different analysis modules, and the final result is obtained by summarizing and generalizing the analysis results of these different analysis modules. In this embodiment, it can be determined by the result judgment rule.
[0144] In summary, this process can be understood as an algorithm tuning process. Since it's an algorithm, to improve the reliability of the results, there's a need to tune the algorithm for different scenarios. This embodiment can meet these needs by adjusting the result determination rules in the configuration file. This externalizes the algorithm, eliminating the need for secondary development and improving work efficiency.
[0145] (3) Application scenarios with different requirements for enabling analysis modules at different times.
[0146] For example, a task is initially configured to be processed by analysis modules A and B, but later, due to other requirements, the task needs to be adjusted to be processed by analysis modules A, B, and C. To address this, this embodiment only requires making the following adjustments in the configuration file: starting analysis module C and adding it to the analysis order configuration, and then restarting the task analysis system to meet the changed requirements.
[0147] (4) Application scenarios where different application scenarios have different requirements for the order of task analysis.
[0148] For example, scenario 1 requires that the task be processed by analysis module A first, then by analysis module B, and finally by analysis module C.
[0149] Scenario 2 requirements: The task is first processed by analysis module C, then handed over to analysis module B, and finally handed over to analysis module A.
[0150] In this regard, this embodiment can meet the needs of different scenarios by adjusting the task analysis sequence information in the configuration file and then restarting the task analysis system.
[0151] (5) Task analysis can be serialized, parallelized, or mixed in application scenarios.
[0152] Task serial analysis is suitable for scenarios where there are dependencies between analysis modules. For example, a task is first processed by analysis module A and then handed off to analysis module B. This arrangement may be because analysis module B relies on some output or intermediate results of analysis module A. This task serial analysis structure is considered from the perspective of task analysis time, which is the sum of the time spent by each serial analysis module.
[0153] Task parallel analysis is suitable for scenarios where there is no correlation between analysis modules and the task analysis time is high. For example, a task is processed by analysis module A and analysis module B at the same time. Such an arrangement can make the task analysis time equal to the time spent by the longest analysis module, rather than the sum of the time spent by each analysis module, thereby achieving the purpose of rapid task analysis.
[0154] The mashup scenario generally requires considering both the dependencies of analysis modules and the time consumption of task analysis. For example, analysis module A is first used to process the task, then it is simultaneously processed by analysis module B and analysis module C, and finally it is processed by analysis module D.
[0155] (6) Facilitates horizontal expansion of analytical logic application scenarios.
[0156] For example, the initial task needs to implement the operations of adding one and adding two. Adding one is the logic of analysis module A, and adding two is the logic of analysis module B. In this case, the task should be sent to analysis module A for processing first, and then sent to analysis module B for processing after completion, thus implementing the operations of adding one and then adding two.
[0157] If you need to add a three-plus-three logic to the original one later, if the system itself is not flexible, you will need to change the system's analysis logic or even perform secondary development. If this is just a temporary requirement, then you will need to withdraw this part of the modification and development later.
[0158] In this regard, this embodiment can provide a flexible and convenient extension implementation. First, the three operations are added as a new analysis module, and an interface with a unified format is implemented according to the abstract design of the analysis module. Then, the three-add logic is implemented in the interface. Then, the analysis module is started in the configuration file and arranged after the analysis module B, that is, the analysis order is configured. After restarting the task analysis system, the newly added analysis module will be loaded and maintained by the analysis module management subsystem.
[0159] If the three logics are no longer needed, you can modify the configuration file again to disable the newly added analysis module and restart the task analysis system.
[0160] In this embodiment, a task analysis system with modular functions, pluggable function modules, and easy dynamic expansion is implemented to adapt to scenarios that require high flexibility in the arrangement of function modules and the convenience of adjusting the analysis system at any time. At the same time, it can ensure that the system arrangement is invisible to the outside world and that the system input and output remain consistent before and after adjustments. This meets the usage requirements of not requiring synchronous adjustments to upper-layer services after changes to the task analysis system, and can achieve the following beneficial effects:
[0161] (1) The modularization of analysis logic is realized. (2) The pluggable function of analysis function module is realized. (3) The analysis function module is convenient for dynamic expansion. (4) The analysis logic arrangement is flexible and supports custom arrangement. (5) Changes and adjustments do not require secondary development or changes to the core logic. (6) Changes and adjustments can be rolled back at any time. (7) The core algorithm (i.e., enabling modules, analysis sequence, and result judgment) can be configured and externalized. (8) The system input and output remain consistent before and after the adjustment, and the external system is not visible to the system arrangement.
[0162] According to another aspect of an embodiment of the present invention, an electronic device is also provided, including one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement the above-mentioned task analysis method.
[0163] Figure 7 FIG is a hardware structure diagram of an electronic device (or mobile device) for task analysis according to an embodiment of the present invention. Figure 7 As shown, the electronic device may include one or more (shown as 702a, 702b, ..., 702n in the figure) processors 702 (the processor 702 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 704 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply and / or a camera. It will be understood by those skilled in the art that Figure 7 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 7 More or fewer components than shown, or with Figure 7 Different configurations shown.
[0164] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0165] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0166] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0167] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0168] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0169] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.
[0170] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A task analysis method, characterized in that: include: Parsing a pre-configured configuration file to obtain configuration information, wherein the configuration information at least includes: result determination information and analysis sequence information; Obtaining an external task request from a preset sorting queue, and generating scheduling information corresponding to the external task request based on the analysis sequence information, wherein the scheduling information at least includes: a calling sequence and an analysis module identifier, and each analysis module indicated by the analysis module identifier corresponds to one calling sequence; Based on the calling order, the external task request is transmitted to the analysis module indicated by the corresponding analysis module identifier, wherein the analysis module processes the external task request based on a preset processing logic and generates an initial analysis result; determining a processing status of the external task request based on the result determination information and the initial analysis result, and generating a target analysis report if the processing status indicates that the request processing is complete; Among them, before parsing the pre-configured configuration file to obtain the configuration information, it also includes: detecting multiple pre-established analysis modules to obtain the detection results, wherein each of the analysis modules has a pre-established processing logic and is configured with a unified abstract interface; determining that the processing logic indicated by the detection result is a normal target analysis module, and obtaining a target analysis module set; based on the target analysis module set, adopting a preset format strategy to generate analysis module information, wherein the analysis module information includes: an analysis module identifier corresponding to each target analysis module in the target analysis module set; when generating the analysis module information, adopting the preset format strategy to configure the result judgment information and the analysis sequence information, wherein the analysis modules involved in the result judgment information and the analysis sequence information are the pre-started target analysis modules indicated by the analysis module identifier in the analysis module information; based on the analysis module information, the result judgment information and the analysis sequence information, generate the configuration file.
2. The analysis method according to claim 1, characterized in that The step of generating scheduling information corresponding to the external task request based on the analysis sequence information includes: Analyzing the analysis sequence information to obtain an analysis module identifier for processing the external task request and a calling sequence corresponding to the analysis module indicated by the analysis module identifier, wherein the calling sequence includes: serial calling and / or parallel calling; The scheduling information is generated based on the analysis module identifier and the calling sequence.
3. The analysis method according to claim 2, characterized in that After transmitting the external task request to the analysis module indicated by the corresponding analysis module identifier based on the calling order, the method further includes: In the case where the calling sequence only includes the serial calling, each time an initial analysis result is received, the correctness of the initial analysis result is determined based on the result determination information, and a determination result is generated; or In the case where the calling sequence includes the serial call and the parallel call, after receiving all analysis results transmitted by all parallel processing analysis modules indicated by the parallel call, all the analysis results are summarized to obtain a comprehensive analysis result, and based on the result judgment information, the correctness of the comprehensive analysis result is judged to generate a judgment result.
4. The analysis method according to claim 3, characterized in that The step of determining the processing status of the external task request based on the result determination information and the initial analysis result includes: If the determination result indicates that the analysis value carried by the initial analysis result or the comprehensive analysis result is not within a preset threshold range carried by the result determination information, determining that the processing status of the external task request is request processing incomplete; When the determination result indicates that the analysis value carried by the initial analysis result or the comprehensive analysis result is within the preset threshold range carried by the result determination information, the processing status of the external task request is determined to be request processing completed.
5. The analysis method according to claim 4, characterized in that After determining that the processing status of the external task request is that the request processing is not completed, the method further includes: In a case where the processing status of the external task request is that the request processing is not completed, summarizing the initial analysis result or the comprehensive analysis result into a summary analysis result, and continuing to receive the next analysis result until the processing status of the external task request is that the request processing is completed, or all analysis modules involved in the scheduling information are processed; Based on the summary analysis results, the target analysis report is generated.
6. A task analysis system, characterized in that: include: The task receiving queue is used to sort the received external task requests and put them into the preset sorting queue; The configuration management subsystem is used to parse the pre-configured configuration file to obtain configuration information, wherein the configuration information at least includes: analysis module information, result determination information, and analysis sequence information; a scheduling subsystem, configured to receive the analysis sequence information transmitted by the configuration management subsystem, and generate scheduling information corresponding to each of the external task requests based on the analysis sequence information; an analysis module management subsystem, configured to start the analysis module set indicated by the analysis module identifier set carried in the analysis module information, call the analysis module indicated by the analysis module identifier carried in the scheduling information transmitted by the scheduling subsystem, use the analysis module to process the external task request, and obtain an initial analysis result; a result determination subsystem for receiving the result determination information and the initial analysis result, and determining a processing status of the external task request based on the result determination information and the initial analysis result, and generating a target analysis report if the processing status indicates that the request has been processed, and transmitting the target analysis report to the scheduling subsystem; Wherein, before parsing the pre-configured configuration file to obtain the configuration information, the task analysis system is also used to: detect multiple pre-established analysis modules to obtain the detection results, wherein each of the analysis modules has pre-established processing logic and is configured with a unified abstract interface; determine that the processing logic indicated by the detection result is a normal target analysis module, and obtain a target analysis module set; based on the target analysis module set, adopt a preset format strategy to generate analysis module information, wherein the analysis module information includes: an analysis module identifier corresponding to each target analysis module in the target analysis module set; when generating the analysis module information, adopt the preset format strategy to configure the result judgment information and the analysis sequence information, wherein the analysis modules involved in the result judgment information and the analysis sequence information are the pre-started target analysis modules indicated by the analysis module identifier in the analysis module information; based on the analysis module information, the result judgment information and the analysis sequence information, generate the configuration file.
7. The task analysis system according to claim 6, characterized in that: The scheduling subsystem includes: A first acquiring unit, configured to acquire the external task request from the preset sorting queue; a first analyzing unit, configured to analyze the analysis sequence information to obtain an analysis module identifier for processing the external task request and a calling sequence corresponding to the analysis module indicated by the analysis module identifier, wherein the calling sequence includes: serial calling and / or parallel calling; A first generating unit, configured to generate the scheduling information based on the analysis module identifier and the calling sequence; The first transmitting unit is configured to transmit the scheduling information and the external task request to the analysis module management subsystem.
8. The task analysis system according to claim 6, characterized in that: The scheduling subsystem also includes: a second transmitting unit, configured to transmit the first analysis result transmitted by the analysis module management subsystem to the result determination subsystem; a first receiving unit, configured to receive a first determination result corresponding to the first analysis result and transmitted by the result determination subsystem; a first output unit, configured to output the target analysis report transmitted by the result determination subsystem to an external device when the first determination result indicates that the processing status of the external task request is request processing completed; A third transmission unit is used to continue transmitting the second analysis result transmitted by the analysis module management subsystem to the result judgment subsystem when the first judgment result indicates that the processing status of the external task request is that the request processing is not completed, until the second judgment result indicates that the processing status of the external task request is that the request processing is completed, or all analysis modules involved in the scheduling information are processed.
9. The task analysis system according to claim 6, characterized in that: The analysis module management subsystem includes: a first calling unit, configured to call, based on an abstract interface and in accordance with a calling order carried in the scheduling information, an analysis module corresponding to the analysis module identifier carried in the scheduling information, and transmit the external task request to the analysis module, wherein the analysis module processes the external task request based on a preset processing logic and generates an initial analysis result; A fourth transmitting unit is configured to transmit the initial analysis result to the scheduling subsystem.
10. The task analysis system according to claim 6, characterized in that: The result determination subsystem includes: a first determination unit, configured to determine the initial analysis result transmitted by the scheduling subsystem based on the result determination information, and generate a determination result; a first determining unit, configured to determine that the processing status of the external task request is incomplete request processing if the determination result indicates that the analysis value carried by the initial analysis result is not within a preset threshold range carried by the result determination information; a second receiving unit configured to, when determining that the processing status of the external task request is request processing incomplete, summarize the initial analysis result into a summary analysis result, and continue to receive a next analysis result until the processing status of the external task request is request processing completed, or the scheduling subsystem no longer transmits an analysis result; A second generating unit, configured to generate the target analysis report based on the summary analysis result; The fifth transmitting unit is used to transmit the target analysis report to the scheduling subsystem.
11. An electronic device for task analysis, characterized in that: The system comprises one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the task analysis method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Systems and methods for debugging an application running on a parallel-processing computer system
US20070294671A1
System for graphically generating the sequence and temporal relationship between tasks in a project
US5563994A