Disclosure of Invention
The embodiment of the application provides a data processing method, a data processing device, data processing equipment and a storage medium of an application program, so that the aims of reducing compiling time consumption and improving packaging efficiency are fulfilled.
In a first aspect, an embodiment of the present application provides a data processing method for an application program, including:
reading the data of the target file of the application program through a read-write module;
determining a data processing flow corresponding to at least one independent plug-in, wherein the independent plug-in is a host plug-in or a first data processing plug-in which is not registered to the host plug-in;
according to the data processing flow corresponding to each independent plug-in, sequentially calling a first data processing plug-in or a second data processing plug-in corresponding to each data processing flow to perform data processing on the data of the target file, wherein the second data processing plug-in corresponding to the data processing flow is a plug-in registered to a host plug-in corresponding to the data processing program, and the data of the target file processed by the previous data processing flow is data to be processed by the next data processing flow;
and writing back the data of the target file processed by the last data processing flow through the read-write module.
The method provided by the embodiment of the application is used for the packaging process of the application program, and is a platform processing process, the reading and output codes of each data processing plug-in are independently packaged (corresponding to a reading and writing module), so that the data processing plug-in does not independently contain the reading and output codes any more, and only contains the processing codes required by processing files. The platform performs IO operation once, a certain plug-in (a first data processing plug-in or a second data processing plug-in) or certain plug-ins (second data processing plug-ins) correspond to a data processing flow, one data processing flow is completed, if the data processing flow exists subsequently, write-back can be performed without directly using the processed target file as the input of the next data processing flow, the problem of time consumption in compiling caused by multiple IO operations is avoided, and the packaging efficiency of the application program is improved. In addition, the data processing plug-in can independently correspond to one data processing flow, and a plurality of data processing plug-ins can be integrated into the host plug-in and executed in one data processing flow, so that the implementation mode is flexible, and the processing efficiency can be further improved by integrated processing.
On this basis, according to the data processing flow corresponding to the host plug-in, the implementation manner of calling the second data processing plug-in to perform data processing on the data of the target file may be: analyzing the data of the target file through an analysis module to obtain reference data; and sending the reference data to a second data processing plug-in, and calling the second data processing plug-in to process the data of the target file according to the reference data.
According to the method provided by the embodiment of the application, the analysis work of the data processing plug-in is further stripped, the analysis codes are independently packaged into the analysis module, the development difficulty of the plug-in is further simplified, and the data processing plug-in does not need to contain the analysis codes.
On this basis, the above-mentioned implementation manner of reading the data of the target file of the application program by the read-write module may be: and reading the data of the target file from the engineering catalog and jar catalog of the application program through the read-write module. Correspondingly, the data of the target file is analyzed by the analysis module to obtain the reference data, and the implementation manner may be: and respectively traversing the data of the target file read from the engineering directory and the data of the target file read from the jar directory through an analysis module to obtain reference data, wherein the reference data at least comprises class diagram data.
According to the method provided by the embodiment of the application, the data of the target files in the engineering directory and jar directory of the application program are read, the target files in the two directories are traversed, the complete class diagram data can be obtained through analysis, and the reliability of the processing process is improved.
On the basis of any of the above method embodiments, the registration manner of the second data processing plug-in with the host plug-in may be: and the second data processing plug-in adds the plug-in identification information of the plug-in to the plug-in set created by the host plug-in the access process. Correspondingly, the mode of calling the second data processing plug-in is as follows: and calling the second data processing plug-in according to the plug-in identification information stored in the plug-in set.
On the basis of any of the above method embodiments, the data processing flow corresponding to the first data processing plug-in is any of the following: and the user-defined data processing flow is the same as the data processing flow corresponding to the host plug-in.
The method provided by the embodiment of the application not only supports the data processing flow provided by the data processing plug-in using platform (namely the data processing flow corresponding to the host plug-in), but also supports the self-defined data processing flow, and improves the flexibility of data processing.
On the basis of any of the above method embodiments, at a predetermined callback time of a current data processing flow, a first data processing plug-in or a second data processing plug-in corresponding to a next data processing flow is triggered to perform plug-in initialization preparation.
On the basis of any of the above method embodiments, the storage path of each of the first data processing plug-in and the second data processing plug-in is different.
According to the method provided by the embodiment of the application, the storage paths of the data processing plug-ins are different, namely, code isolation is realized, maintenance and management of plug-in codes are facilitated, and coupling influence among the codes is avoided.
In a second aspect, an embodiment of the present application provides a data processing apparatus for an application program, including:
the control module is used for reading the data of the target file of the application program through the reading and writing module; determining a data processing flow corresponding to at least one independent plug-in, wherein the independent plug-in is a host plug-in or a first data processing plug-in which is not registered to the host plug-in; according to the data processing flow corresponding to each independent plug-in, sequentially calling a first data processing plug-in or a second data processing plug-in corresponding to each data processing flow to perform data processing on the data of the target file, wherein the second data processing plug-in corresponding to the data processing flow is a plug-in registered to a host plug-in corresponding to the data processing program, and the data of the target file processed by the previous data processing flow is data to be processed by the next data processing flow; writing back data of the target file processed by the last data processing flow through the read-write module;
and the read-write module is used for reading the target file of the application program and writing back the data of the target file processed by the last data processing flow.
The device provided by the embodiment of the application is used for the packaging process of the application program, and is a platform processing process, the reading and output codes of each data processing plug-in are independently packaged (corresponding to a reading and writing module), so that the data processing plug-in does not independently contain the reading and output codes any more, and only contains the processing codes required by processing files. The platform performs IO operation once, a certain plug-in (a first data processing plug-in or a second data processing plug-in) or certain plug-ins (second data processing plug-ins) correspond to a data processing flow, one data processing flow is completed, if the data processing flow exists subsequently, write-back can be performed without directly using the processed target file as the input of the next data processing flow, the problem of time consumption in compiling caused by multiple IO operations is avoided, and the packaging efficiency of the application program is improved. In addition, the data processing plug-in can independently correspond to one data processing flow, and a plurality of data processing plug-ins can be integrated into the host plug-in and executed in one data processing flow, so that the implementation mode is flexible, and the processing efficiency can be further improved by integrated processing.
On this basis, the control module calls the second data processing plug-in to perform data processing on the data of the target file according to the data processing flow corresponding to the host plug-in, and the implementation manner of the data processing on the data of the target file by the control module may be that: analyzing the data of the target file through an analysis module to obtain reference data; and sending the reference data to a second data processing plug-in, and calling the second data processing plug-in to process the data of the target file according to the reference data.
Correspondingly, the device provided by the embodiment of the application further comprises an analysis module for analyzing the data of the target file to obtain the reference data.
The device provided by the embodiment of the application further peels off the analysis work of the data processing plug-in, and the analysis codes are independently packaged into the analysis module, so that the development difficulty of the plug-in is further simplified, and the data processing plug-in does not need to contain the analysis codes.
On this basis, the control module may read the target file of the application program through the read-write module in the following manner: and reading the target file from the engineering catalog and jar catalog of the application program through the read-write module. Correspondingly, the control module analyzes the data of the target file through the analysis module to obtain the reference data, and the implementation manner of the control module may be as follows: and respectively traversing the data of the target file read from the engineering directory and the data of the target file read from the jar directory through an analysis module to obtain reference data, wherein the reference data at least comprises class diagram data.
The device provided by the embodiment of the application reads the data of the target files in the engineering directory and jar directory of the application program, and the data of the target files in the two directories are traversed to be analyzed to obtain complete class diagram data, so that the reliability of the processing process is improved.
On the basis of any of the above device embodiments, the method for registering the second data processing plug-in with the host plug-in may be: and the second data processing plug-in adds the plug-in identification information of the plug-in to the plug-in set created by the host plug-in the access process. Correspondingly, the mode that the control module calls the second data processing plug-in is as follows: and calling the second data processing plug-in according to the plug-in identification information stored in the plug-in set.
On the basis of any device embodiment, the data processing flow corresponding to the first data processing plug-in is any one of the following flows: and the user-defined data processing flow is the same as the data processing flow corresponding to the host plug-in.
The device provided by the embodiment of the application not only supports the data processing flow provided by the data processing plug-in using platform (namely the data processing flow corresponding to the host plug-in), but also supports the self-defined data processing flow, and improves the flexibility of data processing.
On the basis of any of the above embodiments of the apparatus, the control module may further trigger the first data processing plug-in or the second data processing plug-in corresponding to the next data processing flow to perform plug-in initialization preparation at a predetermined callback time of the current data processing flow.
On the basis of any of the above-described apparatus embodiments, the storage path of each of the first data processing plug-in and the second data processing plug-in is different.
According to the device provided by the embodiment of the application, the storage paths of the data processing plug-ins are different, namely, code isolation is realized, maintenance and management of plug-in codes are facilitated, and coupling influence among the codes is avoided.
In a third aspect, an embodiment of the present application further provides a computer device, including a processor and a memory;
the memory is used for storing programs for executing the methods of the various method embodiments; the processor is configured to execute programs stored in the memory.
The computer device provided by the embodiment of the application is used for the packaging process of the application program, and is a platform processing process, the reading and output codes of each data processing plug-in are independently packaged (corresponding to a reading and writing module), so that the data processing plug-in does not independently contain the reading and output codes any more, and only contains the processing codes required by processing files. The platform performs IO operation once, a certain plug-in (a first data processing plug-in or a second data processing plug-in) or certain plug-ins (second data processing plug-ins) correspond to a data processing flow, one data processing flow is completed, if the data processing flow exists subsequently, write-back can be performed without directly using the processed target file as the input of the next data processing flow, the problem of time consumption in compiling caused by multiple IO operations is avoided, and the packaging efficiency of the application program is improved. In addition, the data processing plug-in can independently correspond to one data processing flow, and a plurality of data processing plug-ins can be integrated into the host plug-in and executed in one data processing flow, so that the implementation mode is flexible, and the processing efficiency can be further improved by integrated processing.
In a fourth aspect, this application further provides a computer-readable storage medium storing a program for executing the method described in each embodiment of the first aspect.
The computer-readable storage medium provided by the embodiment of the application is used for the packaging process of the application, and for the platform processing process, the reading and output codes of each data processing plug-in are independently packaged (corresponding to a reading and writing module), so that the data processing plug-in does not separately contain the reading and output codes any more, and only contains the processing codes required by file processing. The platform performs IO operation once, a certain plug-in (a first data processing plug-in or a second data processing plug-in) or certain plug-ins (second data processing plug-ins) correspond to a data processing flow, one data processing flow is completed, if the data processing flow exists subsequently, write-back can be performed without directly using the processed target file as the input of the next data processing flow, the problem of time consumption in compiling caused by multiple IO operations is avoided, and the packaging efficiency of the application program is improved. In addition, the data processing plug-in can independently correspond to one data processing flow, and a plurality of data processing plug-ins can be integrated into the host plug-in and executed in one data processing flow, so that the implementation mode is flexible, and the processing efficiency can be further improved by integrated processing.
Detailed Description
In order to better understand the technical solutions described above, the technical solutions of the embodiments of the present application are described in detail below with reference to the drawings and the specific embodiments, and it should be understood that the specific features of the embodiments and the embodiments of the present application are detailed descriptions of the technical solutions of the embodiments of the present application, and are not limitations of the technical solutions of the present application, and the technical features of the embodiments and the embodiments of the present application may be combined with each other without conflict.
The embodiment of the application provides a platform plug-in running tool, common input and output codes of data processing plug-ins used in the application packaging process are independently packaged, and each data processing plug-in only needs to comprise a processing code corresponding to a target file. The tool can omit intermediate repeated read-write operation in the execution process of a plurality of data processing plug-ins, so that the plurality of plug-ins only need to be read once and input once all the time, and the packaging efficiency and the compiling speed of the application program are greatly improved.
The plug-in running tool provided by the embodiment of the application can only support data processing plug-ins of byte code (class) files, namely, a universal byte code processing tool is provided, and also can support data processing plug-ins of other files needing to be processed in the packaging process of the application program.
Correspondingly, the target file may refer to all or part of the bytecode file in the application program, and may also refer to other files that need to be processed.
The software architecture of the plug-in running tool provided by the embodiment of the present application is shown in fig. 1, and includes:
and the basic code library (common) comprises basic control logic (such as class diagram building logic, log generation logic and the like) of the tool and provides an adaptive interface for each data processing plug-in.
The read-write module (Transform Engine) is responsible for traversing the project and/or the android package of the application program, reading the target file (specifically, reading data of the target file), and writing back the processed target file (specifically, data of the processed target file) to the specified directory (which may be, but is not limited to, specified by the plug-in).
And the analysis module (ASM) is responsible for analyzing the data of the target file to obtain reference data (such as data required by data processing plug-ins like class diagrams).
Guava is a basic library that provides operational support for traversing files, reading files, writing files, etc.
And the host plug-in (Base-plug) does not contain processing codes, does not process the target file, and only provides a plug-in set for the registration of the data processing plug-in. By way of example and not limitation, a host plug-in creates an Extension object when accessing (appliance), which holds a collection of plug-ins.
The data processing plug-ins (PluginA, PluginB, PluginC, PluginD) implement the corresponding interfaces and the respective bytecode instrumentation logic. Each data processing plug-in is independently accessible and may be automatically integrated into the host plug-in or as a stand-alone plug-in as a matter of choice. The data processing plug-in is registered to the host plug-in the following implementation mode: in the access process, an Extension object created by the host plug-in is found, the plug-in object of the plug-in is added into a plug-in set held by the Extension object, and the registration of the host plug-in is completed.
And if the host plug-in cannot be found during the plug-in access, the plug-in is operated as an independent plug-in.
It should be noted that the above is only an exemplary illustration of the software framework of the plug-in running tool provided in the embodiments of the present application, and should not be taken as a limitation to the scope of the present application.
The plug-in operation tool provided by the embodiment of the application has the following characteristics:
1. code multiplexing: the common code sinks to the platform and is multiplexed for all the data processing plug-ins, so that each plug-in only needs to be dedicated to data processing and byte code instrumentation of the target file.
2. Code isolation between plug-ins, mutual decoupling: the codes of each data processing plug-in are respectively stored in a single module or project, are isolated from each other and are mutually independent, and the function expansion is facilitated later. Wherein, module and project are both directories.
3. The plug-in has strong portability: each data processing plug-in can be separated from the host plug-in, independently corresponds to a data first six flow and independently works.
The embodiment of the application provides a processing method of an application program, which can be, but is not limited to, an implementation method of a plug-in running tool shown in fig. 1. As shown in fig. 2, the method includes the following operations:
step 201, reading the data of the target file of the application program through the read-write module.
Reading refers to reading data of the target file from a disk into a memory.
Step 202, determining a data processing flow corresponding to at least one independent plug-in, wherein the independent plug-in is a host plug-in or a first data processing plug-in which is not registered to the host plug-in.
In the embodiment of the present application, a data processing plug-in registered on a host plug-in is referred to as a first data processing plug-in, and a data processing plug-in registered on the host plug-in is referred to as a second data processing plug-in.
In this embodiment of the present application, the data processing flow corresponding to the host plug-in is configured in advance, and there may be one host plug-in, or there may be two or even more host plug-ins, so that the data processing flow is configured for each host plug-in advance. If there is more than one host plug-in, then the host plug-in to be registered may be selected when the data processing plug-in is accessed.
In this embodiment of the application, the data processing flow corresponding to the first data processing plug-in is determined before the plug-in runs, for example, when the data processing plug-in accesses, if it is determined that the data processing plug-in is not registered in the host plug-in, the data processing flow is determined for the data processing plug-in, the plug-in may use the same data processing flow as the host plug-in, or may use a custom data processing flow, and in the accessing process, the configuration information of the custom data processing flow is uploaded.
In this step, the data processing flow is determined, specifically, by reading the configuration information of the data processing flow of each independent plug-in.
Step 203, according to the data processing flow corresponding to each independent plug-in, sequentially calling a first data processing plug-in or a second data processing plug-in corresponding to each data processing flow to perform data processing on the data of the target file, wherein the second data processing plug-in corresponding to the data processing flow is a plug-in registered to a host plug-in corresponding to the data processing program, and the data of the target file processed by the previous data processing flow is the data to be processed by the next data processing flow.
In this embodiment of the application, before step 203, a sequence of each data processing flow is configured, by way of example and not limitation, a data processing flow corresponding to a host plug-in is always configured as a first data processing flow, and in a data processing plug-in access process, if the data processing plug-in is an independent plug-in, a processing sequence is configured for the data processing flow corresponding to the data processing plug-in (generally configured according to a plug-in access sequence).
It should be noted that, since the data processing flows and the independent plug-ins have a one-to-one correspondence relationship, configuring the order of the data processing flows may also refer to configuring the call order of the independent plug-ins. The call to the host plug-in is actually a call to a second data processing plug-in registered to the host plug-in.
It should be noted that the data processing plug-ins registered on the host plug-in may be called in parallel or sequentially, and if called sequentially, the execution order may be configured for the plug-ins during the plug-in access process.
It should be noted that the "previous" and "next" data processing flows are relative concepts. In two data processing flows adjacent to each other in processing order, the data processing flow with the processing order before is the previous data processing flow, and the data processing flow with the processing order after is the next data processing flow.
It should be noted that, in practical applications, there is no strict timing relationship between step 202 and step 203. For example, the data processing flow corresponding to each of all independent plug-ins may be determined first, and then step 203 is performed; or, in the process of step 203, the data processing flow corresponding to each independent plug-in may be determined in sequence.
And step 204, writing back the data of the target file processed by the last data processing flow through the read-write module.
Write-back refers to writing back the target file to disk. It should be noted that to improve processing efficiency, write back may be performed only on modified data in the destination file.
The method provided by the embodiment of the application is used for the packaging process of the application program, and is a platform processing process, the reading and output codes of each data processing plug-in are independently packaged (corresponding to a reading and writing module), so that the data processing plug-in does not independently contain the reading and output codes any more, and only contains the processing codes required by processing files. The platform performs IO operation once, a certain plug-in (a first data processing plug-in or a second data processing plug-in) or certain plug-ins (second data processing plug-ins) correspond to a data processing flow, and one data processing flow is completed. In addition, the data processing plug-in can independently correspond to one data processing flow, and a plurality of data processing plug-ins can be integrated into the host plug-in and executed in one data processing flow, so that the implementation mode is flexible, and the processing efficiency can be further improved by integrated processing.
On this basis, according to the data processing flow corresponding to the host plug-in, the implementation manner of calling the second data processing plug-in to perform data processing on the target file may be: analyzing the data of the target file through an analysis module to obtain reference data; and sending the reference data to a second data processing plug-in, and calling the second data processing plug-in to process the data of the target file according to the reference data.
The embodiment of the present application does not limit the specific content of the reference data. In practical application, the required reference data can be determined according to requirements, and can be realized by utilizing the existing ASM framework.
According to the method provided by the embodiment of the application, the analysis work of the data processing plug-in is further stripped, the analysis codes are independently packaged into the analysis module, the development difficulty of the plug-in is further simplified, and the data processing plug-in does not need to contain the analysis codes.
It should be noted that the data processing flow corresponding to the host plug-in is described above only by way of a specific example. In practical application, a data processing flow corresponding to the host plug-in may be defined as needed, which is not limited in the embodiment of the present application.
On this basis, the above-mentioned implementation manner of reading the data of the target file of the application program by the read-write module may be: and reading the data of the target file from the engineering catalog and jar catalog of the application program through the read-write module. Correspondingly, the data of the target file is analyzed by the analysis module to obtain the reference data, and the implementation manner may be: and respectively traversing the data of the target file read from the engineering directory and the data of the target file read from the jar directory through an analysis module to obtain reference data, wherein the reference data at least comprises class diagram data.
According to the method provided by the embodiment of the application, the data of the target files in the engineering directory and jar directory of the application program are read, the target files in the two directories are traversed, the complete class diagram data can be obtained through analysis, and the reliability of the processing process is improved.
On the basis of any of the above method embodiments, the registration manner of the second data processing plug-in with the host plug-in may be: and the second data processing plug-in adds the plug-in identification information of the plug-in to the plug-in set created by the host plug-in the access process. For a specific implementation manner, reference may be made to the description of the above embodiments, which is not described herein again. Correspondingly, the mode of calling the second data processing plug-in is as follows: and calling the second data processing plug-in according to the plug-in identification information stored in the plug-in set. The identification information may refer to, but is not limited to, a plug-in object.
On the basis of any of the above method embodiments, the data processing flow corresponding to the first data processing plug-in is any of the following: and the user-defined data processing flow is the same as the data processing flow corresponding to the host plug-in.
The method provided by the embodiment of the application not only supports the data processing flow provided by the data processing plug-in using platform (namely the data processing flow corresponding to the host plug-in), but also supports the self-defined data processing flow, and improves the flexibility of data processing.
On the basis of any of the above method embodiments, at a predetermined callback time of a current data processing flow, a first data processing plug-in or a second data processing plug-in corresponding to a next data processing flow is triggered to perform plug-in initialization preparation.
On the basis of any of the above method embodiments, the storage path of each of the first data processing plug-in and the second data processing plug-in is different.
According to the method provided by the embodiment of the application, the storage paths of the data processing plug-ins are different, namely, code isolation is realized, maintenance and management of plug-in codes are facilitated, and coupling influence among the codes is avoided.
The method provided by the embodiment of the present application is described below with reference to the software system architecture shown in fig. 1.
When the plug-in running tool shown in fig. 1 is run, the basic code library depends on Transform Engine, all class files are read from the input jars and directories concurrently by using a Transform api (processing interface) provided by android gradient Plugin, the class files are distributed to the data processing plug-ins registered to the host plug-ins one by one for processing, and after the processing is completed, the class files are output in a unified manner. The whole Transform process only has one read-write process, so that the IO read-write times of independent Transform are reduced.
In the process of processing the class file, the class file is analyzed by the ASM, and the plug-in can read and write the class file by using a director api or a tree api, that is, the read and write operations can be performed on the class file by registering a ClassVisitor or directly operating a classdode.
The plug-in processing tool defaults to at least one conventional processing process (MainProcess) on the Class file, and comprises the following steps:
the reverse process: traversing all data of the constructed products (generally class files) in one project, and performing traversal analysis only without modifying the data of the input files;
the transverseandroidjar process: traversing all class file data in android.
3. The last step, transform: and traversing all the constructed products in the project again, and processing and outputting the data of the class file (wherein the data can be directly written back to the local or can be used as the input of the next data processing flow).
It can be seen that, in one conventional process, the data of all class files in the engineering construction is traversed twice. In fact, such a process is abstracted into a TransformFlow (data processing flow), and a developer can customize the TransformFlow to customize the processing steps of the workflow (e.g., multiple transitions, or only a transform without a transition, etc.).
The process of processing all the constructs (typically class files) is defined as one TransformFlow. A data processing plug-in may use a separate TransformFlow independently, or may pick up a vehicle to a global data processing flow (MainTransformFlow, transform, transseandroidjar, transform forms a MainTransformFlow).
Assume that four data processing plugins are assumed to be accessed to the plugin processing tool shown in fig. 1, wherein, PluginA a and PluginA b are registered to the host plugins, PluginC and PluginD d are independent plugins, PluginC is configured to use MainTransformFlow, and PluginD is configured to use custom data processing flow (Abs TransformFlow).
After the Common reads the data of all class files in the project and jar through the Transform Engine, the MainTransform flow corresponding to the host plug-in is executed firstly, that is: the transverse process, the transverseandroid jar process, and transform. In the process, PluginA and PluginB are called to process the data of the class file.
Wherein, the transform output in the MainTransformFlow corresponding to the host plug-in is used as the input of the MainTransformFlow corresponding to the PluginC.
And calling PluginC to process the class file in the MainTransformFlow corresponding to the PluginC. Its transform output serves as the input to the Abs TransformFlow.
In Abs TransformFlow, plug d is called to process the class file. And the transform output of the class file is written back to the class file.
In each data processing flow, callback opportunities are pre-configured, e.g., before or after Transform. And at the time of callback, notifying a data processing plug-in corresponding to the next data processing flow to carry out initialization preparation.
Therefore, in the processing process, only the output of 'write back' is to operate the disk through the IO interface, and the input and output between the two data processing flows do not pass through the IO interface and do not operate the disk, so that processing delay is not caused.
Based on the same inventive concept as the method, an embodiment of the present application provides a data processing apparatus for an application program, as shown in fig. 4, including:
the control module 401 is configured to read data of a target file of an application program through the read-write module; determining a data processing flow corresponding to at least one independent plug-in, wherein the independent plug-in is a host plug-in or a first data processing plug-in which is not registered to the host plug-in; according to the data processing flow corresponding to each independent plug-in, sequentially calling a first data processing plug-in or a second data processing plug-in corresponding to each data processing flow to perform data processing on the data of the target file, wherein the second data processing plug-in corresponding to the data processing flow is a plug-in registered to a host plug-in corresponding to the data processing program, and the data of the target file processed by the previous data processing flow is data to be processed by the next data processing flow; writing back data of the target file processed by the last data processing flow through the read-write module;
the read-write module 402 is configured to read data of a target file of an application program, and write back data of the target file processed by the last data processing flow.
The device provided by the embodiment of the application is used for the packaging process of the application program, and is a platform processing process, the reading and output codes of each data processing plug-in are independently packaged (corresponding to a reading and writing module), so that the data processing plug-in does not independently contain the reading and output codes any more, and only contains the processing codes required by processing files. The platform performs IO operation once, a certain plug-in (a first data processing plug-in or a second data processing plug-in) or certain plug-ins (second data processing plug-ins) correspond to a data processing flow, one data processing flow is completed, if the data processing flow exists subsequently, write-back can be performed without directly using the processed target file as the input of the next data processing flow, the problem of time consumption in compiling caused by multiple IO operations is avoided, and the packaging efficiency of the application program is improved. In addition, the data processing plug-in can independently correspond to one data processing flow, and a plurality of data processing plug-ins can be integrated into the host plug-in and executed in one data processing flow, so that the implementation mode is flexible, and the processing efficiency can be further improved by integrated processing.
On this basis, the control module calls the second data processing plug-in to perform data processing on the data of the target file according to the data processing flow corresponding to the host plug-in, and the implementation manner of the data processing on the data of the target file by the control module may be that: analyzing the data of the target file through an analysis module to obtain reference data; and sending the reference data to a second data processing plug-in, and calling the second data processing plug-in to process the data of the target file according to the reference data.
Correspondingly, the device provided by the embodiment of the application further comprises an analysis module for analyzing the data of the target file to obtain the reference data.
The device provided by the embodiment of the application further peels off the analysis work of the data processing plug-in, and the analysis codes are independently packaged into the analysis module, so that the development difficulty of the plug-in is further simplified, and the data processing plug-in does not need to contain the analysis codes.
On this basis, the implementation manner of reading the data of the target file of the application program by the control module through the read-write module may be as follows: and reading the data of the target file from the engineering catalog and jar catalog of the application program through the read-write module. Correspondingly, the control module analyzes the data of the target file through the analysis module to obtain the reference data, and the implementation manner of the control module may be as follows: and respectively traversing the data of the target file read from the engineering directory and the data of the target file read from the jar directory through an analysis module to obtain reference data, wherein the reference data at least comprises class diagram data.
The device provided by the embodiment of the application reads the data of the target files in the engineering directory and jar directory of the application program, and the data of the target files in the two directories are traversed to be analyzed to obtain complete class diagram data, so that the reliability of the processing process is improved.
On the basis of any of the above device embodiments, the method for registering the second data processing plug-in with the host plug-in may be: and the second data processing plug-in adds the plug-in identification information of the plug-in to the plug-in set created by the host plug-in the access process. Correspondingly, the mode that the control module calls the second data processing plug-in is as follows: and calling the second data processing plug-in according to the plug-in identification information stored in the plug-in set.
On the basis of any device embodiment, the data processing flow corresponding to the first data processing plug-in is any one of the following flows: and the user-defined data processing flow is the same as the data processing flow corresponding to the host plug-in.
The device provided by the embodiment of the application not only supports the data processing flow provided by the data processing plug-in using platform (namely the data processing flow corresponding to the host plug-in), but also supports the self-defined data processing flow, and improves the flexibility of data processing.
On the basis of any of the above embodiments of the apparatus, the control module may further trigger the first data processing plug-in or the second data processing plug-in corresponding to the next data processing flow to perform plug-in initialization preparation at a predetermined callback time of the current data processing flow.
On the basis of any of the above-described apparatus embodiments, the storage path of each of the first data processing plug-in and the second data processing plug-in is different.
According to the device provided by the embodiment of the application, the storage paths of the data processing plug-ins are different, namely, code isolation is realized, maintenance and management of plug-in codes are facilitated, and coupling influence among the codes is avoided.
Based on the same inventive concept as the method, the embodiment of the application provides computer equipment, which comprises a processor and a memory; the memory is used for storing programs for executing the methods of the various method embodiments; the processor is configured to execute programs stored in the memory.
The computer device provided by the embodiment of the application is used for the packaging process of the application program, and is a platform processing process, the reading and output codes of each data processing plug-in are independently packaged (corresponding to a reading and writing module), so that the data processing plug-in does not independently contain the reading and output codes any more, and only contains the processing codes required by processing files. The platform performs IO operation once, a certain plug-in (a first data processing plug-in or a second data processing plug-in) or certain plug-ins (second data processing plug-ins) correspond to a data processing flow, one data processing flow is completed, if the data processing flow exists subsequently, write-back can be performed without directly using the processed target file as the input of the next data processing flow, the problem of time consumption in compiling caused by multiple IO operations is avoided, and the packaging efficiency of the application program is improved. In addition, the data processing plug-in can independently correspond to one data processing flow, and a plurality of data processing plug-ins can be integrated into the host plug-in and executed in one data processing flow, so that the implementation mode is flexible, and the processing efficiency can be further improved by integrated processing.
Fig. 3 is a block diagram illustrating a partial structure of a computer device related to an embodiment of a method provided by the embodiment of the present application. Referring to fig. 3, the computer apparatus includes:
the power supply is logically connected with the central processing unit through the power supply management system, so that the functions of managing charging, discharging, power consumption management and the like are realized through the power supply management system; the mainboard is used for providing an electric connection path among the components, each component is used for carrying out electric signal transmission through the mainboard, and each component is arranged on the mainboard in a plugging way, a welding way and the like; a central processing Unit (cpu), which mainly includes an Arithmetic Logic Unit (ALU), a Program Counter (PC), a register set, a Cache memory (Cache), and a Bus (Bus) interface for transmitting data, control, and status; the internal memory, the magnetic disk (i.e. the above-mentioned memory storing the program for executing the method described in each method embodiment), the input unit (including mouse, keyboard, touch panel, etc.), the display unit (including display and display card), and the network card exchange data with the central processing unit through the bus.
The program and the related data for executing the method according to the embodiments of the method are first read from the magnetic disk into the internal memory, and the central processing unit reads and loads the program from the internal memory.
Those skilled in the art will appreciate that the computer device configuration illustrated in FIG. 3 does not constitute a limitation of computer devices, and may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components.
Based on the same inventive concept as the method, embodiments of the present application provide a computer-readable storage medium storing a program for executing the method according to each embodiment of the first aspect.
The computer-readable storage medium provided by the embodiment of the application is used for the packaging process of the application, and for the platform processing process, the reading and output codes of each data processing plug-in are independently packaged (corresponding to the reading and writing module), so that the data processing plug-in does not independently contain the reading and output codes any more, and only contains the processing codes required by file processing. The platform performs IO operation once, a certain plug-in (a first data processing plug-in or a second data processing plug-in) or certain plug-ins (second data processing plug-ins) correspond to a data processing flow, one data processing flow is completed, if the data processing flow exists subsequently, write-back can be performed without directly using the processed target file as the input of the next data processing flow, the problem of time consumption in compiling caused by multiple IO operations is avoided, and the packaging efficiency of the application program is improved. In addition, the data processing plug-in can independently correspond to one data processing flow, and a plurality of data processing plug-ins can be integrated into the host plug-in and executed in one data processing flow, so that the implementation mode is flexible, and the processing efficiency can be further improved by integrated processing.
The description has been presented with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the description. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may 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 means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present specification have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all changes and modifications that fall within the scope of the specification.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present specification without departing from the spirit and scope of the specification. Thus, if such modifications and variations of the present specification fall within the scope of the claims of the present specification and their equivalents, the specification is intended to include such modifications and variations.