Data processing method, device, electronic device and storage medium

By generating object program syntax tree and determining target dependency data, the problem of difficulty in deeply mining the interdependence between data in the prior art is solved, data processing efficiency and maintainability are improved, and data performance optimization is achieved.

CN114115901BActive Publication Date: 2025-05-02BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111422597.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-26
Publication Date
2025-05-02
Estimated Expiration
2041-11-26

AI Technical Summary

Technical Problem

The existing technology is difficult to deeply mine the interdependence between data, resulting in low data processing efficiency, unable to support the rationality of data design, and affecting the research and development efficiency of front-end applications.

Method used

By obtaining the object program file of the pending object, generating the object program syntax tree, and determining the target dependency data based on the syntax tree, thereby deeply mining the interdependence between the data.

Benefits of technology

It improves the efficiency and maintainability of data processing, realizes data performance optimization, and improves the data development efficiency and maintainability of front-end applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114115901B_ABST
    Figure CN114115901B_ABST
Patent Text Reader

Abstract

The present disclosure provides a data processing method, device, electronic device and storage medium, which relates to the field of data processing technology, and further to data mining and data analysis technology. The method includes: obtaining an object program file of an object to be processed; generating an object program syntax tree of the object to be processed according to the object program file; and determining target dependency data of the object to be processed according to the object program syntax tree. The embodiments of the present disclosure can deeply mine the interdependencies between data, thereby improving the efficiency and maintainability of data processing, and further realizing data performance optimization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data processing technology, and in particular to data mining and data analysis technology. Background Art

[0002] Data is a form of expression of facts, concepts or instructions, which can be processed by manual or automated devices. Data processing is the collection, storage, retrieval, processing, transformation and transmission of data. How to use computer means to process data of complex factors to explore the interdependencies between data is a topic of focus in the field of data mining and data analysis technology. Summary of the invention

[0003] The embodiments of the present disclosure provide a data processing method, device, electronic device and storage medium, which can deeply mine the interdependence between data, thereby improving the efficiency and maintainability of data processing, and further achieving data performance optimization.

[0004] In a first aspect, an embodiment of the present disclosure provides a data processing method, including:

[0005] Obtaining the object program file of the object to be processed;

[0006] Generate an object program syntax tree of the object to be processed according to the object program file;

[0007] The target dependency data of the object to be processed is determined according to the object program syntax tree.

[0008] In a second aspect, an embodiment of the present disclosure provides a data processing device, including:

[0009] An object program file acquisition module is used to acquire the object program file of the object to be processed;

[0010] An object program syntax tree generation module, used for generating an object program syntax tree of the object to be processed according to the object program file;

[0011] The target dependency data determination module is used to determine the target dependency data of the object to be processed according to the object program syntax tree.

[0012] In a third aspect, an embodiment of the present disclosure provides an electronic device, including:

[0013] at least one processor; and

[0014] a memory communicatively connected to the at least one processor; wherein,

[0015] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the data processing method provided by the embodiment of the first aspect.

[0016] In a fourth aspect, an embodiment of the present disclosure further provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the data processing method provided in the embodiment of the first aspect.

[0017] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, including a computer program, which implements the data processing method provided in the embodiment of the first aspect when executed by a processor.

[0018] The disclosed embodiment generates an object program syntax tree of the object to be processed based on the acquired object program file of the object to be processed, and then determines the target dependency data of the object to be processed based on the object program syntax tree, thereby solving the problem of low data processing efficiency caused by the inability to deeply mine the interdependencies between data when performing data analysis on the object. The embodiment of the present invention can deeply mine the interdependencies between data, thereby improving the efficiency of data processing.

[0019] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.

[0021] Figure 1 is a flow chart of a data processing method provided by an embodiment of the present disclosure;

[0022] Figure 2 is a flow chart of a data processing method provided by an embodiment of the present disclosure;

[0023] Figure 3 It is a partial structural diagram of an object program syntax tree provided by an embodiment of the present disclosure;

[0024] Figure 4 It is a subscription relationship diagram of part of the data of a front-end application provided by an embodiment of the present disclosure;

[0025] Figure 5 It is an update relationship diagram of part of the data of a front-end application provided by an embodiment of the present disclosure;

[0026] Figure 6It is a dependency diagram of part of the data of a front-end application provided by an embodiment of the present disclosure;

[0027] Figure 7 is a structural diagram of a data processing device provided by an embodiment of the present disclosure;

[0028] Figure 8 It is a schematic diagram of the structure of an electronic device used to implement the data processing method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0029] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.

[0030] In the prior art, when processing the relevant data of an object, it is often only possible to track and analyze the single data of the object, and it is often difficult to deeply explore the correlation between the data, which to a certain extent hinders the benign nature of the object.

[0031] Taking front-end applications as an example, currently popular modern front-end applications such as React (a JAVASCRIPT library for building user interfaces) and Vue (a progressive framework for building user interfaces) are all based on the MVVM (Model-View-ViewModel) framework. By adopting a data-driven approach, the details of view changes are hidden, allowing developers to focus on processing related to data changes without having to worry about the details of view changes and updates. In this context, data solution design is particularly important. Data declaration, update, subscription and the relationship between data are not only related to the management and maintenance of application status, but also to the module design and problem location of subsequent front-end applications.

[0032] However, existing front-end development tools mainly track and analyze individual data of the program, specifically processing and analyzing the data changes during the operation of the application, such as the reasons for the data changes, the values ​​of the data after the changes, and the direction of data transmission, etc. This data processing method cannot effectively mine the relationship between data updates and subscriptions, and cannot support the rationality of data analysis design, thus affecting the development efficiency of front-end applications.

[0033] Some data analysis of front-end applications only processes and analyzes the data within a single module, mainly focusing on the application relationship between modules. On the basis of analyzing the reference relationship between modules, the data transmission relationship between modules with reference relationships and the data in specific modules are further analyzed. This data processing and analysis method is limited to the data within a single module and the relationship between modules. It does not involve the interdependence between data across modules and the consumption relationship of data. Therefore, this data processing method based on modules is still difficult to effectively and deeply mine the relationship between data, and cannot support the rationality of data analysis design, thus affecting the R&D efficiency of front-end applications.

[0034] In one example, Figure 1 is a flow chart of a data processing method provided by an embodiment of the present disclosure. This embodiment can be applied to the case where the constructed syntax tree is used to deeply mine data with dependencies between objects to be processed. The method can be executed by a data processing device, which can be implemented by software and / or hardware and can generally be integrated in an electronic device. The electronic device can be a terminal device or a server device. The embodiment of the present disclosure does not limit the specific device type of the electronic device. Accordingly, Figure 1 As shown, the method includes the following operations:

[0035] S110, obtaining the object program file of the object to be processed.

[0036] The object to be processed can be an object that needs to deeply mine the data relationship. The object to be processed can be constructed by data and corresponding syntax. The data constituting the object to be processed can complete various functions of the object to be processed through certain syntax logic. The object to be processed can manage and control data in modules (also called files).

[0037] Exemplarily, the object to be processed may be various types of APP (Application), web (World Wide Web) applications, or other types of platforms or systems. As long as it is developed through IT (Internet Technology), the embodiments of the present disclosure do not limit the specific type of the object to be processed.

[0038] The object program file may be a program code file for implementing the corresponding functions of the object to be processed. For example, when the object to be processed is a front-end application, the corresponding object program file may be a system file of the front-end application, and the system file may include but is not limited to files of the types of JS (JavaScript, a programming language for the Web), HTML (Hyper Text Markup Language), and CSS (Cascading Style Sheets).

[0039] It is understandable that an object to be processed needs to complete certain functions based on the developed object program file, and the object program file includes all the associated data of the object to be processed. Therefore, before processing the data of the object to be processed, the object program file of the object to be processed can be obtained first, so as to process the data of the object to be processed according to the object program file of the object to be processed.

[0040] S120: Generate an object program syntax tree of the object to be processed according to the object program file.

[0041] The object program syntax tree may be a syntax tree constructed based on data included in the object program file and syntax between the data.

[0042] In order to sort out and layout the data of the object to be processed according to the syntax logic of the object program file, in the embodiment of the present disclosure, after the object program file of the object to be processed is obtained, an object program syntax tree of the object to be processed can be generated according to the object program file. The tree nodes of the object program syntax tree can be data or syntax identifiers in the object program file, such as identifiers of logical operations, etc., and the edges of the object program syntax tree can be used to specify the syntax relationship of the tree nodes.

[0043] The object program syntax tree can convert the object program file of the object to be processed into an intermediate structured representation form that is easy to process. Specifically, it can reflect the derivation process or execution process of the object program file. Each step of the node growth process can correspond to a command line operation in the object program file. It can be seen that the object program syntax tree is actually a deformed structure of the object program file, which can reflect the structural relationship between the data in the entire object to be processed.

[0044] S130. Determine target dependency data of the object to be processed according to the object program syntax tree.

[0045] Among them, the target dependent data can be data that have a mutual relationship in the object to be processed, and the mutual relationship can be a dependency relationship, such as a subscription relationship between data or an update relationship between data, etc. The embodiment of the present disclosure does not limit the type of dependency relationship existing in the target dependent data.

[0046] Since the object program syntax tree can reflect the structural relationship between the data in the entire object to be processed, after generating the object program syntax tree of the object to be processed according to the object program file, it can be parsed according to the object program syntax tree corresponding to the object to be processed, so as to determine the target dependent data of the object to be processed according to the parsing result of the object program syntax tree.

[0047] It can be understood that by determining the target dependent data of the object to be processed based on the object program syntax tree, the data of the object to be processed can be processed from a global perspective. That is, the data processing method provided by the embodiment of the present disclosure no longer processes the data of the object to be processed in units of modules, and can deeply explore the interdependencies between the various data of the object to be processed, including but not limited to the reference relationship between modules and the interdependencies between data across modules and the consumption relationship of data.

[0048] It can be seen that the object program syntax tree of the object to be processed generated based on the object program file can determine the target dependency data of the object to be processed from a global perspective, and can achieve in-depth mining and processing of the data of the objects to be processed that have mutual relationships. The target dependency data obtained by the above data processing method can intuitively display the layout of all data in the object to be processed, so as to further locate the rationality of the data design, thereby improving the rationality of the data planning of the object to be processed, the reuse value and maintainability of the data, and then improving the efficiency of data processing for the object to be processed. At the same time, the target dependency data obtained based on global mining can also achieve data performance optimization.

[0049] For example, taking the front-end application as an example, the unreasonable data of the front-end application can be determined based on the target dependency data of the front-end application, so as to redesign the unreasonable data, avoid determining unreasonable data based on the running status of the front-end application after the trial operation or formal launch of the front-end application, and reduce the data processing time of the front-end application, which can not only improve the data development efficiency of the front-end application, but also improve the maintainability of its data. At the same time, the data that can be further refined and optimized can be determined based on the target dependency data of the front-end application, so as to achieve performance optimization of the data of the front-end application.

[0050] It should be noted that in addition to using the object program syntax tree to perform static analysis and processing on the data of the object to be processed, dynamic plugging technology can also be used to dynamically analyze and process the data with interdependent relationships between the objects to be processed when the objects to be processed are in operation. It should be noted that the dynamic processing method depends on the operation status and operation depth of the object to be processed, and manual intervention may be required during the data analysis and processing process, which results in a high cost for data analysis and processing.

[0051] The disclosed embodiment generates an object program syntax tree of the object to be processed according to the acquired object program file of the object to be processed, and then determines the target dependency data of the object to be processed according to the object program syntax tree, thereby solving the problem of low data processing efficiency caused by the inability to deeply mine the interdependencies between data when performing data analysis on the object. The embodiment of the present invention can deeply mine the interdependencies between data, thereby improving the efficiency and maintainability of data processing, and further achieving data performance optimization.

[0052] In one example, Figure 2 It is a flow chart of a data processing method provided by an embodiment of the present disclosure. Based on the technical solutions of the above-mentioned embodiments, the embodiment of the present disclosure has been optimized and improved, and provides a plurality of specific optional implementation methods for generating an object program syntax tree of the object to be processed according to the object program file, and determining the target dependency data of the object to be processed according to the object program syntax tree.

[0053] like Figure 2 A data processing method shown includes:

[0054] S210: Obtain the object program file of the object to be processed.

[0055] In an optional embodiment of the present disclosure, the object to be processed may include a front-end application.

[0056] S220: Parse the object program file to obtain program command line data of the object program file and grammatical structure information between the program command line data.

[0057] The program command line data may be data included in each line of program instructions in the object program file. The grammatical structure information is the grammatical structure between each program command line data in each line of program instructions.

[0058] Specifically, when generating the object program syntax tree of the object to be processed, the object program file of the object to be processed can be parsed, for example, each line of program instructions in the object program file can be parsed to obtain the program command line data included in each line of program instructions and the grammatical structure information between the program command line data.

[0059] For example, assuming that the object to be processed is a front-end application, and a line of program instructions in the object program file of the front-end application is "C=A+B", then by parsing the lines of program instructions, the program command line data of the lines of program instructions can be obtained: C, A and B, and the grammatical structure information between the lines of program command line data: C is obtained by summing A and B.

[0060] S230: Determine a target structure syntax tree of the object program syntax tree.

[0061] The target structure syntax tree may be a certain tree structure syntax tree type used to construct the object program syntax tree.

[0062] S240: Reorganize the program command line data and the grammatical structure information between the program command line data according to the target structure grammar tree to obtain the object program grammar tree.

[0063] In the disclosed embodiments, the object program syntax tree of the object to be processed can be generated according to syntax trees of different structures. Exemplarily, AST (Abstract Syntax Tree) can be used as the target structure syntax tree, or a specific syntax tree can be used as the target structure syntax tree, etc., which is not limited by the disclosed embodiments. Among them, the abstract syntax tree can remove irrelevant details such as spaces, and only focus on the hierarchical structure of the program, and the data content and syntax representation are more accurate. Therefore, it is preferred to use an abstract syntax tree as the target structure syntax tree. Optionally, the tree structure of the target structure syntax tree can be various available tree structure types such as binary trees or mind maps, and the disclosed embodiments do not limit the tree structure type of the target structure syntax tree. It can be understood that in the initial state, the values ​​of each tree node of the target structure syntax tree are empty.

[0064] It is understandable that syntax trees include many different types, so a target structure syntax tree can be selected to construct the object program syntax tree of the object to be processed. After determining the target structure syntax tree of the object program syntax tree, the syntax structure information between the parsed program command line data and the program command line data can be reorganized and assigned to each tree node matching in the target structure syntax tree, thereby obtaining the final object program syntax tree.

[0065] In an optional embodiment of the present disclosure, the reorganizing the program command line data and the grammatical structure information between the program command line data according to the target structure syntax tree to obtain the object program syntax tree may include: determining the target position nodes of the program command line data and the grammatical structure information in the target structure syntax tree according to the grammatical structure information between the program command line data; and placing the program command line data and the grammatical structure information in matching target position nodes respectively to obtain the object program syntax tree.

[0066] The target position node is the tree node where the program command line data or syntax structure information matches and is assigned a value in the target structure syntax tree.

[0067] Specifically, the target position nodes of each program command line data and the corresponding grammatical structure information in the target structure syntax tree can be determined according to the grammatical structure information between the program command line data, so that each program command line data and the corresponding grammatical structure information are placed in the matching target position nodes respectively, so as to realize the assignment of the tree nodes of the target structure syntax tree. When the program command line data and the corresponding grammatical structure information of all command lines of the object program file are assigned to the target position nodes of the target structure syntax tree, the complete object program syntax tree of the object to be processed can be obtained.

[0068] Figure 3 : is a partial structural diagram of an object program syntax tree provided by an embodiment of the present disclosure. In a specific example, assuming that a line of program instructions in an object program file is "C = A + B", the structure of the object program syntax tree generated after parsing the line of program instructions is as follows: Figure 3 shown.

[0069] The above technical scheme generates an object program syntax tree by selecting a target structure syntax tree to parse the program command line data and syntax structure information obtained from the object program file, which can realize the abstract and structured representation of the object program file of the object to be processed, and realize the re-layout and combing of all data of the object to be processed, which is conducive to quickly locating data with interdependent relationships among the objects to be processed.

[0070] S250: traverse the object program syntax tree to obtain benchmark global data of the object to be processed.

[0071] The reference global data may be external variable data having a global force on the object to be processed.

[0072] The benchmark global data may have a mutual dependency relationship with other data, such as the internal data of the module of the object to be processed. For example, a module subscribes to one of the benchmark global data, or data A of a module is benchmark global data A, that is, there is an update relationship between the module and benchmark global data A, and data A of the module needs to synchronize the update operation of benchmark global data A. There is usually no mutual dependency relationship between the data inside the module of the object to be processed. Since the object program syntax tree can include all the data in the object program file of the object to be processed, the benchmark global data in the object program file of the object to be processed can be obtained by traversing the object program syntax tree.

[0073] In an optional embodiment of the present disclosure, traversing the object program syntax tree to obtain the benchmark global data of the object to be processed may include: traversing the object program syntax tree to obtain the data container creation method included in the object program syntax tree; obtaining the data container created by the data container creation method; and determining the data stored in the data container as the benchmark global data of the object to be processed.

[0074] The data container creation method may be a method for creating a data container. The data container may be used to separately manage the benchmark global data of the object to be processed. The number of data containers may be one or more, and may be specifically divided according to the system function of the object to be processed, which is not limited in the embodiments of the present disclosure.

[0075] Normally, the object to be processed will uniformly manage and control its baseline global data. A data storage object that uniformly manages and controls its baseline global data can be called a data container. Taking the front-end application as an example, assuming that the front-end application adopts the Redux (an application data flow framework) framework, Redux can use the method of creating a store object to establish a data container to uniformly manage the baseline global data of the front-end application. Assuming that the front-end application adopts the Recoil (an open source state management library) framework, Recoil can use the method of creating an atom object to establish a data container to uniformly manage the baseline global data of the front-end application. Assuming that the front-end application adopts the Mobx (a state management tool) framework, Mobx can use the method of creating a Class observable object to establish a data container to uniformly manage the baseline global data of the front-end application.

[0076] Therefore, when obtaining the benchmark global data of the object to be processed according to the object program syntax tree, all data container creation methods included in the object program syntax tree can be traversed, and the data container created by the data container creation method can be obtained, that is, the return value of the data container creation method is obtained to obtain the data container created by the data container creation method, thereby determining the data stored in the data container as the benchmark global data of the object to be processed.

[0077] For example, take the front-end application as an example, assuming that the front-end application adopts the Redux framework, Redux creates a data container through the createStore method. Therefore, the object program syntax tree of the front-end application can be traversed to obtain the return values ​​of all createStore methods, that is, to obtain all store objects, thereby obtaining all data containers created by the front-end application, and determining the data stored in the data container as the benchmark global data of the front-end application.

[0078] The above technical solution can fully acquire the benchmark global data of the object to be processed by traversing the data container creation method of the object program syntax tree, thereby improving the accuracy and comprehensiveness of the benchmark global data.

[0079] S260: traverse the object program syntax tree to determine a target data processing method for the benchmark global data.

[0080] The target data processing method may be a method capable of generating interdependencies between data for the benchmark global data. Optionally, the target data processing method may include but is not limited to a data subscription method and / or a data update method.

[0081] The data subscription method may be that the module of the object to be processed subscribes to the benchmark global data in the data container. The module subscribing to the benchmark global data will not store and retain the subscribed benchmark global data, but can only obtain the subscribed benchmark global data from the data container and apply it.

[0082] The data updating method may be that the data updated by the module of the object to be processed is the reference global data in the data container, the module that updates the reference global data may store and retain the updated reference global data, and a two-way updating operation may be performed between the module and the data container. For example, when data A in the data container is updated, data A in the module needs to be updated synchronously. If data A of the module needs to be updated, the module may notify the data container, and the data container unifies the update of data A, and then each module synchronously updates data A.

[0083] S270. Determine target dependent data of the object to be processed according to the target data processing method and the benchmark global data.

[0084] Accordingly, after determining the benchmark global data of the object to be processed and the target data processing method that can generate data interdependencies, the target dependency data of the object to be processed can be determined according to the target data processing method and the benchmark global data. For example, the data called by the target data processing method can be parsed, and the dependency relationship generated by the data called by the target data processing method can be determined according to the method type of the target data processing method.

[0085] The above technical solution can quickly and accurately determine all target dependent data of the object to be processed through the target data processing method and the benchmark global data.

[0086] In an optional embodiment of the present disclosure, determining the target dependency data of the object to be processed based on the target data processing method and the baseline global data may include: parsing the target data processing method to obtain target data processing method parsed data; determining the target dependency relationship of the target global data in the baseline global data based on the target data processing method parsed data; and determining the target dependency data of the object to be processed based on the target dependency relationship of the target global data.

[0087] Among them, the target data processing method parsed data is the data obtained by parsing the target data processing method. The target global data can be the benchmark global data that has a dependency relationship with the module of the object to be processed. It can be understood that the dependency relationship with the module of the object to be processed can be a dependency relationship with the module of the object to be processed itself, or a dependency relationship with the internal data of the module of the object to be processed, and the embodiments of the present disclosure do not limit this. The target dependency relationship may include but is not limited to a subscription relationship and / or an update relationship. The subscription relationship can be a subscription relationship between the data in the module of the object to be processed and the benchmark global data in the data container. The update relationship can be a synchronous update relationship between the data in the module of the object to be processed and the benchmark global data in the data container.

[0088] Specifically, the target data processing method can be parsed to obtain the target data processing method parsing data, thereby determining the target dependency of the target global data in the benchmark global data based on the parsed target data processing method parsing data. Optionally, the target data processing method can be parsed in a way that determines the target global data that needs to be specifically processed in the target data processing method, and determines the method type of the target data processing method, thereby determining the target dependency of the target global data based on the method type of the target data processing method, and then determining the target dependency data of the object to be processed based on the target dependency of the target global data.

[0089] For example, taking the front-end application as an example, assuming that the front-end application adopts the Redux framework, Redux can use the useSelector method to create a data subscription relationship, and use the dispatchAction method to create a data update relationship. Assuming that the front-end application adopts the Recoil framework, Recoil can use the useRecoilState / setter method to create a data subscription relationship, and use the useRecoilState / getter method to create a data update relationship. Assuming that the front-end application adopts the Mobx framework, Mobx can use the Property setter method to create a data subscription relationship, and use the Property accessor method to create a data update relationship.

[0090] Taking the Redux framework as an example, when processing the data subscription relationship of the front-end application, the data subscription method can be determined as the target data processing method, and the object program syntax tree of the front-end application can be traversed to obtain all useSelector methods to parse the data returned by all useSelector methods, and determine the subscription object corresponding to the data returned by the useSelector method, so as to determine that there is a data subscription relationship between the subscription object and the data returned by the useSelector method. Assuming that the subscription object is component 1 in a module of the front-end application, and the data A returned by the useSelector method is referenced by component 1, it can be determined that there is a data subscription relationship between component 1 and data A, and then component 1 and data A can be determined as a set of target dependent data.

[0091] When processing the data update relationship of the front-end application, the data update method can be determined as the target data processing method, and the object program syntax tree of the front-end application can be traversed to obtain all dispatchAction methods to parse the data returned by all dispatchAction methods, and determine the usage object corresponding to the data returned by the dispatchAction method, so as to determine that there is a data update relationship between the usage object and the data returned by the dispatchAction method. Assuming that the usage object is component 2 in a module of the front-end application, and data B returned by the dispatchAction method is referenced by component 2, it can be determined that there is a data update relationship between component 2 and data B, and then component 2 and data B can be determined as a set of target dependent data.

[0092] It is understandable that a certain kind of benchmark global data can be subscribed to or established an update relationship by multiple modules.

[0093] The above technical solution can clearly mine the existing dependency types by analyzing the target data processing method to determine the target dependency data of the object to be processed, and determine the specific dependency between the target dependency data according to the dependency type.

[0094] In an optional embodiment of the present disclosure, generating the target dependency data of the object to be processed based on the target dependency of the target global data may include: determining the dependency type of the target dependency; generating at least one dependency graph of the target global data based on the dependency type of the target dependency; and merging each of the dependency graphs to obtain the target dependency data of the object to be processed.

[0095] The dependency type is the specific type of relationship between data. The dependency graph can be a visual graphic structure that reflects the dependency between data.

[0096] In an embodiment of the present disclosure, the dependency type of the target dependency can be determined, such as a subscription relationship can be a subscription type, and an update relationship can be an update type. Accordingly, at least one dependency graph of the target global data can be generated according to the dependency type of the target dependency. For example, a subscription graph of the target global data can be generated according to the subscription type of the subscription relationship, and an update graph of the target global data can be generated according to the update type of the update relationship. After each dependency graph is generated according to the dependency types of different target dependencies, each dependency graph can be merged according to the same elements of each dependency graph, thereby obtaining the target dependency data of the graphical structure of the object to be processed.

[0097] Figure 4 is a subscription relationship diagram of part of the data of a front-end application provided by an embodiment of the present disclosure, Figure 5 It is an update relationship diagram of part of the data of a front-end application provided by an embodiment of the present disclosure. Figure 6 It is a dependency graph of part of the data of a front-end application provided by an embodiment of the present disclosure. In a specific example, taking the front-end application as an example, assuming that the front-end application adopts the Redux framework, the abstract syntax tree generated by the front-end application file can be traversed to obtain the return data of all useSelector methods and the subscription object of the return data. Assuming that the target global data of data1 of data container 1 (referred to as store1) is subscribed to component 1 (referred to as div1), and the target global data of data2 of data container 1 is subscribed to component 2 (referred to as div2), the following can be generated: Figure 4As shown in the subscription relationship diagram. At the same time, you can get the return data of all dispatchAction methods and the objects that use the return data. Assuming that the target global data of data1 in data container 1 depends on some data in data container 2 (referred to as store2) when it is updated, you can generate the following Figure 5 Further, Figure 4 and Figure 5 By merging, we can get Figure 6 The dependency graph shown. The dependency graph may include nodes representing global data, nodes representing components, and edges representing the dependency relationships between them.

[0098] The above technical solution, by generating target dependency data of the object to be processed according to different dependency graphs, can clearly display the consumption relationship between data and components in the object to be processed and the dependency relationship between data in a graphical manner, which can help developers design reasonable data management solutions, thereby improving code quality and improving data processing efficiency of the object to be processed.

[0099] In an optional embodiment of the present disclosure, the data processing method may further include: determining the function module to be optimized of the object to be processed according to the target dependency data; decoupling the function module to be optimized according to the target dependency data to obtain an optimized function module.

[0100] The function module to be optimized may be a module of the object to be processed that can be further optimized, and the optimized function module may be a plurality of modules obtained by decoupling and splitting the function module to be optimized.

[0101] Since the target dependency data of the object to be processed can reflect the consumption and dependency relationship of each global data, it is possible to determine which global data can be further optimized based on the target dependency data to determine the function module to be optimized of the object to be processed. After determining the function module to be optimized of the object to be processed, the function module to be optimized can be decoupled, such as extracting the global data that does not need to be reused by the module from the function module to be optimized, and then constructing an independent module based on the extracted global data to obtain an optimized function module, thereby simplifying the complexity and redundancy of the module and ensuring the rationality of the module division.

[0102] The above technical solution, by deeply mining the data of the object to be processed, obtains the target dependency data in the form of a dependency graph, which can intuitively determine the rationality of the data design of the object to be processed and quickly locate data with reuse value, thereby improving the code reuse of the object to be processed. At the same time, it can also quickly locate whether the target dependency data has the possibility of further optimization, so as to optimize the performance of the data that can be optimized and comprehensively improve the maintainability of the data.

[0103] It should be noted that any arrangement and combination of the technical features in the above embodiments also falls within the protection scope of the present disclosure.

[0104] In one example, Figure 7 : is a structural diagram of a data processing device provided by an embodiment of the present disclosure. The embodiment of the present disclosure can be applied to the case where the constructed syntax tree is used to deeply mine data with dependencies between objects to be processed. The device is implemented by software and / or hardware and is specifically configured in an electronic device. The electronic device can be a terminal device or a server device. The embodiment of the present disclosure does not limit the specific device type of the electronic device.

[0105] like Figure 7 The data processing device 700 shown in the figure comprises: an object program file acquisition module 710, an object program syntax tree generation module 720 and a target dependency data determination module 730.

[0106] The object program file acquisition module 710 is used to acquire the object program file of the object to be processed;

[0107] An object program syntax tree generation module 720, configured to generate an object program syntax tree of the object to be processed according to the object program file;

[0108] The target dependency data determination module 730 is used to determine the target dependency data of the object to be processed according to the object program syntax tree.

[0109] The disclosed embodiment generates an object program syntax tree of the object to be processed according to the acquired object program file of the object to be processed, and then determines the target dependency data of the object to be processed according to the object program syntax tree, thereby solving the problem of low data processing efficiency caused by the inability to deeply mine the interdependencies between data when performing data analysis on the object. The embodiment of the present invention can deeply mine the interdependencies between data, thereby improving the efficiency and maintainability of data processing, and further achieving data performance optimization.

[0110] Optionally, the object program syntax tree generation module 720 is specifically used to: parse the object program file to obtain the program command line data of the object program file and the syntax structure information between the program command line data; determine the target structure syntax tree of the object program syntax tree; and reorganize the syntax structure information between the program command line data and the program command line data according to the target structure syntax tree to obtain the object program syntax tree.

[0111] Optionally, the object program syntax tree generation module 720 is specifically used to: determine the target position nodes of the program command line data and the syntax structure information in the target structure syntax tree according to the syntax structure information between the program command line data; place the program command line data and the syntax structure information in matching target position nodes respectively to obtain the object program syntax tree.

[0112] Optionally, the target dependency data determination module 730 is specifically used to: traverse the object program syntax tree to obtain the benchmark global data of the object to be processed; traverse the object program syntax tree to determine the target data processing method of the benchmark global data; determine the target dependency data of the object to be processed according to the target data processing method and the benchmark global data.

[0113] Optionally, the target dependency data determination module 730 is specifically used to: traverse the object program syntax tree to obtain the data container creation method included in the object program syntax tree; obtain the data container created by the data container creation method; and determine the data stored in the data container as the benchmark global data of the object to be processed.

[0114] Optionally, the target dependency data determination module 730 is specifically used to: parse the target data processing method to obtain target data processing method parsed data; determine the target dependency relationship of the target global data in the benchmark global data according to the target dependency relationship of the target global data; determine the target dependency data of the object to be processed according to the target dependency relationship of the target global data.

[0115] Optionally, the target dependency data determination module 730 is specifically used to: determine the dependency type of the target dependency; generate at least one dependency graph of the target global data according to the dependency type of the target dependency; and merge each of the dependency graphs to obtain the target dependency data of the object to be processed.

[0116] Optionally, the target data processing method includes a data subscription method and / or a data update method; the target dependency relationship includes a subscription relationship and / or an update relationship.

[0117] Optionally, the data processing device also includes: a function module to be optimized determination module, used to determine the function module to be optimized of the object to be processed according to the target dependency data; an optimized function module acquisition module, used to decouple the function module to be optimized according to the target dependency data to obtain the optimized function module.

[0118] Optionally, the object to be processed includes a front-end application.

[0119] The above data processing device can execute the data processing method provided by any embodiment of the present disclosure, and has the corresponding functional modules and beneficial effects of the execution method. For technical details not described in detail in this embodiment, please refer to the data processing method provided by any embodiment of the present disclosure.

[0120] Since the data processing device introduced above is a device that can execute the data processing method in the embodiment of the present disclosure, based on the data processing method introduced in the embodiment of the present disclosure, the technical personnel in the field can understand the specific implementation of the data processing device of the present embodiment and its various variations, so how the data processing device implements the data processing method in the embodiment of the present disclosure is not described in detail here. As long as the technical personnel in the field implement the device used by the data processing method in the embodiment of the present disclosure, it belongs to the scope of protection of the present disclosure.

[0121] In one example, the present disclosure also provides an electronic device, a readable storage medium, and a computer program product.

[0122] Figure 8 A schematic block diagram of an example electronic device 800 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.

[0123] like Figure 8 As shown, the device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0124] A number of components in the device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0125] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as data processing methods. For example, in some embodiments, the data processing method may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the data processing method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the data processing method in any other appropriate manner (e.g., by means of firmware).

[0126] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0127] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0128] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0129] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0130] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0131] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services. The server can also be a server of a distributed system, or a server combined with a blockchain.

[0132] The disclosed embodiment generates an object program syntax tree of the object to be processed according to the acquired object program file of the object to be processed, and then determines the target dependency data of the object to be processed according to the object program syntax tree, thereby solving the problem of low data processing efficiency caused by the inability to deeply mine the interdependencies between data when performing data analysis on the object. The embodiment of the present invention can deeply mine the interdependencies between data, thereby improving the efficiency and maintainability of data processing, and further achieving data performance optimization.

[0133] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.

[0134] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.

Claims

1. A data processing method, comprising: Obtaining the object program file of the object to be processed; Generate an object program syntax tree of the object to be processed according to the object program file; Determine the target dependency data of the object to be processed according to the object program syntax tree; Wherein, generating the object program syntax tree of the object to be processed according to the object program file includes: Parsing the object program file to obtain program command line data and grammatical structure information of the object program file; Determine a target structure syntax tree of the object program syntax tree; The program command line data and syntax structure information are reorganized according to the target structure syntax tree to obtain the object program syntax tree.

2. The method according to claim 1, wherein: The step of reorganizing the program command line data and the grammatical structure information according to the target structure grammar tree to obtain the object program grammar tree includes: Determine the target position node of the program command line data and the grammatical structure information in the target structure syntax tree according to the grammatical structure information; The program command line data and the grammatical structure information are placed in matching target position nodes respectively to obtain the object program grammar tree.

3. The method according to claim 1, wherein: The step of determining target dependency data of the object to be processed according to the object program syntax tree includes: Traversing the object program syntax tree to obtain the benchmark global data of the object to be processed; Traversing the object program syntax tree to determine a target data processing method for the benchmark global data; The target dependent data of the object to be processed is determined according to the target data processing method and the benchmark global data.

4. The method according to claim 3, wherein: The traversing the object program syntax tree to obtain the benchmark global data of the object to be processed includes: Traversing the object program syntax tree to obtain a data container creation method included in the object program syntax tree; Obtain the data container created by the data container creation method; The data stored in the data container is determined as the reference global data of the object to be processed.

5. The method according to claim 3, wherein: The step of determining the target dependent data of the object to be processed according to the target data processing method and the benchmark global data includes: Parsing the target data processing method to obtain target data processing method parsing data; Parsing data according to the target data processing method to determine target dependencies of target global data in the reference global data; The target dependency data of the object to be processed is determined according to the target dependency relationship of the target global data.

6. The method according to claim 5, wherein: The step of generating the target dependency data of the object to be processed according to the target dependency relationship of the target global data includes: Determining a dependency type of the target dependency; generating at least one dependency graph of the target global data according to the dependency type of the target dependency; The dependency graphs are merged to obtain target dependency data of the object to be processed.

7. The method according to claim 6, wherein: The target data processing method includes a data subscription method and / or a data update method; the target dependency relationship includes a subscription relationship and / or an update relationship.

8. The method according to any one of claims 1 to 7, further comprising: Determining the to-be-optimized functional module of the object to be processed according to the target dependency data; The function modules to be optimized are decoupled according to the target dependency data to obtain optimized function modules.

9. The method according to any one of claims 1 to 7, wherein: The object to be processed includes a front-end application.

10. A data processing device, comprising: An object program file acquisition module is used to acquire the object program file of the object to be processed; An object program syntax tree generation module, used for generating an object program syntax tree of the object to be processed according to the object program file; A target dependency data determination module, used to determine the target dependency data of the object to be processed according to the object program syntax tree; Wherein, the object program syntax tree generation module is specifically used for: Parsing the object program file to obtain program command line data and grammatical structure information of the object program file; Determine a target structure syntax tree of the object program syntax tree; The program command line data and syntax structure information are reorganized according to the target structure syntax tree to obtain the object program syntax tree.

11. The device according to claim 10, wherein: The object program syntax tree generation module is specifically used for: Determine the target position node of the program command line data and the grammatical structure information in the target structure syntax tree according to the grammatical structure information; The program command line data and the grammatical structure information are placed in matching target position nodes respectively to obtain the object program grammar tree.

12. The device according to claim 10, wherein: The target dependency data determination module is specifically used for: Traversing the object program syntax tree to obtain the benchmark global data of the object to be processed; Traversing the object program syntax tree to determine a target data processing method for the benchmark global data; The target dependent data of the object to be processed is determined according to the target data processing method and the benchmark global data.

13. The device according to claim 12, wherein: The target dependency data determination module is specifically used for: Traversing the object program syntax tree to obtain a data container creation method included in the object program syntax tree; Obtain the data container created by the data container creation method; The data stored in the data container is determined as the reference global data of the object to be processed.

14. The device according to claim 12, wherein: The target dependency data determination module is specifically used for: Parsing the target data processing method to obtain target data processing method parsing data; Parsing data according to the target data processing method to determine target dependencies of target global data in the reference global data; The target dependency data of the object to be processed is determined according to the target dependency relationship of the target global data.

15. The device according to claim 14, wherein: The target dependency data determination module is specifically used for: Determining a dependency type of the target dependency; generating at least one dependency graph of the target global data according to the dependency type of the target dependency; The dependency graphs are merged to obtain target dependency data of the object to be processed.

16. The device according to claim 15, wherein: The target data processing method includes a data subscription method and / or a data update method; the target dependency relationship includes a subscription relationship and / or an update relationship.

17. The device according to any one of claims 10 to 16, further comprising: A function module to be optimized determining module, used to determine the function module to be optimized of the object to be processed according to the target dependency data; The optimized function module acquisition module is used to decouple the function module to be optimized according to the target dependency data to obtain the optimized function module.

18. The device according to any one of claims 10 to 16, wherein: The object to be processed includes a front-end application.

19. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the data processing method according to any one of claims 1 to 9.

20. A non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to cause a computer to execute the data processing method according to any one of claims 1 to 9.

21. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the data processing method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Data blood relationship processing method and device, storage medium and equipment

    CN112084270A

  • Applet processing method and device, equipment and storage medium

    CN112764757A