CN-121979748-A - Script generation method, data processing method, data display method and device
Abstract
The method comprises the steps of responding to receiving a script editing instruction, displaying a script editing interface, wherein the script editing interface is provided with program codes for referring to function classes, the function classes comprise function functions for outputting data according to a preset first data format, responding to the input instruction of the program codes, and filling a data processing program meeting the data processing requirement in the script editing interface to obtain a data processing script. The method comprises the steps of receiving an operation instruction aiming at a data processing script, operating a data processing program in the data processing script, processing object data of a target object to obtain a data processing result, calling a function, and enabling the function to output the data processing result according to a preset first data format. And the unified management of the data processing result is facilitated.
Inventors
- LI YANQING
- LI JIFENG
- WANG JIAN
Assignees
- 北京有竹居网络技术有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20241030
Claims (20)
- 1. A script generation method, the method comprising: In response to receiving a script editing instruction, displaying a script editing interface, wherein the script editing interface is provided with program codes for referring to function classes, and the function classes comprise function functions for outputting data according to a preset first data format; and responding to an input instruction of the program code, filling a data processing program meeting the data processing requirement in the script editing interface, and obtaining a data processing script.
- 2. The method of claim 1, wherein exposing the script editing interface in response to receiving the script editing command comprises: In response to receiving a script running instruction for the first script, running the first script which is developed in advance to obtain a second script comprising the function; And in response to receiving a script editing command for the second script, exposing the script editing interface.
- 3. The method of claim 1, wherein the script editing interface further has instantiation parameters of the functional class therein, the method further comprising: And responding to a parameter value input instruction, assigning values to the instantiation parameters in the script editing interface according to data output requirements, or modifying parameter values of the instantiation parameters.
- 4. A method of data processing, the method comprising: Receiving an execution instruction for a data processing script, wherein the data processing script is generated based on the script generation method of any one of claims 1 to 3; running a data processing program in the data processing script, and processing object data of a target object to obtain a data processing result; And calling the function to enable the function to output the data processing result according to a preset first data format.
- 5. The method of claim 4, wherein the calling the function to cause the function to output the data processing result according to a preset first data format comprises: And when the data processing result represents that the target object is abnormal, calling the function, so that the function outputs the data processing result according to a first data format corresponding to the abnormal level of the target object.
- 6. The method of claim 4, wherein the calling the function to cause the function to output the data processing result according to a preset first data format comprises: And when the data processing result represents that the target object is abnormal, calling the function, so that the function outputs alarm information comprising the data processing result according to a preset first data format.
- 7. The method of claim 4, wherein at least some of the function functions are further configured to, upon invocation of the function functions, perform the following operations: acquiring operation attributes of data output operation, wherein the operation attributes represent whether the operation of outputting the data processing result is successfully executed or not; And taking the data processing result and the operation attribute as first log information, and storing the first log information according to a preset second data format.
- 8. The method of claim 4, wherein the same data processing result is allowed to be outputted a plurality of times; when at least part of the function functions are called, the function functions are further used for executing the following operations: acquiring a preset data output frequency, wherein the data output frequency represents the maximum number of times that the data processing result is allowed to be output within a preset duration; and outputting the data processing result in the case that the frequency at which the data processing result is output does not exceed the data output frequency.
- 9. The method of claim 4, wherein the function class has instantiation parameters; before running the data processing program, the method further comprises: acquiring an instantiation parameter value matched with a data output requirement; and executing an instantiation operation on the function class according to the instantiation parameter value, wherein the instantiation operation comprises assigning a value to the instantiation parameter by using the instantiation parameter value.
- 10. The method of claim 9, wherein the obtaining an instantiation parameter value matching a data output requirement comprises: Acquiring a first instantiation parameter value from a first data source and acquiring a second instantiation parameter value from a second data source, wherein the first data source is a data source obtained based on user configuration, and the second data source is a default data source; For any one of the instantiation parameters, if the parameter value of the instantiation parameter is obtained from both the first data source and the second data source, assigning a value to the instantiation parameter using the first instantiation parameter value obtained from the first data source.
- 11. The method of claim 9, wherein the data processing script is a script that requires timed execution, and wherein after performing an instantiation operation on the functional class, the method further comprises: Recording the running time of the data processing script; Taking the running time and script identification of the data processing script as second log information, and storing the second log information according to a preset third data format; The second log information is used for determining whether the operation of the data processing script is abnormal.
- 12. The method of claim 1, wherein during execution of the data processing script, the method further comprises: Recording operation information of one or more target operations executed in the running process of the data processing script; And taking the script identification of the operation information and the data processing script as third log information, and storing the third log information according to a preset fourth data format.
- 13. A method of data presentation, the method comprising: Obtaining target data stored in a preset data format from a data source, wherein the target data is obtained based on the data processing method according to any one of claims 4 to 12; and displaying the target data.
- 14. The method of claim 13, wherein after the target data is acquired, the method further comprises: Acquiring the running time of a data processing script from the target data; and determining whether the operation of the data processing script is abnormal or not based on the operation mode and the operation time of the data processing script.
- 15. A script generating apparatus, the apparatus comprising: The interface display module is used for displaying a script editing interface in response to receiving a script editing instruction, wherein the script editing interface is provided with program codes for referring to function classes, and the function classes comprise function functions for outputting data according to a preset first data format; And the program filling module is used for responding to the input instruction of the program code, filling a data processing program meeting the data processing requirement in the script editing interface, and obtaining a data processing script.
- 16. A data processing apparatus, the apparatus comprising: an instruction receiving module configured to receive an execution instruction for a data processing script generated based on the script generating method according to any one of claims 1 to 3; The program running module is used for running a data processing program in the data processing script and processing object data of the target object to obtain a data processing result; And the data output module is used for calling the function to enable the function to output the data processing result according to a preset first data format.
- 17. A data presentation device, the device comprising: a data acquisition module, configured to acquire target data stored in a preset data format from a data source, where the target data is obtained based on the data processing method according to any one of claims 4 to 12; and the data display module is used for displaying the target data.
- 18. An electronic device, comprising: A memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the script generating method of any one of claims 1 to 3, or to perform the data processing method of any one of claims 4 to 12, or to perform the data presentation method of any one of claims 13 to 14.
- 19. A computer-readable storage medium having stored thereon computer instructions for causing a computer to perform the script generation method of any of claims 1 to 3, or to perform the data processing method of any of claims 4 to 12, or to perform the data presentation method of any of claims 13 to 14.
- 20. A computer program product comprising computer instructions for causing a computer to perform the script generating method of any of claims 1 to 3, or to perform the data processing method of any of claims 4 to 12, or to perform the data presentation method of any of claims 13 to 14.
Description
Script generation method, data processing method, data display method and device Technical Field The disclosure relates to the technical field of software development, in particular to a script generation method, a data processing method, a data display method and a device. Background In many business scenarios, conventional data processing methods cannot meet diversified data processing requirements due to the complexity of the business types. For example, after obtaining the CPU utilization of a certain device at a plurality of time points in a period of time, the conventional data processing method determines the load size of the CPU based on the CPU utilization, but in the actual data processing requirement, it may also be required to determine the performance bottleneck of the CPU based on the CPU utilization. In order to solve the above problems, more and more customized scripts for performing data processing according to actual data processing requirements and outputting data processing results are presented. However, these customized scripts generally output data processing results according to respective data formats, which makes it difficult to uniformly manage the data processing results. Disclosure of Invention In view of this, the present disclosure provides a script generating method, a data processing method, a data displaying method, a script generating device, a data processing device, a data displaying device, an electronic device, a computer readable storage medium, and a computer program product, which can enable different data processing scripts to output data processing results according to a unified data format, thereby being beneficial to unified management of the data processing results. In a first aspect, the present disclosure provides a script generation method, the method comprising: In response to receiving a script editing instruction, displaying a script editing interface, wherein the script editing interface is provided with program codes for referring to function classes, and the function classes comprise function functions for outputting data according to a preset first data format; and responding to an input instruction of the program code, filling a data processing program meeting the data processing requirement in the script editing interface, and obtaining a data processing script. In a second aspect, the present disclosure provides a data processing method, the method comprising: receiving an operation instruction aiming at a data processing script, wherein the data processing script is generated based on the script generation method; running a data processing program in the data processing script, and processing object data of a target object to obtain a data processing result; And calling the function to enable the function to output the data processing result according to a preset first data format. In a third aspect, the present disclosure provides a data display method, the method comprising: Acquiring target data stored according to a preset data format from a data source, wherein the target data is obtained based on the data processing method; and displaying the target data. In a fourth aspect, the present disclosure provides a script generating apparatus, the apparatus comprising: The interface display module is used for displaying a script editing interface in response to receiving a script editing instruction, wherein the script editing interface is provided with program codes for referring to function classes, and the function classes comprise function functions for outputting data according to a preset first data format; And the program filling module is used for responding to the input instruction of the program code, filling a data processing program meeting the data processing requirement in the script editing interface, and obtaining a data processing script. In a fifth aspect, the present disclosure provides a data processing apparatus, the apparatus comprising: The instruction receiving module is used for receiving an operation instruction aiming at a data processing script, wherein the data processing script is generated based on the script generation method; The program running module is used for running a data processing program in the data processing script and processing object data of the target object to obtain a data processing result; And the data output module is used for calling the function to enable the function to output the data processing result according to a preset first data format. In a sixth aspect, the present disclosure provides a data presentation device, the device comprising: the data acquisition module is used for acquiring target data stored according to a preset data format from a data source, wherein the target data is obtained based on the data processing method; and the data display module is used for displaying the target data. In a seventh aspect, the present disclosure provides an electronic device, including a memo