A task processing method and device, electronic equipment and storage medium
By acquiring the triggering event and task type, and processing tasks using pre-stored configuration information, the problem of the terminal needing to wait for code writing is solved, achieving fast and efficient task processing.
Patent Information
- Application Number
- CN202211505346.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-28
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2042-11-28
AI Technical Summary
In existing technologies, terminals need to wait for maintenance personnel to write code each time they encounter a different task, which affects task processing efficiency.
By responding to user actions to obtain trigger events and task types, and using pre-stored configuration information to process tasks, the need for writing code is eliminated.
It improves task processing efficiency, reduces the probability of configuration errors, and enhances security and processing speed.
Smart Images

Figure CN115756654B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to a task processing method, apparatus, electronic device, and storage medium. Background Technology
[0002] Currently, the terminal can implement the processing of a certain task based on the code written by the operation and maintenance personnel.
[0003] However, in the above method, each time a different task needs to be processed, it is necessary to wait for the operation and maintenance personnel to complete the corresponding code, which may affect the processing efficiency of the task. Summary of the Invention
[0004] This invention provides a task processing method, apparatus, electronic device, and storage medium, which solves the technical problem in related technologies that when a terminal encounters different tasks that need to be processed each time, it needs to wait for the maintenance personnel to complete the corresponding code, which may affect the processing efficiency of the tasks.
[0005] In a first aspect, the present invention provides a task processing method, comprising: responding to a first operation of a user account on a first component, obtaining an event type of a triggering event and a task type of a task to be processed, wherein the event type of the triggering event is the same as the operation type of the first operation, the task to be processed is a task corresponding to the triggering event, and the first component is one of at least one component included in a program; determining configuration information of the task to be processed based on the event type of the triggering event and the task type of the task to be processed; and processing the task to be processed based on the configuration information of the task to be processed.
[0006] Optionally, one component corresponds to one text file. After obtaining the event type of the triggering event and the task type of the task to be processed, the method further includes: obtaining the text file corresponding to the first component; parsing the text file to obtain the event corresponding to the first component; and determining that the task to be processed is in an abnormal state if the triggering event is not included in the event corresponding to the first component.
[0007] Optionally, determining the configuration information of the task to be processed based on the event type of the triggering event and the task type of the task to be processed specifically includes: querying a pre-stored type configuration relationship based on the event type of the triggering event and the task type of the task to be processed to determine the configuration information of the task to be processed. The type configuration relationship is used to indicate the event type and task type corresponding to one or more configuration information.
[0008] Optionally, the at least one of the above components also includes a second component, wherein the event type of the triggering event includes one or more of a click event, an input event, an update event, and a submit event, wherein the update event is used to indicate updating the data and / or style of the second component, and the submit event is used to indicate submitting the form.
[0009] Optionally, the at least one of the above components also includes a second component, and the task type of the task to be processed includes one or more of the following: jump link, form submission, tip, display prompt box, display the second component, hide the second component, update the data of the second component, and update the style of the second component.
[0010] Optionally, the at least one of the above components further includes a second component, the task type of the task to be processed is to update the data of the second component, the configuration information of the task to be processed includes the identifier of the second component, the name of the dynamic data and the value of the dynamic data, and the above processing of the task to be processed based on the configuration information of the task to be processed specifically includes: determining the data to be processed from the data included in the second component based on the name of the dynamic data; and updating the value of the data to be processed to the value of the dynamic data.
[0011] In a second aspect, the present invention provides a task processing apparatus, comprising: an acquisition module, a determination module, and a processing module; the acquisition module is configured to, in response to a first operation of a user account on a first component, acquire an event type of a triggering event and a task type of a task to be processed, wherein the event type of the triggering event is the same as the operation type of the first operation, the task to be processed is a task corresponding to the triggering event, and the first component is one of at least one component included in a program; the determination module is configured to, based on the event type of the triggering event and the task type of the task to be processed, determine configuration information of the task to be processed; the processing module is configured to, based on the configuration information of the task to be processed, process the task to be processed.
[0012] Optionally, one component corresponds to one text file; the acquisition module is further configured to acquire the text file corresponding to the first component; the processing module is further configured to parse the text file to obtain the event corresponding to the first component; the determination module is further configured to determine that the task to be processed is in an abnormal state if the triggering event is not included in the event corresponding to the first component.
[0013] Optionally, the determining module is specifically used to query a pre-stored type configuration relationship based on the event type of the triggering event and the task type of the task to be processed, and to determine the configuration information of the task to be processed. The type configuration relationship is used to indicate the event type and task type corresponding to one or more configuration information.
[0014] Optionally, the at least one of the above components also includes a second component, wherein the event type of the triggering event includes one or more of a click event, an input event, an update event, and a submit event, wherein the update event is used to indicate updating the data and / or style of the second component, and the submit event is used to indicate submitting the form.
[0015] Optionally, the at least one of the above components also includes a second component, and the task type of the task to be processed includes one or more of the following: jump link, form submission, tip, display prompt box, display the second component, hide the second component, update the data of the second component, and update the style of the second component.
[0016] Optionally, the at least one of the above components further includes a second component, the task type of the task to be processed is to update the data of the second component, and the configuration information of the task to be processed includes the identifier of the second component, the name of the dynamic data, and the value of the dynamic data; the determining module is further configured to determine the data to be processed from the data included in the second component based on the name of the dynamic data; the processing module is specifically configured to update the value of the data to be processed to the value of the dynamic data.
[0017] Thirdly, the present invention provides an electronic device, comprising: a processor and a memory configured to store processor-executable instructions; wherein the processor is configured to execute the instructions to implement any of the optional task processing methods described in the first aspect above.
[0018] Fourthly, the present invention provides a computer-readable storage medium storing instructions that, when executed by an electronic device, enable the electronic device to perform any of the optional task processing methods described in the first aspect.
[0019] The present invention provides a task processing method, apparatus, electronic device, and storage medium. The electronic device can respond to a user account's first operation on a first component, obtain the event type of a triggering event and the task type of a task to be processed, where the task to be processed is the task corresponding to the triggering event. Then, the electronic device can determine the configuration information of the task to be processed based on the event type of the triggering event and the task type of the task to be processed, and process the task to be processed based on the configuration information. In this embodiment, since the operation type of the first operation is the same as the event type of the triggering event, and the task to be processed is the task corresponding to the triggering event, the electronic device can quickly obtain the event type of the triggering event with the same operation type as the first operation, and obtain the task type of the task to be processed. Furthermore, since the electronic device stores the configuration information corresponding to each task to be processed, it can respond to the user account's first operation on the first component, quickly obtain the task to be processed, and process the task to be processed without writing code, thus improving task processing efficiency. Attached Figure Description
[0020] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the accompanying drawings used in the description of the embodiments or the prior art will be briefly introduced below.
[0021] Figure 1 A flowchart illustrating a task processing method provided in an embodiment of the present invention;
[0022] Figure 2 A flowchart illustrating another task processing method provided in an embodiment of the present invention;
[0023] Figure 3 A flowchart illustrating another task processing method provided in an embodiment of the present invention;
[0024] Figure 4 A configuration diagram illustrating another event configuration provided in an embodiment of the present invention;
[0025] Figure 5 A flowchart illustrating another task processing method provided in an embodiment of the present invention;
[0026] Figure 6 A flowchart illustrating another task processing method provided in an embodiment of the present invention;
[0027] Figure 7 This is a schematic diagram of the structure of a task processing device provided in an embodiment of the present invention;
[0028] Figure 8 This is a schematic diagram of another task processing device provided in an embodiment of the present invention. Detailed Implementation
[0029] The task processing method, apparatus, electronic device, and storage medium provided in the embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0030] The terms "first" and "second," etc., in the specification and drawings of this application are used to distinguish different objects, rather than to describe a specific order of objects. For example, "first component" and "second component," etc., are used to distinguish different components, rather than to describe a specific order of components.
[0031] Furthermore, the terms “comprising” and “having”, and any variations thereof, used in the description of this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or units is not limited to the steps or units listed, but may optionally include other steps or units not listed, or may optionally include other steps or units inherent to such processes, methods, products, or apparatus.
[0032] It should be noted that in the embodiments of the present invention, the words "exemplary" or "for example" are used to indicate that they are examples, illustrations, or descriptions. Any embodiment or design that is described as "exemplary" or "for example" in the embodiments of the present invention should not be construed as being more preferred or advantageous than other embodiments or design options. Specifically, the use of the words "exemplary" or "for example" is intended to present the relevant concepts in a specific manner.
[0033] The term "and / or" as used in this application includes using either one of two methods or using both methods simultaneously.
[0034] In the description of this application, unless otherwise stated, "a plurality of" means two or more.
[0035] As described in the background art, in related technologies, when a terminal encounters different tasks that need to be processed, it needs to wait for maintenance personnel to complete the corresponding code, which may affect the processing efficiency of the tasks. Based on this, embodiments of the present invention provide a task processing method, apparatus, electronic device, and storage medium. Since the operation type of the first operation is the same as the event type of the triggering event, and the task to be processed is the task corresponding to the triggering event, the electronic device can quickly obtain the event type of the triggering event that is the same as the operation type of the first operation, and obtain the task type of the task to be processed. Furthermore, since the electronic device stores the configuration information corresponding to each task to be processed, the electronic device can respond to the user account's first operation on the first component, quickly obtain the task to be processed, and process the task to be processed without writing code, thus improving the task processing efficiency.
[0036] The task processing method, apparatus, electronic device, and storage medium provided in this embodiment of the invention are applied to task processing scenarios in low-code platforms. When a user account performs a first operation on the first component, the electronic device can respond to the first operation, obtain the event type of the triggering event and the task type of the task to be processed, then determine the configuration information of the task to be processed based on the event type of the triggering event and the task type of the task to be processed, and process the task to be processed based on the configuration information.
[0037] like Figure 1 As shown, the task processing method provided in this embodiment of the invention may include S101-S103.
[0038] S101, In response to the user account's first operation on the first component, the electronic device obtains the event type of the triggering event and the task type of the pending task.
[0039] Wherein, the event type of the triggering event is the same as the operation type of the first operation, the task to be processed is the task corresponding to the triggering event, and the first component is one of at least one component included in the program.
[0040] It should be understood that the program is a program in an electronic device, which may include at least one component, and a user account may perform different operations on the at least one component to enable the electronic device to perform different tasks. For example, the program may be a program in a low-code platform.
[0041] In this embodiment of the invention, the first component can be understood as an interactive component. The first component can correspond to one or more trigger events. The event type of a trigger event can correspond to the task type of a task to be processed. It should be understood that when the user account performs a first operation on the first component, it can be understood that the first component has triggered an event. When a trigger event occurs, the electronic device can obtain a task to be processed.
[0042] In one implementation of this invention, the electronic device may store the event type of a triggering event corresponding to the first component and the task type of the task to be processed corresponding to the event type of the triggering event, so that the electronic device may, in response to the first operation, obtain the event type of a triggering event that is the same as the operation type of the first operation and the task type of the task to be processed corresponding to the event type of the triggering event.
[0043] Specifically, the electronic device may include a processor. In response to a first operation of the user account on the first component, the first component may send a request to the processor. The request includes the operation type of the first operation. The request is used to notify the first component that a triggering event has occurred and to request the processor to process the triggering event. Then, the processor may obtain the event type of the triggering event and the task type of the task to be processed.
[0044] Optionally, the first operation can be a click operation, and the task type of the pending task can be a form submission. Specifically, in response to a user account's click operation on the first component, the electronic device can obtain the click event and the pending task of the submitted form.
[0045] Optionally, the first component can be a button, a page, or a piece of text.
[0046] S102. The electronic device determines the configuration information of the task to be processed based on the event type of the triggering event and the task type of the task to be processed.
[0047] It should be understood that the configuration information is the relevant information configured by the electronic device for the task to be processed. The configuration information is used to process the task to be processed and may include configuration items and configuration data.
[0048] In one alternative implementation, the electronic device can store the event type of the triggering event and the configuration information corresponding to the task type of the task to be processed. When the electronic device processes the task to be processed, it can determine the configuration information of the task to be processed and then process the task to be processed based on the configuration information.
[0049] S103. The electronic device processes the task to be processed based on the configuration information of the task to be processed.
[0050] For example, the event type of the triggering event is a click event, the task type of the task to be processed is a form submission, and the configuration information is the submission address and submission method. In this case, the electronic device can submit the form based on the submission address and the submission method.
[0051] The technical solution provided by the above embodiments can bring at least the following beneficial effects: As shown in S101-S103, in response to the user account's first operation on the first component, the electronic device can obtain the event type of the triggering event and the task type of the task to be processed. The task to be processed is the task corresponding to the triggering event. Then, the electronic device can determine the configuration information of the task to be processed based on the event type of the triggering event and the task type of the task to be processed, and process the task to be processed based on the configuration information of the task to be processed. In this embodiment of the invention, since the operation type of the first operation is the same as the event type of the triggering event, and the task to be processed is the task corresponding to the triggering event, the electronic device can quickly obtain the event type of the triggering event that is the same as the operation type of the first operation, and obtain the task type of the task to be processed. Furthermore, since the electronic device stores the configuration information corresponding to each task to be processed, the electronic device can quickly obtain and process the task to be processed in response to the user account's first operation on the first component, without having to write code, thus improving the task processing efficiency.
[0052] In one implementation of this invention, one component corresponds to one text file, combined with... Figure 1 ,like Figure 2 As shown, after the electronic device obtains the event type of the triggering event and the task type of the task to be processed, the task processing method further includes S104-S106.
[0053] S104. The electronic device obtains the text file corresponding to the first component.
[0054] It should be understood that the text file of the first component is used to declare the event type of at least one triggering event corresponding to the first component and the task type of at least one task to be processed.
[0055] In one implementation of this invention, a text file of a component may include the event type of the triggering event corresponding to the component, such as "click", "change", "submit", etc., indicating that the event type of the triggering event corresponding to the component includes click event, update event, submit event, etc. The text file of the first component may include one or more of the above-mentioned event types of triggering events.
[0056] Optionally, the event type that triggers the event included in the text file can be in the form of a string.
[0057] In another implementation of this invention, a component's text file also includes the task type of the task to be processed corresponding to the component, such as "LINK", "SUBMIT", "SHOW-TOAST", "SHOW_DIALOG", "SHOW_COMPONENT", "HIDE_COMPONENT", "UPDATE_COMPONENT_DATA", "UPDATE_COMPONENT_STYLE", etc. The task type that identifies the task to be processed corresponding to the component includes jump link, form submission, tip, display prompt box, display component, hide component, update component data, update component style, etc. The text file of the first component may include one or more of the above-mentioned task types of the task to be processed.
[0058] Optionally, the task types of the tasks to be processed included in the text file can be in the form of an array of objects.
[0059] In an alternative implementation, a component's text file may also include the value passed to that component. This value is used to indicate that the component can pass the value to other components. The value passed may include "all", "item", "value", "name", etc. The value passed to identify the component includes all data of the component, individual data of the component, the value of the component, the name of the component option, etc. The text file of the first component may include one or more of the above-mentioned values passed.
[0060] Optionally, when the task to be processed by the first component does not need to pass data to other components, the text file of the first component may not include the passed value.
[0061] Optionally, the values passed in the text file can be string data.
[0062] Alternatively, the text file can be a JSON-formatted text file, such as Json-Schema.
[0063] S105. The electronic device parses and processes the text file to obtain the event corresponding to the first component.
[0064] In this embodiment of the invention, an event includes an event type that triggers the event and a task type that is to be processed. The text file is parsed and processed to obtain one or more events.
[0065] It is understandable that after receiving the event corresponding to the first component, the electronic device can register the event corresponding to the first component, specifically registering the trigger event of the first component and the pending task of the first component, so that the electronic device can respond to the user account's operation on the first component and obtain the event type of the trigger event and the task type of the pending task.
[0066] It should be understood that the electronic device can also register triggering events included in the events corresponding to the first component, so that the first component can monitor the user account's operations. When the user account performs an operation on the first component, the electronic device can respond to the operation, and then the electronic device can process the pending tasks corresponding to the event type of the triggering event of the first component.
[0067] It should be understood that the electronic device can obtain the text file of each component in at least one of the components in the above program, and then register the events of each component and the corresponding trigger events for each component.
[0068] The following is an example of a text file corresponding to the first component obtained by the electronic device in an embodiment of the present invention:
[0069]
[0070] Based on the above example, in the text file of the first component, "eventType" represents the event type, "eventTypeName" represents the Chinese name of the event type, and "valueKeys" represents the value passed. The event type of the triggering event included in the text file of the first component includes a click event, the task type of the task to be processed includes a jump link and updating component data, and the value passed includes the value of the component. The electronic device parses and processes the text file of the first component to obtain two events corresponding to the first component. Among them, the event type of the triggering event included in event one is a click event, and the task type of the task to be processed is a jump link. The event type of the triggering event included in event two is a click event, the task type of the task to be processed is updating component data, and the value passed is the value of the component.
[0071] In one implementation of this invention, the electronic device can add at least one component to a blank page, obtain a text file of each component in the at least one component, and then parse the text file of each component to obtain the event corresponding to each component.
[0072] S106. If the triggering event is not included in the event corresponding to the first component, the electronic device determines that the task to be processed is abnormal.
[0073] It should be understood that if the triggering event is not included in the events corresponding to the first component, it means that the electronic device has not registered a triggering event for the first component. The first component cannot respond to the user account's first operation on the first component, and therefore the electronic device cannot process the pending task. In this case, the electronic device can determine that the triggering event is abnormal and the pending task is abnormal.
[0074] In this embodiment of the invention, when the electronic device responds to the user's operation, it will prompt the user with error information, thereby reducing the probability of configuration errors and improving the security of task processing.
[0075] In this embodiment of the invention, the at least one component further includes a second component. The event type of the triggering event includes one or more of a click event, an input event, an update event, and a submit event. The update event is used to indicate updating the data and / or style of the second component, and the submit event is used to indicate submitting the form.
[0076] In this embodiment of the invention, the task type of the task to be processed includes one or more of the following: redirect link, form submission, tip, display prompt box, display the second component, hide the second component, update the data of the second component, and update the style of the second component.
[0077] It should be noted that the event types that trigger the events and the task types that need to be processed mentioned above are only examples of one embodiment of the invention. The embodiments of the present invention do not impose specific restrictions on the task types that need to be processed. The above task types basically cover most of the interaction scenarios of low-code platforms and can be used without secondary development.
[0078] Combination Figure 1 ,like Figure 3 As shown, in one implementation of the present invention, the electronic device determines the configuration information of the task to be processed based on the event type of the triggering event and the task type of the task to be processed, which may specifically include S1021.
[0079] S1021. The electronic device queries the pre-stored type configuration relationship based on the event type of the triggering event and the task type of the task to be processed, and determines the configuration information of the task to be processed.
[0080] This type of configuration relationship is used to indicate the event type and task type corresponding to one or more configuration information.
[0081] It should be noted that electronic devices can configure one or more corresponding configuration information for each task type. After the electronic device determines the task type of the task to be processed corresponding to the event type that triggers an event, it can determine the event type and task type corresponding to the one or more configuration information and store the type configuration relationship.
[0082] Optionally, when the task type to be processed is a jump link, the configuration information for this task type is "jump link address" and "jump method"; when the task type is a form submission, the configuration items for this task type are "submission address", "submission method", and "jump address"; when the task type is a tip, the configuration items for this task type are "tip type" and "display time"; when the task type is a display tip box, the configuration items for this task type are "submission box title", "submission box height", and "tip box width"; when the task type is a display component, the configuration items for this task type are "target component" and "conditional expression"; when the task type is a hidden component, the configuration items for this task type are "target component" and "expression"; when the task type is an update component data, the configuration items for this task type are "target component" and "dynamic parameters"; when the task type is an update component style, the configuration items for this task type are "target component", "dynamic parameters", and "update content".
[0083] For example, assuming the triggering event of the first component is a click event, and the task type of the pending task corresponding to the click event is update component data, the electronic device can determine the click event and update component data corresponding to the target component A and dynamic parameter one, and then respond to the user account's click operation on the first component. The electronic device can obtain the click event and update component data, and then determine the configuration information corresponding to the update component data as the target component A and dynamic parameter one.
[0084] Based on the description of the above embodiments, it should be understood that a configuration information includes a configuration item and configuration data, and the program includes at least one component. In response to a user account’s first operation on different components, when the task types of the tasks to be processed are the same, the configuration items corresponding to the task types are the same, but the configuration data corresponding to the task types may be different.
[0085] For example, in response to a user account's click operation on the first component, the electronic device obtains a trigger event of type "click event", the corresponding task type of the click event is "update component data", the corresponding configuration items of the updated component data are "target component" and "dynamic parameter", and the corresponding configuration items of the updated component data are "target component A" and "dynamic parameter one". In response to a user account's click operation on the second component, the electronic device obtains a trigger event of type "click event", the corresponding task type of the click event is "update component data", the corresponding configuration items of the updated component data are "target component" and "dynamic parameter", and the corresponding configuration items of the updated component data are "target component B" and "dynamic parameter two".
[0086] It is understandable that after receiving the first event of the first component, the electronic device can also configure one or more configuration information for each event in at least one event corresponding to the first component, and then store the type configuration relationship between each event and the configuration information corresponding to each event. Therefore, when the events of the first component include the event type of the event to be triggered, the electronic device can determine the configuration information corresponding to the task type of the task to be processed based on the type configuration relationship.
[0087] In one alternative implementation, the electronic device can configure events corresponding to the first component based on the text file of the first component and the task type of the task to be processed.
[0088] For example, such as Figure 4 As shown, assuming the text file of the first component declares that the event type of the triggering event of the first component can include click events, and the task type of the pending task of the first component includes updating component data and redirecting links, then the electronic device can determine that the events of the first component are configured as follows: Figure 4 The configuration page shown includes text information 101, text information 102, text information 103, text information 104, text information 105, text information 106, controls 107, controls 108, and controls 109. The event type is a click event, the value passed by the event is the value of the component, the task type of the event is to update component data, the target component of the event is the base bar chart, and the dynamic parameter of the event is parameter one.
[0089] In this embodiment of the invention, the configuration information may include dynamic parameters, supporting the configuration and use of dynamic parameters for events. Furthermore, the invention does not limit the number or type of dynamic parameters, which can meet the needs of various complex scenarios and lower the barrier to entry.
[0090] In one implementation of this invention, the at least one component further includes a second component. The task type of the task to be processed is to update the data of the second component. The configuration information of the task to be processed includes the identifier of the second component, the name of the dynamic data, and the value of the dynamic data. Figure 1 ,like Figure 5 As shown, the above-mentioned electronic device processes the task to be processed based on the configuration information of the task to be processed, specifically including S1031-S1032.
[0091] S1031, The electronic device determines the data to be processed from the data included in the second component based on the name of the dynamic data.
[0092] It should be understood that when the configuration information corresponding to the task type of the task to be processed includes a target component, it indicates that the task type needs to interact with other components. In this case, the electronic device can determine to register the task to be processed for each of the at least one component, so that each component can process the task to be processed in response to the operation of the user account.
[0093] In this embodiment of the invention, a dynamic parameter includes the name and value of the dynamic data. A configuration information may include one or more dynamic parameters. For example, the dynamic parameter is used to replace the passed value when the event corresponding to the first component includes the passed value.
[0094] It is understandable that when the task type of the task to be processed is to update the data of the second component, and the configuration information of the task to be processed includes the identifier of the second component, the electronic device can determine the task to be processed registered by the second component based on the task type of the task to be processed and the identifier of the second component, and determine the data to be processed from the data included in the second component based on the name of the dynamic data.
[0095] S1032, The electronic device updates the value of the data to be processed to the value of the dynamic data.
[0096] In this embodiment of the invention, the electronic device can replace the value of the dynamic data with the corresponding value transmitted in the event of the first component, and then update the value of the data to be processed with the value of the dynamic data, so as to update the data of the second component.
[0097] In one implementation of this invention, the program may further include an event bus, which can be understood as a processor. In response to a user account’s first operation on a first component, the first component can determine the event type that triggers the event, and the first component can obtain the transmitted value and send the event type and the transmitted value to the event bus. After receiving the event type and the transmitted value, the event bus can obtain the task type of the task to be processed corresponding to the triggering event type, and determine the configuration information corresponding to the task type. When the configuration information includes a second component, the event bus can send the task to be processed and the transmitted value to the second component, and the second component can process the task to be processed based on the transmitted value.
[0098] In this embodiment of the invention, the linkage between the first component and the second component is generated entirely by configuration. There is no coupling between the components. The interactive event function can be quickly implemented simply by configuring according to the specification. There is no need to pay attention to technical details when using it, which reduces the difficulty of use and improves the processing efficiency of the task.
[0099] The following describes the task processing method provided by the embodiments of the present invention using the functional modules included in an electronic device.
[0100] For example, such as Figure 6 As shown, assuming the program includes component 1, component 2, component 3, component 4, and an event bus, where component 1 is the first component mentioned above and component 2 is the second component mentioned above, the task processing method may include:
[0101] S201. In response to a user account's click operation on component 1, component 1 determines the event type that triggered the event.
[0102] It is understandable that the event type of the triggering event is the same as the operation type of the click operation, and component 1 can determine that the event type of the triggering event is a click event.
[0103] S202, The first component sends a first processing request to the event bus.
[0104] It is understandable that the first processing request includes the value passed and the event type of the triggering event. The value passed is the value of the component, and the event type of the triggering event is to update component data.
[0105] S203, The event bus sends a second processing request to component 2.
[0106] Understandably, the event bus can obtain the task type of the task to be processed based on the click event. The task type of the task to be processed is to update component data. The event bus can also determine that the configuration information is component 2, the name of the dynamic data and the value of the dynamic data. Then the event bus can replace the value of the dynamic data with the value of the component.
[0107] It should be understood that the event bus can identify component 2 from component 2, component 2 and component 4, and then send the second processing request to component 2, the second processing request including the value of the replaced dynamic data, the name of the dynamic data and the task type of the task to be processed.
[0108] S204, Component 2 replaces the data to be processed with the value of dynamic data.
[0109] Understandably, component 2 can identify the data to be processed based on the name of the dynamic data, and then replace the data to be processed with the value of the dynamic data.
[0110] In this embodiment of the invention, electronic devices and the like can be divided into functional modules according to the above method examples. For example, each function can be divided into its own functional module, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware or as a software functional module. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division; other division methods may be used in actual implementation.
[0111] When dividing each function into modules according to its corresponding function. Figure 7 A possible structural schematic diagram of the task processing device involved in the above embodiments is shown, such as... Figure 7 As shown, the task processing device 20 may include: an acquisition module 201, a determination module 202, and a processing module 203.
[0112] The acquisition module 201 is used to acquire the event type of the triggering event and the task type of the pending task in response to the first operation of the user account on the first component. The event type of the triggering event is the same as the operation type of the first operation, the pending task is the task corresponding to the triggering event, and the first component is one of at least one component included in the program.
[0113] The determination module 202 is used to determine the configuration information of the task to be processed based on the event type of the triggering event and the task type of the task to be processed.
[0114] The processing module 203 is used to process the task to be processed based on the configuration information of the task to be processed.
[0115] Optionally, one component corresponds to one text file.
[0116] The acquisition module 201 is also used to acquire the text file corresponding to the first component.
[0117] The processing module 203 is also used to parse the text file to obtain the event corresponding to the first component.
[0118] The determination module 202 is also used to determine that the task to be processed is in an abnormal state if the triggering event is not included in the event corresponding to the first component.
[0119] Optionally, the determining module 202 is specifically used to query the pre-stored type configuration relationship based on the event type of the triggering event and the task type of the task to be processed, and determine the configuration information of the task to be processed. The type configuration relationship is used to indicate the event type and task type corresponding to one or more configuration information.
[0120] Optionally, the at least one of the above components also includes a second component, wherein the event type of the triggering event includes one or more of a click event, an input event, an update event, and a submit event, wherein the update event is used to indicate updating the data and / or style of the second component, and the submit event is used to indicate submitting the form.
[0121] Optionally, the at least one of the above components also includes a second component, and the task type of the task to be processed includes one or more of the following: jump link, form submission, tip, display prompt box, display the second component, hide the second component, update the data of the second component, and update the style of the second component.
[0122] Optionally, the at least one component further includes a second component, the task type of the task to be processed is to update the data of the second component, and the configuration information of the task to be processed includes the identifier of the second component, the name of the dynamic data, and the value of the dynamic data.
[0123] The determination module 202 is also used to determine the data to be processed from the data included in the second component based on the name of the dynamic data.
[0124] The processing module 203 is specifically used to update the value of the data to be processed to the value of the dynamic data.
[0125] When using integrated units, Figure 8 A possible structural schematic diagram of the task processing device involved in the above embodiments is shown. For example... Figure 8 As shown, the task processing device 30 may include a processing module 301 and a communication module 302. The processing module 301 can be used to control and manage the actions of the task processing device 30. The communication module 302 can be used to support communication between the task processing device 30 and other entities. Optionally, as... Figure 8 As shown, the task processing device 30 may further include a storage module 303 for storing the program code and data of the task processing device 30.
[0126] The processing module 301 can be a processor or a controller. The communication module 302 can be a transceiver, transceiver circuit, or communication interface, etc. The storage module 303 can be a memory.
[0127] In this configuration, when the processing module 301 is a processor, the communication module 302 is a transceiver, and the storage module 303 is a memory, the processor, transceiver, and memory can be connected via a bus. The bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc.
[0128] It should be understood that, in various embodiments of the present invention, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0129] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0130] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0131] The units described as separate components may or may not be physically separate. 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 network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0132] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented using software programs, implementation can be, in whole or in part, in the form of a computer program product. This computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of the present invention are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium accessible to a computer or a data storage device containing one or more servers, data centers, etc., that can be integrated with the medium. The available media can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media (e.g., DVDs), or semiconductor media (e.g., solid-state drives (SSDs)).
[0133] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A task processing method characterized by, The method comprises the following steps: In response to a first operation of a first component by a user account, an event type of a trigger event and a task type of a to-be-processed task are obtained, the event type of the trigger event is the same as an operation type of the first operation, the to-be-processed task is a task corresponding to the trigger event, and the first component is one of at least one component included in a program; one component corresponds to one text file; A text file corresponding to the first component is obtained; The text file is parsed to obtain an event corresponding to the first component; In a case where the trigger event is not included in the event corresponding to the first component, it is determined that the to-be-processed task is abnormal; In a case where the trigger event is included in the event corresponding to the first component, configuration information of the to-be-processed task is determined according to the event type of the trigger event and the task type of the to-be-processed task, and a type configuration relationship is queried, the type configuration relationship being used to indicate one or more configuration information corresponding to an event type and a task type; The to-be-processed task is processed based on the configuration information of the to-be-processed task.
2. The task processing method according to claim 1, characterized by, The at least one component further comprises a second component, the event type of the trigger event comprises one or more of a click event, an input event, an update event, and a submission event, the update event is used to indicate updating data and / or a style of the second component, and the submission event is used to indicate submitting a form.
3. The task processing method of claim 1, wherein, The at least one component further comprises a second component, the task type of the to-be-processed task comprises one or more of a jump link, a submission form, a light prompt, a display prompt box, displaying the second component, hiding the second component, updating data of the second component, and updating a style of the second component.
4. The task processing method according to any one of claims 1 to 3, characterized by, The at least one component further comprises a second component, the task type of the to-be-processed task is updating data of the second component, the configuration information of the to-be-processed task comprises an identifier of the second component, a name of dynamic data, and a value of the dynamic data, and the processing of the to-be-processed task based on the configuration information of the to-be-processed task comprises: Based on the name of the dynamic data, to-be-processed data is determined from data included in the second component; The value of the to-be-processed data is updated to the value of the dynamic data.
5. A task processing apparatus characterized by comprising: The method comprises the following steps: An obtaining module, a determining module, and a processing module are included; The obtaining module is used to, in response to a first operation of a first component by a user account, obtain an event type of a trigger event and a task type of a to-be-processed task, the event type of the trigger event being the same as an operation type of the first operation, the to-be-processed task being a task corresponding to the trigger event, and the first component being one of at least one component included in a program; one component corresponds to one text file; The obtaining module is further used to obtain a text file corresponding to the first component; The processing module is used to parse the text file to obtain an event corresponding to the first component; The determining module is used to, in a case where the trigger event is not included in the event corresponding to the first component, determine that the to-be-processed task is abnormal; The determining module is further configured to, in a case where the first component corresponds to the trigger event, determine configuration information of the to-be-processed task according to an event type of the trigger event and a task type of the to-be-processed task by querying a pre-stored type configuration relationship, the type configuration relationship being used to indicate one or more configuration information corresponding to an event type and a task type. The processing module is configured to process the to-be-processed task based on the configuration information of the to-be-processed task.
6. The task processing apparatus according to claim 5, characterized by The at least one component further includes a second component, the event type of the trigger event includes one or more of a click event, an input event, an update event, and a submission event, the update event is used to indicate updating data and / or a style of the second component, and the submission event is used to indicate submitting a form.
7. The task processing apparatus according to claim 5, wherein The at least one component further includes a second component, the task type of the to-be-processed task includes one or more of a jump link, a submission form, a light prompt, displaying a prompt box, displaying the second component, hiding the second component, updating data of the second component, and updating a style of the second component.
8. The task processing apparatus according to any one of claims 5 to 7, characterized by, The at least one component further includes a second component, the task type of the to-be-processed task is updating data of the second component, and the configuration information of the to-be-processed task includes an identifier of the second component, a name of dynamic data, and a value of the dynamic data. The determining module is further configured to determine to-be-processed data from data included in the second component based on the name of the dynamic data. The processing module is specifically configured to update the value of the to-be-processed data to the value of the dynamic data.
9. An electronic device, comprising: The electronic device includes: a processor; a memory configured to store instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the task processing method of any one of claims 1-4.
10. A computer-readable storage medium having stored thereon instructions, the instructions comprising, When the instructions in the computer-readable storage medium are executed by the electronic device, the electronic device can perform the task processing method of any one of claims 1-4.
Citation Information
Patent Citations
Interactive data system self-defined arrangement method and system, and compiling and running method
CN107291462A