Data processing method, apparatus, and related product
By creating a data acquisition task in the first thread and using the second thread to execute multiple sub-tasks to acquire the attribute data of the editing component, the problem of low efficiency in attribute data acquisition in existing technologies is solved, and the timeliness of responding quickly to user operations and element editing is achieved.
Patent Information
- Application Number
- CN202510686991.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-26
- Publication Date
- 2026-11-27
AI Technical Summary
In existing technologies, the attribute data acquisition efficiency of element editing components is low, making it difficult to respond quickly to user operations and resulting in untimely element editing.
By creating a data acquisition task in the first thread and then using a second thread to execute multiple sub-tasks to obtain the attribute data of the editing component, the number of thread calls is reduced and efficiency is improved.
It enables quick retrieval of attribute data after the editing component is triggered, reduces thread call time, and improves the efficiency and timeliness of element editing.
Smart Images

Figure CN123177809A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a data processing method, apparatus and related products. Background Technology
[0002] Currently, specific objects can be created and developed within applications by loading elements. For example, in special effects development programs, elements such as images are loaded to develop video effects. Similarly, in game development programs, elements such as textures are loaded to develop online games. Once an element is loaded into an application, it has a corresponding editing component, and the attribute data of the editing component is related to the attribute data of the element. For instance, when a sticker is loaded into a special effects development program, the sticker has a corresponding editing box. The attribute data of the editing box can include its size, and the attribute data of the sticker can include its size. As the size of the editing box changes, the size of the sticker also changes accordingly. Therefore, it is necessary to provide a technical solution for quickly obtaining the attribute data of the editing component, enabling rapid editing of elements. Summary of the Invention
[0003] This disclosure provides a data processing method, apparatus, and related products that can quickly obtain attribute data of editing components.
[0004] In a first aspect, embodiments of this disclosure provide a data processing method, including: In response to a trigger command for an editing component, it is determined that the triggered attribute data of the editing component needs to be obtained; the editing component is used to edit an element after being triggered; the triggered attribute data is related to the editing result of the element; A data acquisition task is created through a first thread; the data acquisition task includes one or more subtasks; the subtasks are used to acquire sub-data; the sub-data are used to generate the attribute data after the trigger. The first thread calls the second thread to execute the data acquisition task, and the triggered attribute data is generated based on the sub-data corresponding to the sub-task returned by the second thread.
[0005] Secondly, embodiments of this disclosure provide a data processing method, including: In response to a display command for an editing component, it is determined that attribute data of the editing component needs to be obtained; the editing component is used to edit elements after being triggered; the attribute data is used to display the editing component; A data acquisition task is created through a first thread; the data acquisition task includes one or more subtasks; the subtasks are used to acquire sub-data; the sub-data are used to generate the attribute data of the editing component; The first thread calls the second thread to execute the data acquisition task, and the attribute data of the editing component is generated based on the sub-data corresponding to the sub-task returned by the second thread.
[0006] Thirdly, embodiments of this disclosure provide a data processing apparatus, including: The first determining unit is configured to, in response to a trigger command for an editing component, determine that it is necessary to obtain the triggered attribute data of the editing component; the editing component is used to edit an element after being triggered; the triggered attribute data is related to the editing result of the element; The first task creation unit is used to create a data acquisition task through a first thread; the data acquisition task includes one or more subtasks; the subtasks are used to acquire sub-data; the sub-data are used to generate the attribute data after the trigger. The first data generation unit is used to call the second thread through the first thread to execute the data acquisition task, and generate the triggered attribute data according to the sub-data corresponding to the sub-task returned by the second thread.
[0007] Fourthly, embodiments of this disclosure provide a data processing apparatus, including: The second determining unit is configured to, in response to a display instruction for the editing component, determine that attribute data of the editing component needs to be obtained; the editing component is used to edit elements after being triggered; the attribute data is used to display the editing component; The second task creation unit is used to create a data acquisition task through the first thread; the data acquisition task includes one or more subtasks; the subtasks are used to acquire sub-data; the sub-data are used to generate the attribute data of the editing component; The second data generation unit is used to execute the data acquisition task by calling the second thread through the first thread, and generate the attribute data of the editing component according to the sub-data corresponding to the sub-task returned by the second thread.
[0008] Fifthly, embodiments of this disclosure provide an electronic device, including: a processor; and a memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the methods described in the first or second aspect above.
[0009] In a sixth aspect, embodiments of this disclosure provide a computer-readable storage medium for storing computer-executable instructions that, when executed by a processor, implement the methods described in the first or second aspect above.
[0010] In a seventh aspect, embodiments of this disclosure provide a computer program product, the computer program product including a computer program, which, when executed by a processor, implements the method described in the first or second aspect above.
[0011] In one or more embodiments of this disclosure, firstly, in response to a trigger instruction for an editing component, it is determined that the triggered attribute data of the editing component needs to be obtained. The editing component is used to edit elements after being triggered, and the triggered attribute data is related to the editing result of the element. Then, a data acquisition task is created through a first thread. The data acquisition task includes one or more subtasks, which are used to acquire sub-data. The sub-data is used to generate the triggered attribute data. Finally, the first thread calls a second thread to execute the data acquisition task, and the triggered attribute data is generated according to the sub-data corresponding to the sub-task returned by the second thread. Therefore, through this embodiment, when a user triggers the editing component of an element to edit the element, a data acquisition task can be created through a first thread, and the first thread can call a second thread to execute the data acquisition task, thereby obtaining the triggered attribute data of the editing component. Since the data acquisition task includes multiple subtasks, each subtask is used to acquire each sub-data, and each sub-data can generate the triggered attribute data, the first thread only needs to call the second thread once to execute the data acquisition task to obtain the triggered attribute data of the editing component. The first thread does not need to call the second thread multiple times, reducing the time spent on calls between different threads and improving the efficiency of obtaining the attribute data after the editing component is triggered, thus achieving the effect of quickly obtaining the attribute data after the editing component is triggered. Attached Figure Description
[0012] To more clearly illustrate the technical solutions in one or more embodiments or related technologies of this disclosure, the accompanying drawings used in the description of the embodiments or related technologies will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments recorded in this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Figure 1 A schematic flowchart illustrating a data processing method provided in an embodiment of this disclosure; Figure 2 A schematic flowchart illustrating a data processing method provided in another embodiment of this disclosure; Figure 3 A schematic flowchart of a data processing method provided in yet another embodiment of this disclosure; Figure 4 This is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of the present disclosure; Figure 5This is a schematic diagram of the structure of a data processing apparatus provided in another embodiment of the present disclosure; Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. Detailed Implementation
[0013] To enable those skilled in the art to better understand the technical solutions in one or more embodiments of this disclosure, the technical solutions in one or more embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this disclosure, and not all of the embodiments. Based on one or more embodiments of this disclosure, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of this disclosure.
[0014] It is understood that before using the technical solutions disclosed in the embodiments of this disclosure, relevant parties should be informed of the type, scope of use, and usage scenarios of the information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and authorization from the relevant parties should be obtained.
[0015] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0016] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0017] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0018] This disclosure provides a data processing method, apparatus, and related products capable of quickly acquiring attribute data of editing components. The data processing method can be executed by a terminal device with an application installed. This application can create and develop specific objects by loading elements. Examples of such applications include special effects development programs or game development programs. The terminal device includes, but is not limited to, various types of user terminals such as laptops, tablets, desktop computers, and smartphones.
[0019] Figure 1 This is a schematic flowchart of a data processing method provided in an embodiment of the present disclosure, as shown below. Figure 1 As shown, the process includes: Step S102: In response to the trigger command for the editing component, determine that the attribute data of the editing component after triggering needs to be obtained; the editing component is used to edit the element after being triggered; the attribute data after triggering is related to the editing result of the element; Step S104: Create a data acquisition task through the first thread; the data acquisition task includes one or more subtasks; the subtasks are used to acquire sub-data; the sub-data are used to generate attribute data after triggering. Step S106: The first thread calls the second thread to execute the data acquisition task, and the attribute data after the trigger is generated based on the sub-data corresponding to the sub-task returned by the second thread.
[0020] In this embodiment, firstly, in response to a trigger command for the editing component, it is determined that the attribute data of the editing component after triggering needs to be obtained. The editing component is used to edit elements after being triggered, and the attribute data after triggering is related to the editing result of the element. Then, a data acquisition task is created through a first thread. The data acquisition task includes one or more subtasks, which are used to acquire sub-data. The sub-data is used to generate the attribute data after triggering. Finally, the first thread calls the second thread to execute the data acquisition task, and the attribute data after triggering is generated based on the sub-data corresponding to the subtasks returned by the second thread. Therefore, through this embodiment, when a user triggers the editing component of an element to edit the element, a data acquisition task can be created through the first thread, and the second thread can be called by the first thread to execute the data acquisition task, thereby obtaining the attribute data of the editing component after triggering. Since the data acquisition task includes multiple subtasks, each subtask is used to acquire various sub-data, and each sub-data can generate the attribute data after triggering. Therefore, the first thread only needs to call the second thread once to execute the data acquisition task to obtain the attribute data of the editing component after triggering. The first thread does not need to call the second thread multiple times, reducing the time spent on calls between different threads and improving the efficiency of obtaining the attribute data after the editing component is triggered, thus achieving the effect of quickly obtaining the attribute data after the editing component is triggered.
[0021] In this embodiment, after an element is loaded in the application, an editing component for that element can be displayed. This component is used to edit the element when triggered. After the user triggers the editing component, its attribute data changes, and the element changes accordingly. This embodiment allows us to obtain the attribute data of the editing component after it has been triggered. The attribute data after triggering is the changed attribute data.
[0022] In one example, after a sticker is loaded in the effects development program, an editing box for that sticker can be displayed. This editing box is used to edit the sticker's size when triggered. For example, if the user drags the vertices of the editing box, the coordinates of those vertices can be changed, thus changing the size of the editing box. As the size of the editing box changes, the size of the sticker also changes accordingly. The application pre-records the relative positional relationship between the coordinates of the editing box's vertices and the coordinates of the sticker's vertices. When the editing box is triggered by the user and the coordinates of its vertices are changed, the coordinates of the sticker's vertices can be changed accordingly based on the recorded relationship, thereby changing the sticker's size. In this example, the editing box is the editing component, and the coordinates of each vertex of the editing box after its vertices are dragged represent the attribute data of the editing component after being triggered. Through this embodiment, the coordinates of each vertex of the editing box after its vertices are dragged can be obtained.
[0023] In one example, after a sticker is loaded in the effects development program, a slider can be displayed. This slider is used to edit the sticker's transparency when triggered. For example, if the user moves the slider, its position changes, and the sticker's transparency changes accordingly. The application pre-records the correspondence between the slider's position and the sticker's transparency. When the user triggers the slider and changes its position, the changed transparency can be determined based on this recorded correspondence. In this example, the slider is the editing component, and the slider's position on the slider after movement represents the attribute data of the editing component after triggering. This embodiment allows us to obtain the slider's position on the slider after movement.
[0024] Based on this, in step S102 above, in response to the trigger command for the editing component, it is determined that the triggered attribute data of the editing component needs to be obtained. The trigger command is used to change the attribute data of the editing component, and the triggered attribute data of the editing component is the changed attribute data. The editing component is used to edit elements after being triggered, and the triggered attribute data is related to the editing result of the element. This triggered attribute data can be used to determine the editing result of the element. Examples of editing components include sliders, editing boxes, etc. The triggered attribute data includes, but is not limited to, the position of the slider on the slider after the slider is moved, and the coordinates of each vertex of the editing box after the vertex of the editing box is dragged. Examples of elements include stickers and images loaded in special effects development programs, and textures and images loaded in game development programs.
[0025] In one embodiment, in response to a trigger instruction for the editing component, determining that it is necessary to obtain the triggered attribute data of the editing component includes: through the front-end module in the first thread, in response to the trigger instruction for the editing component, determining that it is necessary to obtain the triggered attribute data of the editing component.
[0026] In this embodiment, a first thread is created within the application. The first thread includes a front-end module, such as a UI (User Interface) module, and a component editor. The front-end module is used in the application to respond to user actions, generate corresponding requests, and transmit the requests to the request handler. The component editor is an editing module in the application used to edit the various components displayed on the page. The component editor has the function of obtaining the attribute data of the component after the trigger, and sending the triggered attribute data to the front-end module so that the front-end module updates and displays the component based on the triggered attribute data. The component editor may include an SDK (Software Development Kit).
[0027] Based on this, in this embodiment, firstly, the front-end module, in response to a trigger command for the editing component, determines that it needs to obtain the attribute data of the editing component after the trigger, and generates a data acquisition request. This data acquisition request is used to request the retrieved attribute data of the editing component after the trigger. The front-end module can also send the data acquisition request to the component editor, thereby receiving the data acquisition request. The component editor can then execute... Figure 1 In steps S104 and S106, the triggered attribute data is obtained and sent to the front-end module so that the front-end module updates and displays the editing component according to the triggered attribute data.
[0028] As can be seen, through this embodiment, the front-end module in the first thread can determine the need to obtain the attribute data of the editing component after the trigger in response to the trigger command for the editing component. Leveraging the advantage of the front-end module's ability to quickly respond to user operations ensures the timeliness of obtaining the attribute data after the trigger.
[0029] In step S104 above, a data acquisition task is created through the first thread. The data acquisition task includes one or more subtasks, which are used to acquire sub-data, and the sub-data is used to generate attribute data after triggering. In this embodiment, the data acquisition task can be created through the aforementioned component editor.
[0030] In one embodiment, creating a data acquisition task via a first thread includes: The first thread determines the individual sub-data corresponding to the attribute data after the trigger; The first thread creates a task to retrieve the sub-data as a sub-task; The first thread creates data acquisition tasks based on each subtask.
[0031] In this embodiment, the component editor in the first thread can determine the sub-data corresponding to the triggered attribute data. For example, if the triggered attribute data includes the coordinates of each vertex of the edit box after the vertex is dragged, then the sub-data can be determined as the X-value of vertex 1 after dragging, the Y-value of vertex 1 after dragging, the X-value of vertex 2, the Y-value of vertex 2, the X-value of vertex 3, the Y-value of vertex 3, the X-value of vertex 4, and the Y-value of vertex 4. In this embodiment, the user can drag any one of the vertices 1-4 of the edit box each time. After each time the user drags a vertex of the edit box, the latest coordinates of the four vertices can be obtained synchronously, and the edit box can be updated based on the latest coordinates of the four vertices. In the above example, vertex 1 can be the vertex in the edit box that was dragged this time.
[0032] Then, using the component editor in the first thread, a subtask is created for each piece of data. This subtask is used to retrieve the corresponding piece of data. Finally, using the component editor in the first thread, a data retrieval task is created based on each subtask. For example, the subtasks can be combined into a single data retrieval task.
[0033] As can be seen, through this embodiment, the first thread can determine each sub-data corresponding to the triggered attribute data, create a task for obtaining the sub-data as a sub-task, and create a data acquisition task based on each sub-task. From the perspective of generating each sub-data required for the triggered attribute data, each sub-task can be created quickly, thereby creating a data acquisition task efficiently.
[0034] In one embodiment, a task for retrieving sub-data is created as a sub-task via a first thread, including: The first thread determines the data acquisition method corresponding to the sub-data and the task type corresponding to the data acquisition method. The first thread creates a task that belongs to the task type and is used to retrieve sub-data as a subtask.
[0035] In this embodiment, a corresponding subtask can be created for each piece of sub-data using the above method. Here, we take one piece of sub-data as an example. First, using the component editor in the first thread, the data acquisition method corresponding to the sub-data is determined. Data acquisition methods include one or more of data addition, data deletion, data modification, and data search. Then, using the component editor in the first thread, the task type corresponding to each data acquisition method of the sub-data is determined. The task type corresponds one-to-one with the data acquisition method, and the task types include one or more of data addition, data deletion, data modification, and data search tasks. Finally, using the component editor, a task belonging to the determined task type and used to acquire the sub-data is created as the subtask corresponding to that sub-data. In this embodiment, one piece of sub-data can correspond to one or more subtasks, and one subtask can belong to one or more task types. Each task type of a subtask corresponds to one data acquisition method. The subtask corresponding to each piece of sub-data can be created through the above process.
[0036] Taking the dragged X-value of vertex 1 (the edit box) as an example, vertex 1 is the vertex the user dragged this time. Therefore, the data acquisition methods corresponding to the dragged X-value of vertex 1 include data modification and data search. That is, first modify the X-value of vertex 1 before dragging to the X-value of vertex 1 after dragging, and then find the dragged X-value of vertex 1 as the sub-data. Next, the task types corresponding to the data acquisition methods are determined to be data modification tasks and data search tasks. Based on this, a sub-task can be created. The task types of this sub-task include data modification tasks and data search tasks. This sub-task is used to first modify the X-value of vertex 1 before dragging to the X-value of vertex 1 after dragging, and then find the dragged X-value of vertex 1 as the sub-data. Alternatively, two subtasks can be created, with the task types being a data modification task and a data search task. The subtask belonging to the data modification task is used to modify the X value of vertex 1 before dragging to the X value of vertex 1 after dragging. The subtask belonging to the data search task is used to find the X value of vertex 1 after dragging as sub-data.
[0037] Taking the X-value of vertex 2 in the edit box as an example, since vertex 2 is not the vertex the user dragged this time, the data acquisition method corresponding to the X-value of vertex 2 includes data lookup, that is, finding the X-value of vertex 2 before dragging as the sub-data. Next, the task type corresponding to the data acquisition method is determined to be a data lookup task. Based on this, a sub-task can be created with the task type of data lookup task, which is used to find the X-value of vertex 2 before dragging as the sub-data.
[0038] As can be seen, through this embodiment, for each piece of sub-data, the data acquisition method corresponding to the sub-data can be determined, and the task type corresponding to the data acquisition method can be determined. A task belonging to the task type and used to acquire the sub-data can be created as a sub-task corresponding to the sub-data. Thus, based on the data acquisition method and the corresponding task type of the sub-data, a sub-task can be quickly created for the sub-data.
[0039] After creating the subtask corresponding to each piece of data, a first thread creates a data acquisition task based on each subtask. In one embodiment, creating a data acquisition task based on each subtask using the first thread includes: The execution order of each subtask is determined by the first thread; The first thread creates a data acquisition task based on the execution order and each subtask.
[0040] In this embodiment, the execution order of each subtask is determined through the component editor in the first thread. The execution order of each subtask can be determined based on the order in which each sub-data is acquired. The order in which each sub-data is acquired can be pre-configured or determined according to the requirements for the acquisition order of the sub-data.
[0041] Referring to the previous example of obtaining the coordinates of the four vertices of the edit box, when the user drags vertex 1, the order of obtaining the sub-data can be determined according to the following requirements: X-values are obtained before Y-values, and the coordinates of the dragged vertex are obtained before the coordinates of other vertices. Therefore, the order of obtaining the sub-data is: X-value of dragged vertex 1, Y-value of dragged vertex 1, X-value of vertex 2, Y-value of vertex 2, X-value of vertex 3, Y-value of vertex 3, X-value of vertex 4, Y-value of vertex 4. Furthermore, based on the order of obtaining the sub-data, the execution order of the sub-tasks is determined as follows: Subtask 1 for obtaining the X-value of dragged vertex 1, Subtask 2 for obtaining the Y-value of dragged vertex 1, Subtask 3 for obtaining the X-value of vertex 2, Subtask 4 for obtaining the Y-value of vertex 2, Subtask 5 for obtaining the X-value of vertex 3, Subtask 6 for obtaining the Y-value of vertex 3, Subtask 7 for obtaining the X-value of vertex 4, Subtask 8 for obtaining the Y-value of vertex 4.
[0042] Next, using the component editor in the first thread, a data acquisition task is created based on the execution order of each subtask and the individual subtasks themselves. For example, using the component editor in the first thread, the subtasks are packaged into a single overall task according to their execution order, and the execution order of each subtask is marked in the overall task. This marked overall task is the data acquisition task.
[0043] As can be seen, this embodiment can determine the execution order of each subtask. Based on this execution order and each subtask, a data acquisition task is created, so that the second thread can execute each subtask in the data acquisition task in an orderly manner and accurately obtain the attribute data after the editing component is triggered.
[0044] After the data acquisition task is created by the first thread, in step S106 above, the first thread calls the second thread to execute the data acquisition task, and the attribute data after the trigger is generated according to the sub-data corresponding to the sub-task returned by the second thread.
[0045] In one embodiment, the data acquisition task is executed by calling a second thread from a first thread, including: The second thread is invoked synchronously or asynchronously by the first thread, and the second thread is used to perform the data acquisition task.
[0046] In this embodiment, the application has a second thread. The second thread can be a rendering thread in the application, which includes a rendering engine that can render elements and also obtain attribute data after the editing component is triggered.
[0047] Therefore, in one scenario, the first thread can synchronously invoke the rendering engine in the second thread to execute the data acquisition task. For example, the component editor in the first thread sends the data acquisition task to the task queue corresponding to the rendering engine in the second thread, and synchronously invokes the rendering engine to execute the data acquisition task. Synchronous invocation means that after the first thread sends the data acquisition task to the task queue corresponding to the rendering engine, it waits for the rendering engine to complete the data acquisition task until it receives the corresponding sub-data for each sub-task returned by the rendering engine. During the waiting period, the first thread does not perform any other operations.
[0048] In another scenario, the first thread can asynchronously invoke the rendering engine in the second thread to execute data fetching tasks. For example, the component editor in the first thread sends a data fetching task to the task queue corresponding to the rendering engine in the second thread, and asynchronously invokes the rendering engine to execute the data fetching task. Asynchronous invocation means that after the first thread sends the data fetching task to the task queue corresponding to the rendering engine, it returns to execute the tasks in its own task queue without waiting for the rendering engine to complete the data fetching task. After the rendering engine completes the data fetching task, it will send the various sub-data to the first thread.
[0049] As can be seen from this embodiment, the second thread can be called synchronously or asynchronously by the first thread according to actual needs, and the second thread can be used to perform data acquisition tasks, thereby improving the flexibility of calling the second thread to perform data acquisition tasks.
[0050] In step S106 above, after the first thread calls the second thread to execute the data acquisition task, it also acquires the sub-data corresponding to each sub-task returned by the second thread. In this embodiment, the first thread is used to receive the execution results of each sub-task returned by the second thread, and acquire each sub-data according to the execution results.
[0051] In this embodiment, one piece of data can correspond to one or more subtasks. Therefore, in one scenario, one piece of data corresponds to one subtask, and the piece of data is obtained through one subtask. In another scenario, one piece of data corresponds to multiple subtasks, and the piece of data is obtained through multiple subtasks. One of these multiple subtasks is used to generate the subdata based on the intermediate processing result of the subdata, while the other subtasks are used to generate the intermediate processing result. The second thread can tag the execution result of each subtask to indicate whether the execution result is subdata or an intermediate processing result of subdata. Thus, the first thread can accurately obtain each piece of subdata from the execution results of each subtask based on the tag of the subtask's execution result.
[0052] For example, the X-value of vertex 1 after dragging can be returned through two subtasks. The first subtask modifies the X-value of vertex 1 from its original value to its dragged value, and the second subtask reads the dragged X-value of vertex 1. In this case, the second thread can tag the execution result of the first subtask to indicate that the data modification was successful. The second thread can also tag the execution result of the second subtask to indicate that the execution result of the second subtask is the dragged X-value of vertex 1. Thus, the first thread can accurately obtain each piece of sub-data from the execution results of each subtask based on the tags of the subtask execution results.
[0053] The first thread can perform format checks on each acquired sub-data. Once the checks pass, the first thread can generate triggered attribute data based on the sub-data corresponding to the sub-task returned by the second thread. In one embodiment, generating triggered attribute data based on the sub-data corresponding to the sub-task returned by the second thread includes: Based on the data processing rules corresponding to the triggered attribute data, the sub-data is processed to obtain the triggered attribute data; the data processing rules are used to process the sub-data to obtain the triggered attribute data.
[0054] In this embodiment, pre-configured data processing rules corresponding to the triggered attribute data are used to represent the method of processing each sub-data. The triggered attribute data is obtained by processing each sub-data. Based on this, the first thread processes the sub-data according to the data processing rules corresponding to the triggered attribute data to obtain the triggered attribute data.
[0055] Referring to the previous example of obtaining the coordinates of the four vertices of the edit box, a total of 8 subtasks were created, each used to obtain the X-value, Y-value, X-value, Y-value of the dragged vertex 1, X-value, Y-value of the dragged vertex 2, X-value, Y-value of the dragged vertex 3, X-value, and Y-value of the dragged vertex 4, respectively. Based on this, the first thread, according to the data processing rules, combines the X-value and Y-value of the dragged vertex 1 to obtain its coordinates, combines the X-value and Y-value of vertex 2 to obtain its coordinates, combines the X-value and Y-value of vertex 3 to obtain its coordinates, and combines the X-value and Y-value of vertex 4 to obtain its coordinates. This yields the triggered attribute data, which includes the coordinates of each vertex.
[0056] As can be seen, through this embodiment, the sub-data can be processed according to the data processing rules corresponding to the triggered attribute data to obtain the triggered attribute data, thereby improving the efficiency of the first thread in generating the triggered attribute data by utilizing the data processing rules.
[0057] In one embodiment, the above method flow further includes: The first thread updates the editing component based on the triggered attribute data and displays the updated editing component.
[0058] As mentioned earlier, the first thread includes a front-end module, which updates and displays the editing component based on the triggered attribute data. Therefore, after generating the triggered attribute data, the first thread sends the triggered attribute data to the front-end module, which then updates the editing component based on the triggered attribute data and displays the updated editing component.
[0059] For example, in the first thread, after the component editor generates the coordinates of each vertex of the edit box, it sends these coordinates to the front-end module. The front-end module then uses these coordinates to redraw the edit box and displays the updated box, thus updating the edit box. When the edit component is a slider, the front-end module can redraw and display the slider based on its position after being dragged.
[0060] As can be seen, through this embodiment, by obtaining the attribute data after the editing component is triggered, the effect of updating the editing component can be achieved, thereby making it easier for users to continue editing elements using the editing component.
[0061] In one embodiment, the above method flow further includes: The second thread determines the editing result of the element based on the attribute data after the trigger. The second thread renders and displays the edited elements based on the editing results.
[0062] As mentioned earlier, the rendering engine in the second thread can render the elements. Based on this, after the user triggers the editing component to edit the elements, the second thread can determine the editing result of the elements based on the attribute data after the editing component is triggered. The second thread can then render and display the edited elements according to the editing result.
[0063] For example, when a user drags vertex 1 of the edit box to enlarge it, the rendering engine can obtain the coordinates of each vertex of the edit box from the first thread through the previous process. The rendering engine also recalculates the coordinates of each vertex of the sticker based on the coordinates of the edit box, using this as the edit result. Based on the calculated coordinates of the sticker's vertices, the rendering engine then re-renders and displays the edited sticker on the interface. Because the user enlarges the edit box, the edited sticker is larger than before. When the editing component is the aforementioned slider, the rendering engine can determine the changed transparency of the element based on the position of the dragged slider on the slider, and re-render and display the edited element based on this transparency.
[0064] As can be seen, through this embodiment, the second thread can determine the editing result of the element based on the attribute data after the trigger, and then render and display the edited element according to the editing result, thereby achieving the effect of editing the element based on the trigger result of the editing component.
[0065] As can be seen from this embodiment, after a user triggers the element's editing component to edit the element, a data acquisition task can be created through a first thread. The first thread then calls a second thread to execute the data acquisition task, thereby obtaining the attribute data of the edit component after it has been triggered. Since the data acquisition task includes multiple sub-tasks, each sub-task is used to acquire various sub-data, and each sub-data can generate the attribute data after the trigger. Therefore, the first thread only needs to call the second thread once to execute the data acquisition task, thus obtaining the attribute data of the edit component after the trigger. The first thread does not need to call the second thread multiple times, reducing the time spent on calls between different threads and improving the efficiency of obtaining the attribute data of the edit component after the trigger, achieving the effect of quickly obtaining the attribute data of the edit component after the trigger.
[0066] Figure 2 A flowchart illustrating a data processing method provided in another embodiment of this disclosure is shown below. Figure 2As shown, this method is executed by a terminal device. The terminal device has an application installed, which includes a first thread and a second thread. The first thread contains a front-end module and a component editor, while the second thread contains a rendering engine. There can be one or more second threads in the application. Figure 2 Two examples are given below. Therefore, Figure 2 The interface displays two threads: Thread 1, Thread 2, Rendering Engine 1, and Rendering Engine 2. Rendering Engine 1 renders and displays elements in the creation scene, while Rendering Engine 2 displays these elements in the preview scene. The creation scene can be understood as the editing environment for the created object, such as a special effect, where the user can edit the effect. The preview scene is a preview of the created object, such as a special effect; in this scene, the user cannot edit the effect but can view its effect.
[0067] Figure 2 In the scenario shown, the first thread and each of the second threads can communicate using a C interface, improving the lightweight nature of authoring applications. For example... Figure 2 As shown, the process includes the following steps: In step S202, the front-end module generates a data retrieval request based on the trigger command for the editing component.
[0068] In step S204, the front-end module sends a data retrieval request to the component editor.
[0069] Step S206: The component editor creates a data acquisition task based on the data acquisition request.
[0070] In step S208, the component editor sends the data acquisition task to the task queue of rendering engine 1 and asynchronously calls rendering engine 1 to execute the data acquisition task.
[0071] In step S210, the component editor sends the data acquisition task to the task queue of rendering engine 2 and asynchronously calls rendering engine 2 to execute the data acquisition task.
[0072] In step S212, rendering engine 1 returns each sub-data to the component editor.
[0073] In step S214, rendering engine 2 returns each sub-data to the component editor.
[0074] Step S216: The component editor generates the triggered attribute data 1 of the edit component based on the various sub-data returned by the rendering engine 1.
[0075] In step S218, the component editor generates the triggered attribute data 2 of the edit component based on the various sub-data returned by the rendering engine 2.
[0076] In step S220, when the component editor determines that the attribute data 1 after the trigger is the same as the attribute data 2 after the trigger, it sends the attribute data 1 after the trigger or the attribute data 2 after the trigger to the front-end module.
[0077] In step S222, the front-end module updates and displays the editing component based on the triggered attribute data 1 or the triggered attribute data 2.
[0078] In step S224, the rendering engine 1 determines the editing result of the element based on the attribute data 1 after the trigger and updates and displays the element in the creation scene.
[0079] In step S226, the rendering engine 2 determines the editing result of the element based on the attribute data 2 after the trigger and updates and displays the element in the preview scene.
[0080] In the above process, if the component editor determines that the triggered attribute data 1 is different from the triggered attribute data 2, it returns to step S208 and repeats the process until the same triggered attribute data 1 and triggered attribute data 2 are obtained. In the above process, the execution order of steps S208 and S210 can be interchanged, the execution order of steps S212 and S214 can be interchanged, the execution order of steps S216 and S218 can be interchanged, and the execution order of steps S224 and S226 can be interchanged. In the above process, the updated editing component can be displayed first, or the updated element can be displayed first.
[0081] Figure 2 For a detailed explanation, please refer to [the relevant source]. Figure 1 The description will not be repeated here. In this embodiment, the first thread only needs to call each second thread once to execute the data acquisition task, thus obtaining the attribute data of the edit component after it is triggered. The first thread does not need to call each second thread multiple times, reducing the time spent on calls between different threads and improving the efficiency of obtaining the attribute data of the edit component after it is triggered, achieving the effect of quickly obtaining the attribute data of the edit component after it is triggered.
[0082] Figure 3 A flowchart illustrating a data processing method provided in yet another embodiment of this disclosure is shown below. Figure 3 As shown, the method includes: Step S302: In response to a display instruction for the editing component, determine that the attribute data of the editing component needs to be obtained; the editing component is used to edit elements after being triggered; the attribute data is used to display the editing component; Step S304: Create a data acquisition task through the first thread; the data acquisition task includes one or more subtasks; the subtasks are used to acquire sub-data; the sub-data are used to generate attribute data for the editing component; Step S306: The first thread calls the second thread to execute the data acquisition task, and the attribute data of the editing component is generated according to the sub-data corresponding to the sub-task returned by the second thread.
[0083] In this embodiment, firstly, in response to a display instruction for the editing component, it is determined that attribute data for the editing component needs to be obtained. The editing component is used to edit elements after being triggered, and the attribute data is used to display the editing component. Then, a data acquisition task is created by a first thread. The data acquisition task includes one or more subtasks, which are used to acquire sub-data. The sub-data is used to generate the attribute data of the editing component. Finally, the first thread calls a second thread to execute the data acquisition task. Based on the sub-data corresponding to the subtasks returned by the second thread, the attribute data of the editing component is generated. Therefore, in the scenario of displaying an editing component, the first thread can create a data acquisition task and call a second thread to execute the data acquisition task, thereby obtaining the attribute data of the editing component. Since the data acquisition task includes multiple subtasks, each subtask is used to acquire various sub-data, and each sub-data can generate attribute data. Therefore, the first thread only needs to call the second thread once to execute the data acquisition task to obtain the attribute data of the editing component. The first thread does not need to call the second thread multiple times, reducing the time consumption of calls between different threads, improving the efficiency of obtaining the attribute data of the editing component, and achieving the effect of quickly obtaining the attribute data of the editing component.
[0084] The scenario for displaying the editing component can be: after a user triggers an element, such as by clicking on it, they determine that the editing component for that element needs to be displayed. Based on this, the above method flow can also include: responding to a trigger command for the element, treating the trigger command as a display command, thereby displaying the editing component when the user triggers the element to prepare for editing, facilitating the user's editing of the element.
[0085] The attribute data of the editing component can be used to display the editing component. Based on this, the above method flow can also include: rendering and displaying the editing component through the first thread according to the attribute data of the editing component. For example, the editing box can be drawn and displayed by the front-end module according to the coordinates of each vertex of the editing box, thereby achieving the effect of displaying the editing component and facilitating the editing of elements.
[0086] In step S302 above, determining that the attribute data of the editing component needs to be obtained in response to the display instruction for the editing component may include: determining that the attribute data of the editing component needs to be obtained through the front-end module in the first thread in response to the display instruction.
[0087] In step S304 above, creating a data acquisition task through the first thread may include: determining each sub-data corresponding to the attribute data through the first thread; creating a task for acquiring the sub-data as a sub-task through the first thread; and creating a data acquisition task based on each sub-task through the first thread.
[0088] The aforementioned creation of a task for acquiring sub-data as a subtask through the first thread may include: determining the data acquisition method corresponding to the sub-data through the first thread, and determining the task type corresponding to the data acquisition method; and creating a task belonging to the task type and used for acquiring sub-data as a subtask through the first thread.
[0089] The above-mentioned creation of data acquisition tasks based on each subtask by the first thread may include: determining the execution order of each subtask by the first thread; and creating data acquisition tasks based on the execution order and each subtask by the first thread.
[0090] In step S306 above, calling the second thread to execute the data acquisition task through the first thread may include: calling the second thread synchronously or asynchronously through the first thread, and using the second thread to execute the data acquisition task.
[0091] Step S306 above, which generates attribute data for the editing component based on the sub-data corresponding to the sub-task returned by the second thread, may include: processing the sub-data according to the data processing rules corresponding to the attribute data to obtain the attribute data; the data processing rules are used to process the sub-data to obtain the attribute data.
[0092] Figure 3 The process in the two languages differs from that in terms of implementation scenario. Figure 1 The processes in them share the same technical concept, therefore, Figure 3 The process and Figure 1 The similarities in the processes can be found in the references to those for... Figure 1 The explanation of the process will not be repeated here.
[0093] Figure 4 This is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of the present disclosure, as shown below. Figure 4 As shown, the device includes: The first determining unit 41 is configured to, in response to a trigger command for the editing component, determine that it is necessary to obtain the triggered attribute data of the editing component; the editing component is used to edit elements after being triggered; the triggered attribute data is related to the editing result of the element; The first task creation unit 42 is used to create a data acquisition task through a first thread; the data acquisition task includes one or more subtasks; the subtasks are used to acquire sub-data; the sub-data are used to generate the attribute data after the trigger. The first data generation unit 43 is used to call the second thread through the first thread to execute the data acquisition task, and generate the triggered attribute data according to the sub-data corresponding to the sub-task returned by the second thread.
[0094] Optionally, the first determining unit 41 is specifically used to: determine, through the front-end module in the first thread, in response to a trigger instruction for the editing component, that it is necessary to obtain the attribute data of the editing component after the trigger.
[0095] Optionally, the first task creation unit 42 is specifically used to: determine each of the sub-data corresponding to the triggered attribute data through the first thread; create a task for obtaining the sub-data as the sub-task through the first thread; and create the data acquisition task based on each of the sub-tasks through the first thread.
[0096] Optionally, the first task creation unit 42 is further configured to: determine the data acquisition method corresponding to the sub-data through the first thread, and determine the task type corresponding to the data acquisition method; and create a task belonging to the task type and used to acquire the sub-data as the sub-task through the first thread.
[0097] Optionally, the first task creation unit 42 is further configured to: determine the execution order of each of the subtasks through the first thread; and create the data acquisition task through the first thread based on the execution order and each of the subtasks.
[0098] Optionally, the first data generation unit 43 is specifically used to: synchronously or asynchronously call the second thread through the first thread, and use the second thread to execute the data acquisition task.
[0099] Optionally, the first data generation unit 43 is specifically used to: process the sub-data according to the data processing rules corresponding to the triggered attribute data to obtain the triggered attribute data; the data processing rules are used to process the sub-data to obtain the triggered attribute data.
[0100] Optionally, the device further includes: a first update display unit, configured to: update the editing component based on the triggered attribute data via the first thread, and display the updated editing component.
[0101] Optionally, the device further includes: a second update display unit, configured to: determine the editing result of the element based on the triggered attribute data by the second thread; and render and display the edited element according to the editing result of the element by the second thread.
[0102] The first determining unit 41, the first task creating unit 42, the first data generating unit 43, the request transmission unit, and the first update display unit can be located in the first thread, and the second update display unit can be located in the second thread.
[0103] In this embodiment, after a user triggers an element's editing component to edit the element, a data acquisition task can be created through a first thread. The first thread then calls a second thread to execute the data acquisition task, thereby obtaining the attribute data of the edit component after it has been triggered. Since the data acquisition task includes multiple sub-tasks, each sub-task acquires specific data, and each data can generate the triggered attribute data, the first thread only needs to call the second thread once to execute the data acquisition task, thus obtaining the attribute data of the edit component after it has been triggered. This eliminates the need for the first thread to call the second thread multiple times, reducing the time spent on calls between different threads and improving the efficiency of obtaining the attribute data of the edit component after it has been triggered, achieving the effect of quickly obtaining the attribute data of the edit component after it has been triggered.
[0104] The data processing apparatus in this embodiment can achieve the above-described functionality. Figure 1 The various processes in the data processing method embodiments described herein achieve the same effect and function, and will not be repeated here.
[0105] Figure 5 This is a schematic diagram of the structure of a data processing apparatus provided in another embodiment of the present disclosure, as shown below. Figure 5 As shown, the device includes: The second determining unit 51 is configured to determine, in response to a display instruction for the editing component, that attribute data of the editing component needs to be obtained; the editing component is used to edit elements after being triggered; the attribute data is used to display the editing component; The second task creation unit 52 is used to create a data acquisition task through the first thread; the data acquisition task includes one or more subtasks; the subtasks are used to acquire sub-data; the sub-data are used to generate the attribute data of the editing component; The second data generation unit 53 is used to execute the data acquisition task by calling the second thread through the first thread, and generate the attribute data of the editing component according to the sub-data corresponding to the sub-task returned by the second thread.
[0106] Optionally, the device further includes: an instruction determining unit, configured to, in response to a trigger instruction for the element, use the trigger instruction as the display instruction.
[0107] Optionally, the device further includes a component display unit, configured to render and display the editing component via the first thread based on the attribute data of the editing component.
[0108] The second determining unit 51, the second task creation unit 52, the second data generation unit 53, the instruction determining unit, and the component display unit can be located in the first thread.
[0109] In this embodiment, in a scenario displaying an editing component, a data acquisition task can be created by a first thread, and then the first thread calls a second thread to execute the data acquisition task, thereby obtaining the attribute data of the editing component. Since the data acquisition task includes multiple subtasks, each subtask is used to acquire specific data, and each data can generate attribute data, the first thread only needs to call the second thread once to execute the data acquisition task, thus obtaining the attribute data of the editing component. The first thread does not need to call the second thread multiple times, reducing the time spent on calls between different threads, improving the efficiency of obtaining the attribute data of the editing component, and achieving the effect of quickly obtaining the attribute data of the editing component.
[0110] The data processing apparatus in this embodiment can achieve the above-described functionality. Figure 3 The various processes in the data processing method embodiments described herein achieve the same effect and function, and will not be repeated here.
[0111] One embodiment of this disclosure also provides an electronic device. Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure, as shown below. Figure 6 As shown, electronic devices can vary considerably due to differences in configuration or performance. They may include one or more processors 601 and memories 602, with the memory 602 storing one or more application programs or data. The memory 602 can be temporary or persistent storage. The application programs stored in the memory 602 may include one or more modules (not shown), each module including a series of computer-executable instructions within the electronic device. Furthermore, the processor 601 may be configured to communicate with the memory 602, executing the series of computer-executable instructions stored in the memory 602 on the electronic device. The electronic device may also include one or more power supplies 603, one or more wired or wireless network interfaces 604, one or more input or output interfaces 605, one or more keyboards 606, etc.
[0112] In one specific embodiment, the electronic device includes a processor; and a memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the following process: In response to a trigger command for an editing component, it is determined that the triggered attribute data of the editing component needs to be obtained; the editing component is used to edit an element after being triggered; the triggered attribute data is related to the editing result of the element; A data acquisition task is created through a first thread; the data acquisition task includes one or more subtasks; the subtasks are used to acquire sub-data; the sub-data are used to generate the attribute data after the trigger. The first thread calls the second thread to execute the data acquisition task, and the triggered attribute data is generated based on the sub-data corresponding to the sub-task returned by the second thread.
[0113] In this embodiment, after a user triggers an element's editing component to edit the element, a data acquisition task can be created through a first thread. The first thread then calls a second thread to execute the data acquisition task, thereby obtaining the attribute data of the edit component after it has been triggered. Since the data acquisition task includes multiple sub-tasks, each sub-task acquires specific data, and each data can generate the triggered attribute data, the first thread only needs to call the second thread once to execute the data acquisition task, thus obtaining the attribute data of the edit component after it has been triggered. This eliminates the need for the first thread to call the second thread multiple times, reducing the time spent on calls between different threads and improving the efficiency of obtaining the attribute data of the edit component after it has been triggered, achieving the effect of quickly obtaining the attribute data of the edit component after it has been triggered.
[0114] The electronic device in this embodiment can achieve the above-described functionality. Figure 1 The various processes in the data processing method embodiments described herein achieve the same effect and function, and will not be repeated here.
[0115] In another specific embodiment, the electronic device includes a processor; and a memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the following processes: In response to a display command for an editing component, it is determined that attribute data of the editing component needs to be obtained; the editing component is used to edit elements after being triggered; the attribute data is used to display the editing component; A data acquisition task is created through a first thread; the data acquisition task includes one or more subtasks; the subtasks are used to acquire sub-data; the sub-data are used to generate the attribute data of the editing component; The first thread calls the second thread to execute the data acquisition task, and the attribute data of the editing component is generated based on the sub-data corresponding to the sub-task returned by the second thread.
[0116] In this embodiment, in a scenario displaying an editing component, a data acquisition task can be created by a first thread, and then the first thread calls a second thread to execute the data acquisition task, thereby obtaining the attribute data of the editing component. Since the data acquisition task includes multiple subtasks, each subtask is used to acquire specific data, and each data can generate attribute data, the first thread only needs to call the second thread once to execute the data acquisition task, thus obtaining the attribute data of the editing component. The first thread does not need to call the second thread multiple times, reducing the time spent on calls between different threads, improving the efficiency of obtaining the attribute data of the editing component, and achieving the effect of quickly obtaining the attribute data of the editing component.
[0117] The electronic device in this embodiment can achieve the above-described functionality. Figure 3 The various processes in the data processing method embodiments described herein achieve the same effect and function, and will not be repeated here.
[0118] Another embodiment of this disclosure also provides a computer-readable storage medium for storing computer-executable instructions that, when executed by a processor, implement the following process: In response to a trigger command for an editing component, it is determined that the triggered attribute data of the editing component needs to be obtained; the editing component is used to edit an element after being triggered; the triggered attribute data is related to the editing result of the element; A data acquisition task is created through a first thread; the data acquisition task includes one or more subtasks; the subtasks are used to acquire sub-data; the sub-data are used to generate the attribute data after the trigger. The first thread calls the second thread to execute the data acquisition task, and the triggered attribute data is generated based on the sub-data corresponding to the sub-task returned by the second thread.
[0119] In this embodiment, after a user triggers an element's editing component to edit the element, a data acquisition task can be created through a first thread. The first thread then calls a second thread to execute the data acquisition task, thereby obtaining the attribute data of the edit component after it has been triggered. Since the data acquisition task includes multiple sub-tasks, each sub-task acquires specific data, and each data can generate the triggered attribute data, the first thread only needs to call the second thread once to execute the data acquisition task, thus obtaining the attribute data of the edit component after it has been triggered. This eliminates the need for the first thread to call the second thread multiple times, reducing the time spent on calls between different threads and improving the efficiency of obtaining the attribute data of the edit component after it has been triggered, achieving the effect of quickly obtaining the attribute data of the edit component after it has been triggered.
[0120] The computer-readable storage medium in the embodiments of this disclosure can achieve the above-described functions. Figure 1 The various processes in the data processing method embodiments described herein achieve the same effect and function, and will not be repeated here.
[0121] Another embodiment of this disclosure also provides a computer-readable storage medium for storing computer-executable instructions that, when executed by a processor, implement the following process: In response to a display command for an editing component, it is determined that attribute data of the editing component needs to be obtained; the editing component is used to edit elements after being triggered; the attribute data is used to display the editing component; A data acquisition task is created through a first thread; the data acquisition task includes one or more subtasks; the subtasks are used to acquire sub-data; the sub-data are used to generate the attribute data of the editing component; The first thread calls the second thread to execute the data acquisition task, and the attribute data of the editing component is generated based on the sub-data corresponding to the sub-task returned by the second thread.
[0122] In this embodiment, in a scenario displaying an editing component, a data acquisition task can be created by a first thread, and then the first thread calls a second thread to execute the data acquisition task, thereby obtaining the attribute data of the editing component. Since the data acquisition task includes multiple subtasks, each subtask is used to acquire specific data, and each data can generate attribute data, the first thread only needs to call the second thread once to execute the data acquisition task, thus obtaining the attribute data of the editing component. The first thread does not need to call the second thread multiple times, reducing the time spent on calls between different threads, improving the efficiency of obtaining the attribute data of the editing component, and achieving the effect of quickly obtaining the attribute data of the editing component.
[0123] The computer-readable storage medium in the embodiments of this disclosure can achieve the above-described functions. Figure 3 The various processes in the data processing method embodiments described herein achieve the same effect and function, and will not be repeated here.
[0124] Another embodiment of this disclosure also provides a computer program product, the computer program product including a computer program, which, when executed by a processor, implements the following process: In response to a trigger command for an editing component, it is determined that the triggered attribute data of the editing component needs to be obtained; the editing component is used to edit an element after being triggered; the triggered attribute data is related to the editing result of the element; A data acquisition task is created through a first thread; the data acquisition task includes one or more subtasks; the subtasks are used to acquire sub-data; the sub-data are used to generate the attribute data after the trigger. The first thread calls the second thread to execute the data acquisition task, and the triggered attribute data is generated based on the sub-data corresponding to the sub-task returned by the second thread.
[0125] In this embodiment, after a user triggers an element's editing component to edit the element, a data acquisition task can be created through a first thread. The first thread then calls a second thread to execute the data acquisition task, thereby obtaining the attribute data of the edit component after it has been triggered. Since the data acquisition task includes multiple sub-tasks, each sub-task acquires specific data, and each data can generate the triggered attribute data, the first thread only needs to call the second thread once to execute the data acquisition task, thus obtaining the attribute data of the edit component after it has been triggered. This eliminates the need for the first thread to call the second thread multiple times, reducing the time spent on calls between different threads and improving the efficiency of obtaining the attribute data of the edit component after it has been triggered, achieving the effect of quickly obtaining the attribute data of the edit component after it has been triggered.
[0126] The computer program product in this embodiment can achieve the above-described functionality. Figure 1 The various processes in the data processing method embodiments described herein achieve the same effect and function, and will not be repeated here.
[0127] Another embodiment of this disclosure also provides a computer program product, the computer program product including a computer program, which, when executed by a processor, implements the following process: In response to a display command for an editing component, it is determined that attribute data of the editing component needs to be obtained; the editing component is used to edit elements after being triggered; the attribute data is used to display the editing component; A data acquisition task is created through a first thread; the data acquisition task includes one or more subtasks; the subtasks are used to acquire sub-data; the sub-data are used to generate the attribute data of the editing component; The first thread calls the second thread to execute the data acquisition task, and the attribute data of the editing component is generated based on the sub-data corresponding to the sub-task returned by the second thread.
[0128] In this embodiment, in a scenario displaying an editing component, a data acquisition task can be created by a first thread, and then the first thread calls a second thread to execute the data acquisition task, thereby obtaining the attribute data of the editing component. Since the data acquisition task includes multiple subtasks, each subtask is used to acquire specific data, and each data can generate attribute data, the first thread only needs to call the second thread once to execute the data acquisition task, thus obtaining the attribute data of the editing component. The first thread does not need to call the second thread multiple times, reducing the time spent on calls between different threads, improving the efficiency of obtaining the attribute data of the editing component, and achieving the effect of quickly obtaining the attribute data of the editing component.
[0129] The computer program product in this embodiment can achieve the above-described functionality. Figure 3 The various processes in the data processing method embodiments described herein achieve the same effect and function, and will not be repeated here.
[0130] In various embodiments of this disclosure, the computer-readable storage medium includes read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc.
[0131] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must also be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also understand that by simply performing some logic programming on the method flow using one of these hardware description languages and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.
[0132] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0133] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0134] For ease of description, the above apparatus is described by dividing it into various functional units. Of course, in implementing the embodiments of this disclosure, the functions of each unit can be implemented in one or more software and / or hardware.
[0135] Those skilled in the art will understand that one or more embodiments of this disclosure can be provided as a method, system, or computer program product. Therefore, one or more embodiments of this disclosure can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of this disclosure can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0136] This disclosure is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this disclosure. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create a machine for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0137] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0138] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0139] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0140] One or more embodiments of this disclosure can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a particular task or implement a particular abstract data type. One or more embodiments of this disclosure can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can reside in local and remote computer storage media, including storage devices.
[0141] The various embodiments in this disclosure are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0142] The above description is merely an embodiment of this disclosure and is not intended to limit the scope of this disclosure. Various modifications and variations can be made to this disclosure by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this disclosure should be included within the scope of the claims of this disclosure.
Claims
1. A data processing method, characterized in that, include: In response to a trigger command for the editing component, it is determined that the attribute data of the editing component after the trigger needs to be obtained; The editing component is used to edit elements after being triggered; the attribute data after triggering is related to the editing result of the element; A data acquisition task is created through a first thread; the data acquisition task includes one or more sub-tasks. The subtask is used to acquire sub-data; the sub-data is used to generate the attribute data after the trigger. The first thread calls the second thread to execute the data acquisition task, and the triggered attribute data is generated based on the sub-data corresponding to the sub-task returned by the second thread.
2. The method according to claim 1, characterized in that, The step of responding to a trigger command for the editing component and determining that it is necessary to obtain the attribute data of the editing component after the trigger includes: The front-end module in the first thread, in response to the trigger command for the editing component, determines that it is necessary to obtain the attribute data of the editing component after the trigger.
3. The method according to claim 1, characterized in that, The process of creating a data acquisition task through a first thread includes: The first thread determines each of the sub-data corresponding to the triggered attribute data; The first thread creates a task for retrieving the sub-data as the sub-task. The first thread creates the data acquisition task based on each of the subtasks.
4. The method according to claim 3, characterized in that, The step of creating a task through the first thread to obtain the sub-data as the sub-task includes: The first thread determines the data acquisition method corresponding to the sub-data and the task type corresponding to the data acquisition method. The first thread creates a task belonging to the task type and used to retrieve the sub-data as the sub-task.
5. The method according to claim 3, characterized in that, The step of creating the data acquisition task based on each of the subtasks through the first thread includes: The execution order of each subtask is determined by the first thread; The first thread creates the data acquisition task based on the execution order and each of the subtasks.
6. The method according to claim 1, characterized in that, The step of executing the data acquisition task by calling the second thread through the first thread includes: The first thread synchronously or asynchronously calls the second thread to execute the data acquisition task.
7. The method according to claim 1, characterized in that, The step of generating the triggered attribute data based on the sub-data corresponding to the sub-task returned by the second thread includes: According to the data processing rules corresponding to the triggered attribute data, the sub-data is processed to obtain the triggered attribute data; the data processing rules are used to process the sub-data to obtain the triggered attribute data.
8. The method according to claim 1, characterized in that, The method further includes: The first thread updates the editing component based on the triggered attribute data, and displays the updated editing component.
9. The method according to claim 1, characterized in that, The method further includes: The second thread determines the editing result of the element based on the attribute data after the trigger. The second thread renders and displays the edited element based on the editing result.
10. A data processing method, characterized in that, include: In response to a display command for the editing component, it is determined that attribute data of the editing component needs to be obtained; The editing component is used to edit elements after being triggered; The attribute data is used to display the editing component; A data acquisition task is created through a first thread; the data acquisition task includes one or more sub-tasks. The subtask is used to acquire sub-data; the sub-data is used to generate the attribute data of the editing component; The first thread calls the second thread to execute the data acquisition task, and the attribute data of the editing component is generated based on the sub-data corresponding to the sub-task returned by the second thread.
11. The method according to claim 10, characterized in that, The method further includes: In response to a trigger command for the element, the trigger command is used as the display command.
12. The method according to claim 10, characterized in that, The method further includes: The editing component is rendered and displayed via the first thread based on its attribute data.
13. A data processing apparatus, characterized in that, include: The first determining unit is configured to determine, in response to a trigger command for the editing component, that it is necessary to obtain the attribute data of the editing component after the trigger. The editing component is used to edit elements after being triggered; the attribute data after triggering is related to the editing result of the element; The first task creation unit is used to create a data acquisition task through a first thread; the data acquisition task includes one or more sub-tasks. The subtask is used to acquire sub-data; the sub-data is used to generate the attribute data after the trigger. The first data generation unit is used to call the second thread through the first thread to execute the data acquisition task, and generate the triggered attribute data according to the sub-data corresponding to the sub-task returned by the second thread.
14. A data processing apparatus, characterized in that, include: The second determining unit is used to determine, in response to a display instruction for the editing component, that attribute data of the editing component needs to be obtained; The editing component is used to edit elements after being triggered; The attribute data is used to display the editing component; The second task creation unit is used to create a data acquisition task through the first thread; the data acquisition task includes one or more sub-tasks. The subtask is used to acquire sub-data; the sub-data is used to generate the attribute data of the editing component; The second data generation unit is used to execute the data acquisition task by calling the second thread through the first thread, and generate the attribute data of the editing component according to the sub-data corresponding to the sub-task returned by the second thread.
15. An electronic device, characterized in that, include: processor; as well as, A memory configured to store computer-executable instructions, which, when executed, cause the processor to implement the method of any one of claims 1-9, or to implement the method of any one of claims 10-12.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store computer-executable instructions that, when executed by a processor, implement the method of any one of claims 1-9, or implement the method of any one of claims 10-12.
17. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-9, or implements the method described in any one of claims 10-12.
