Target object identification and analysis method, computer device and computer program product
Through the pre-built target analysis architecture and hierarchical identification of function groups, complex files are automatically identified and parsed, solving the problem that traditional file preview methods cannot meet complex needs, and achieving fast preview and efficient development.
Patent Information
- Application Number
- CN202411992578.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-08
AI Technical Summary
The existing technology has difficulty in quickly previewing complex and diverse source code files and development configuration files, resulting in developers spending a lot of time in project management to open and view files.
By pre-constructing the target parsing architecture, the identification function is hierarchical execution and serial parsing logic combinations are used to automatically identify and parse the target object, providing a quick preview function.
It realizes rapid and accurate identification and analysis of complex target objects, reduces unnecessary identification and analysis processes, and improves development efficiency and system performance.
Smart Images

Figure CN119782267A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of software development technology, and in particular to a target object identification and analysis method, a computer device, and a computer program product. Background Art
[0002] As the complexity of software development continues to increase, various scenarios often involve identification and analysis based on target objects, which makes it easier to obtain the corresponding target content and ultimately apply it to various scenarios.
[0003] For example, various files, especially target objects in the form of source code files and development configuration files, play a very important role in project management. However, various files often need to be opened and viewed in development tools so that developers can view the target content in configuration files, source code or other formats.
[0004] However, opening and checking files is very time-consuming for developers. In order to improve development efficiency and project collaboration, it is urgent to implement fast preview for these files. However, in actual development work, limited by the diversity, complexity and structural requirements of source code files, traditional file preview methods are not applicable. Traditional file preview methods cannot meet the growing complex needs in actual development. Summary of the invention
[0005] One purpose of the present application is to provide an applicable target object recognition and parsing architecture to meet practical development needs.
[0006] According to one aspect of an embodiment of the present application, a target object identification and parsing method is disclosed, which pre-builds a target parsing architecture, and the target parsing architecture provides an interface for parsing files, which is used to automatically parse files and provide a preview of corresponding file contents. The method includes:
[0007] Performing hierarchical execution of the identification functions in the identification function group under the target resolution architecture on the target object, and stopping the subsequent function execution of the hierarchical identification function group after the executed hierarchical identification function group successfully obtains the object type, the hierarchical identification function group includes a pre-identification function group, a main identification function group and a post-identification function group;
[0008] Requesting the target parsing architecture for file content according to the object type, triggering the target parsing architecture to initiate a call to the serial parsing logic combination corresponding to the object type;
[0009] The target content of the target object is outputted through the parsing result of the called serial parsing logic combination.
[0010] According to one aspect of an embodiment of the present application, after requesting file content from the file parsing architecture target parsing architecture according to the file type object type, triggering the file parsing architecture target parsing architecture to initiate a call to the serial parsing logic combination corresponding to the file type object type, the method further includes:
[0011] The target parsing architecture is called to correspond to the serial parsing logic combination of the object type, and the parsing logic is executed sequentially until the parsing result of the target object is obtained.
[0012] According to one aspect of an embodiment of the present application, calling the target parsing architecture corresponds to a serial parsing logic combination of the object type, and sequentially executing the parsing logic until a parsing result of the target object is obtained, including:
[0013] Invoke a type serial parsing logic combination in the target parsing architecture to perform a specific type of parsing according to the object type;
[0014] The parsing logic is sequentially executed in the type serial parsing logic combination, and the parsing result returned by the parsing logic is passed to the next parsing logic until the parsing logic in the type serial parsing logic combination is completed, and the final parsing result is passed to the post-parsing logic combination;
[0015] The parsing result obtained by executing all the parsing logic sequences in the post-parsing logic combination is the parsing result of the target object.
[0016] According to one aspect of an embodiment of the present application, outputting the target content of the target object by using the parsing result of the called serial parsing logic combination includes:
[0017] The serial parsing logic combination returns the parsing result of the specified target object to the target parsing architecture;
[0018] The target parsing framework loads the parsing result, and displays the target content of the target object through the parsing result.
[0019] According to one aspect of an embodiment of the present application, it is characterized in that the object type returned by the identification function group is empty, and the request for the file content does not specify a target object type, and the method further includes:
[0020] The target parsing architecture calls the pre-serial parsing logic combination in response to a file content request that does not specify a target object type, and then passes through the pre-serial parsing logic combination to the type parsing logic combination until the hierarchical parsing on the post-parsing logic combination link obtains the parsing result of the specified target object.
[0021] According to one aspect of an embodiment of the present application, a computer device is disclosed, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of any of the methods described above.
[0022] According to one aspect of an embodiment of the present application, a computer program product is disclosed, including a computer program, wherein when the computer program is executed by a processor, the steps of any of the methods described above are implemented.
[0023] According to one aspect of an embodiment of the present application, a computer-readable storage medium is disclosed, on which a computer program is stored, and when the program is executed by a processor, the steps of any of the methods described above are implemented.
[0024] The embodiments of the present application achieve the acquisition of target content based on a pre-built target parsing architecture and the hierarchical execution of identification functions and the output of parsing results of serial parsing logic combinations implemented thereon. Furthermore, with the support of the dynamic scalability of the target parsing architecture, it can be flexibly expanded according to the growing complex needs in actual development without the need to reconstruct the entire system. It can meet the actual development needs through greatly improved flexibility and scalability, provide applicable target object identification and parsing for actual development and implemented application scenarios, and then output the target content to be applied to the implemented application scenarios.
[0025] Specifically, the constructed target parsing architecture provides automatic identification and parsing for target objects to provide corresponding target content, and can serve various application scenarios to output target content adaptively and accurately based on the current context and environment.
[0026] Through the hierarchical design of the identification function group on the target parsing architecture, the object type of the target object can be flexibly judged, and various target objects can be accurately identified, which greatly improves the flexibility and scalability at the identification level and can adapt to complex needs in actual development, such as the expansion of objects of different types. In addition, in the hierarchical execution of the identification function, once the object type is identified, the subsequent function execution of the layer will automatically stop, thus avoiding redundant identification operations.
[0027] Based on the obtained object type, the call of the corresponding serial parsing logic combination is triggered under the action of the target parsing architecture, so as to implement targeted parsing of the target object to obtain the target content, reducing unnecessary parsing processes, and effectively improving the speed and efficiency of object parsing. For complex object types, such as multi-layer nested code files, configuration files, etc., they can flexibly adapt and display the complete target content.
[0028] In summary, based on the hierarchical execution and on-demand calling of the identification functions, the matching parsing operation is started after the object type is determined, which effectively reduces the consumption of system resources. Even for large files, unnecessary resource usage can be avoided through precise parsing to ensure system performance.
[0029] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0030] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] The above and other objects, features and advantages of the present application will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings.
[0032] Figure 1 It is a flowchart of a target object recognition and parsing method according to an exemplary embodiment of the present application.
[0033] Figure 2 is based on Figure 1 A method flow chart describing the hierarchical execution of identification functions in an identification function group under a file parsing architecture target parsing architecture for a target object shown in a corresponding exemplary embodiment, and stopping subsequent function execution steps of the hierarchical identification function group after the executed hierarchical identification function group successfully obtains the file type object type.
[0034] Figure 3 It is a method flow chart describing the steps of calling a pre-identification function group for a target object to perform object pre-identification, obtaining the object pre-identification result, and passing the result to a main identification function group mapped to the target object according to an exemplary embodiment.
[0035] Figure 4 It is a method flow chart describing the steps of calling a target parsing architecture to combine serial parsing logics corresponding to an object type, and sequentially executing the parsing logics until a parsing result of a target object is obtained according to an exemplary embodiment.
[0036] Figure 5 is based on Figure 1 A method flow chart describing the steps of previewing the file content of a target object through parsing results is shown in the corresponding embodiment. DETAILED DESCRIPTION
[0037] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of the present application will be more comprehensive and complete and the concepts of the example embodiments will be fully conveyed to those skilled in the art. The accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0038] In addition, the described features, structures or characteristics may be combined in one or more example embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the example embodiments of the present application. However, those skilled in the art will appreciate that the technical solution of the present application may be practiced while omitting one or more of the specific details, or other methods, components, steps, etc. may be adopted. In other cases, known structures, methods, implementations or operations are not shown or described in detail to avoid obscuring the present application and making the various aspects of the present application obscure.
[0039] Some of the blocks shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0040] See also Figure 1 , Figure 1 It is a flowchart of a target object recognition and parsing method according to an exemplary embodiment of the present application.
[0041] The target object identification and parsing method provided in the embodiment of the present application pre-builds a target parsing architecture, which provides an interface for parsing the target object, so as to automatically parse the target object and provide corresponding target content. The method includes:
[0042] Step S110, hierarchical execution of the identification functions in the identification function group under the target resolution architecture is performed on the target object, and after the executed hierarchical identification function group successfully obtains the object type, the subsequent function execution of the hierarchical identification function group is stopped, and the hierarchical identification function group includes a pre-identification function group, a main identification function group and a post-identification function group;
[0043] Step S120, requesting the target parsing architecture for the file content according to the object type, triggering the target parsing architecture to initiate a call to the serial parsing logic combination corresponding to the object type;
[0044] Step S130: output the target content of the target object through the parsing result of the called serial parsing logic combination.
[0045] These steps are described in detail below.
[0046] First of all, it should be explained that the target parsing architecture is used to configure a series of identification functions and parsing logic, and provide a unified architecture interface to realize automatic recognition and parsing of target objects in various formats, and then output the obtained target content.
[0047] The target object can be a file of various formats, in addition to the current folder, the current graphical interface, etc., which are not limited here. The target object is adapted to the application environment in which it is located, and there are differences. Therefore, this application implements the process of identifying and parsing the target object to obtain the target content, that is, to obtain certain target content by means of the current context and environment, and to use it as input for visual display, file preview, and adaptive response to the manipulation of the target object to generate a menu.
[0048] For example, in the visual display and file preview, the parsing results are converted into a visual format, such as highlighting the source code, to ensure that users can view it clearly and intuitively.
[0049] Under the action of the target parsing architecture, the interaction between the identification function group formed by the identification function and the serial parsing logic combination can be realized. The identified object type can automatically trigger the call and execution of the serial parsing logic combination of the corresponding specific object type, and then automatically adapt as the target object changes, realizing intelligent and diversified recognition and parsing of multiple target objects.
[0050] In step S110, the input data of the designated target object is received through the interface provided by the target resolution architecture. It should be understood that the input data received for the designated target object includes but is not limited to the source address, object extension or corresponding binary data, etc., wherein the source address of the target object includes the target path configured locally and / or the network address of the target object stored remotely.
[0051] Therefore, for the target object, during the hierarchical execution of the identification function, the source address, such as the stored target path, or the URL network address, can be extracted through the configured preceding identification function group to facilitate the identification of the object extension for the sequential serial execution of the identification functions in the corresponding main identification function group.
[0052] For the target object, the target object will be adapted to hierarchically call the identification function group, such as calling the preceding identification function or directly calling the main identification function group mapped by the target object, so as to efficiently and orderly identify the object type of the target object through the hierarchical execution of the identification function, as shown in step S110.
[0053] In step S110 , it should be noted that the target parsing architecture is configured with an identification function group, which is used to perform identification operations on the target object.
[0054] The identification function group includes several identification functions to support a wide range of formats, not limited to common formats. The identification functions constituting the identification function group are layered to adapt to various target objects for layered execution of the identification functions.
[0055] That is, the identification functions in the identification function group are arranged in layers, and each layer prioritizes the subclass identification function over the general identification function. The execution of each identification function in the identification function layer is implemented through the adapted identification function layer based on the obtained file path or object extension, and the subclass identification function in the executed identification function takes precedence over the general identification function.
[0056] Further explained, the identification function group configured under the target parsing framework includes a pre-identification function group, a main identification function group and a post-identification function group in terms of hierarchy. The pre-identification function group is used to perform object pre-identification on the target object, so as to narrow the processing scope for subsequent accurate and rapid judgment, reduce unnecessary identification operations, and identify files that do not conform to the expected format in advance, so as to avoid wasting computing resources or causing operation errors in the future.
[0057] It should be clear that the pre-identification function group includes several identification functions, and the several identification functions included can be subclass identification functions or general identification functions. The subclass identification function data is configured to be executed first, and the general identification function is executed later. In short, the subclass identification function is distributed in the front, and the general identification function is distributed in the back in the pre-identification function group, and the identification functions are arranged in series, so that when the identification functions are executed sequentially in the pre-identification function, the subclass identification function is executed first, and then the general identification function is executed.
[0058] For example, the pre-authentication function group is used to obtain the source address of the target object and extract the object extension based on the obtained source address, so that the extracted object extension can be passed to the main authentication function group for accurate identification.
[0059] Compared with the main identification function group, the pre-identification function group implements object pre-identification on the target object, so that the pre-execution process common to all types of target object identification can be completed under the operation of the pre-identification function group, thereby avoiding multiple repeated operations of the same identification function, and also avoiding the duplication of the same identification function in the code, increasing reusability. The main identification function group is a serial sequence of identification functions corresponding to the object type. For each identifiable object type, the identification function group configured in the target parsing architecture has a corresponding main identification function group. It can be understood that the main identification function group is used to adapt to the corresponding object extension for calling to initiate object type identification of the target object of the object extension.
[0060] As mentioned above, the main authentication function group is a serial sequence of authentication functions formed by subclass authentication functions and general authentication functions, and the subclass authentication functions take precedence over the general authentication functions.
[0061] It is further explained that the subclass identification function is relative to the general identification function. The general identification function is used to identify the general object type. For example, the general identification function may be extnameJudger, which simply determines the object type based on the object extension. The subclass identification function will further analyze the content and / or metadata of the specified target object in order to more accurately identify the object type than the object extension.
[0062] Since in the hierarchical execution of the identification function, once the object type is successfully obtained, the subsequent function execution of the hierarchical identification function group will be stopped, the execution of the subclass identification function is configured to take precedence over the general identification function to improve the recognition accuracy and efficiency.
[0063] The corresponding main identification function group is hit through the object extension name. Therefore, during the call and execution of the main identification function group, the subclass identification function is executed serially, and then the general identification function is executed. Once the object type is successfully obtained, or the currently executed identification function throws an error, the identification of the object type will be terminated.
[0064] It is further explained that the subclass identification function is relative to the general identification function. The general identification function is used to identify the general object type. For example, the general identification function can be extnameJudger, which simply determines the object type based on the object extension. The subclass identification function will further analyze the content and / or metadata of the specified target object in order to more accurately identify the object type compared to the structured data, such as the object extension.
[0065] The post-identification function group further verifies or classifies the object type obtained by identification, ensuring the accuracy of file identification and realizing deep classification of object types. For example, for some multi-purpose formats, such as JSON files, the post-identification function group can further identify their specific types, such as GeoJSON object types or ordinary JSON object types. Under the action of the post-identification function group, the object types obtained by identification are corrected and supplemented to ensure the smoothness of subsequent target object parsing, and can accurately and quickly call the adapted parsing logic to process the target object.
[0066] In summary, for the object type identification operation performed by the identification function group, if the object extension indicates the object type, the corresponding main identification function group can be directly matched among the configured main identification function groups, and the several identification functions specified by the main identification function group can be executed in serial order. After obtaining the object type, jump to the next layer, that is, the post-identification function group.
[0067] Execute the identification function sequence arranged serially in the post-identification function group in sequence. For example, if the post-identification function group is in the form of a list, execute the identification functions in the post-identification function list in sequence. If an identification is successful, stop the subsequent execution and return the obtained object type to the target parsing architecture, otherwise return empty.
[0068] On the other hand, if the object extension does not indicate the object type, it is necessary to anonymously execute the identification function, that is, start from the preceding identification function group to obtain the source address and identify and extract the object extension. If the execution is successful, stop the subsequent identification function execution and pass the obtained object extension to the main identification function group.
[0069] The target resolution architecture adapts the object extension returned by the pre-identification function group to match the corresponding main identification function group, passes the object extension to the hit main identification function group, executes the specified identification function in the main identification function group, and terminates the execution of the identification function if the corresponding object type is obtained, and then proceeds to the next layer, namely the post-identification function group.
[0070] In summary, step S110 is performed hierarchically under the target parsing architecture. For structured data including object extensions, please refer to Figure 2 , Figure 2 is based on Figure 1 A method flow chart describing the hierarchical execution of identification functions in an identification function group under a file parsing architecture target parsing architecture for a target object shown in a corresponding exemplary embodiment, and stopping subsequent function execution steps of the hierarchical identification function group after the executed hierarchical identification function group successfully obtains the file type object type.
[0071] The step S110 of performing hierarchical execution of the identification functions in the identification function group under the target parsing architecture of the file parsing architecture provided in the embodiment of the present application, and stopping the subsequent function execution of the hierarchical identification function group after the executed hierarchical identification function group successfully obtains the file type object type, includes:
[0072] Step S111, adapting the target object, performing sequential serial execution of the subclass identification function in the mapped main identification function group to the general identification function, and stopping the subsequent function execution after successfully obtaining the object type;
[0073] Step S112, in response to the main identification function group stopping execution, jumping to the next layer of the identification function, and performing post-identification output of the object type through the post-identification function group of the next layer.
[0074] These two steps are described in detail below.
[0075] For the target object, if its object extension name is obtained directly, and the object extension name indicates the object type of the target object, the mapped main identification function group can be called directly, and then the subclass identification function in the main identification function group is executed serially to the general identification function until the object type is obtained successfully or an error is thrown, and the execution of subsequent functions is stopped.
[0076] When the object type is successfully obtained, it is possible to jump to the next level of the identification function, that is, the execution of the post-identification function group, so as to return the object type to the target parsing architecture through the post-identification.
[0077] This is a target object identification process that can directly obtain the object extension and the object extension clearly defines the object type. Under the control of the target parsing architecture, the target object is adapted to its structured data to determine the executed hierarchical identification function group. Through hierarchical execution, once the object type is successfully identified, the subsequent parsing operation as shown in step S120 is entered, while ensuring accuracy, the execution efficiency is enhanced, and a quick preview is achieved. When the object extension cannot be directly obtained for the target object, that is, the file path or network address of the target object is obtained, the target object is subjected to hierarchical execution of the identification function in the identification function group under the file parsing architecture target parsing architecture, and the execution of the subsequent functions of the hierarchical identification function group is stopped after the executed hierarchical identification function group successfully obtains the file type object type, and the step of:
[0078] The pre-identification function group is called for the target object to perform object pre-identification, obtain the object pre-identification result, and pass it into the main identification function group mapped to the target object.
[0079] See also Figure 3 of, Figure 3It is a method flow chart describing the steps of calling a pre-identification function group for a target object to perform object pre-identification, obtaining the object pre-identification result, and passing the result to a main identification function group mapped to the target object according to an exemplary embodiment.
[0080] The embodiment of the present application provides a method for calling a pre-identification function group for a target object to perform object pre-identification, obtain an object pre-identification result, and pass the result to a main identification function group for target object mapping, including:
[0081] Step S201, calling a pre-identification function group on a target object, where the pre-identification function group is the previous layer of the main identification function group in the deployed identification function;
[0082] Step S202, obtaining the source address through the pre-identification function, and executing the identification functions of the pre-identification function group in the identification function group under the target resolution architecture in sequence, so as to stop the execution of subsequent functions after the object pre-identification is completed and the object extension is successfully obtained, and the object extension is the identification result obtained by the object pre-identification;
[0083] Step S203, in response to the preceding identification function group stopping execution, jumps to the next layer of the identification function, and triggers the sequential serial execution of the subclass identification function in the main identification function group mapping the target object in the next layer to the general identification function. After successfully obtaining the file type, the subsequent function execution is stopped, and the recognition result of the object pre-identification is passed to the main identification function group.
[0084] This is the object type pre-identification process implemented based on the source address of the target object, such as the target path or URL network address, when the object extension is unknown. As mentioned earlier, it is an anonymous identification process that requires the execution of the identification function group layer by layer to exhaust the object type identification capabilities configured by the target resolution architecture to achieve object type identification.
[0085] At this point, it should be supplemented with respect to the object type identification implemented in step S110 that this process is performed for a target object, and the output object type is not limited to one object type, and there is a situation where one object type is input and multiple objects are output.
[0086] Specifically, in an exemplary embodiment, the number of obtained object types is multiple. For example, for a JSON file, two object types can be identified, namely, a GeoJSON object type and a common JSON object type.
[0087] The main identification function group adapted to the object extension identifies at least one object type, and then the object extension is deeply classified under the action of the post-identification function group, and then merged with the at least one object type obtained by the main identification function group, and the identified object type is returned to the file parsing framework.
[0088] This ensures the reliability of the object type identification, and enables the subsequent file parsing to be performed accurately.
[0089] With the execution of step S110, after obtaining multiple object types, multiple serial parsing logic combinations corresponding to the multiple object types will be called in the execution of step S120, that is, the serial parsing logic combinations corresponding to each object type are respectively called, and then the parsing operations are respectively performed.
[0090] As multiple serial parsing logic combinations are called, the parsing structure is outputted through each serial parsing logic combination, and multiple parsing results are finally obtained, so that the designated target object can adapt to multiple file quantities for diverse file content preview.
[0091] For example, the GeoJSON object type is also in JSON format, so the JSON object type is used to display the content in JSON file format. In addition, the GeoJSON graphics will also be displayed.
[0092] In the execution of step S120, the target parsing framework triggers the invocation of the corresponding serial parsing logic combination according to the returned object type. The serial parsing logic combination is adapted to the object type and performs parsing on the specified target object through the parameters such as the passed-in path.
[0093] It should be understood that the target parsing architecture can dynamically select parsing logic according to the object type by registering serial parsing logic combinations of multiple different object types. Each serial parsing logic combination is used as an independent module to facilitate expansion and maintenance.
[0094] That is to say, for any object type, a mapping relationship between the object type and the serial parsing logic combination can be established through a dynamic registration mechanism, so as to support the parsing of multiple object types and facilitate the expansion of new serial parsing logic combinations.
[0095] In another exemplary embodiment, after step S120, the target object identification parsing file provided by the present application further includes:
[0096] The target parsing architecture is called to correspond to the serial parsing logic combination of the object type, and the parsing logic is executed sequentially until the parsing result of the target object is obtained.
[0097] Each parseable object type is configured with a corresponding serial parsing logic combination, which is used to implement file parsing of the corresponding object type to obtain parsing results that can be displayed visually.
[0098] The serial parsing logic combination includes several independent parsing logics. Each parsing logic is used to apply a specific parsing strategy to the corresponding type of file to process the content of the target object. For example, for the object type of the source code file, it is necessary to identify its grammatical structure, comments, etc., and then parse and extract its text, images, etc. The serial parsing logic combination is executed in the form of a serial logic combination of the target object, that is, each parsing logic contained in it is executed in serial order, and the file is gradually deconstructed until a parsing result carrying the complete file content is obtained.
[0099] The object type obtained in step S120 causes the target parsing architecture to call the corresponding serial parsing logic combination, and then start the specific serial parsing logic combination, so that the serial parsing logic combination parses each part of the specified target object in sequence according to the order set by itself.
[0100] Thus, the serial parsing logic combination returns the obtained parsing result to the target parsing architecture, and then uses the parsing result as the obtained target content through the execution of step S140 for use in the connected application. For example, in the connected application, the target content is converted into a visual format to achieve a quick preview of the content.
[0101] As a further supplement, each of the several parsing logics in the serial parsing logic combination can exist in the form of a parsing function, that is, the serial parsing logic combination is a list consisting of a group of parsing functions, and the parsing result of the specified target object can be obtained by executing the call of each parsing function in the order of this list.
[0102] For several parsing logics, a hierarchical configuration of serial parsing logic combinations will be performed to implement pre-parsing, type parsing, and post-parsing of the target object to ensure that the entire parsing process is efficient, accurate, and complete.
[0103] In an exemplary embodiment, the hierarchically configured serial parsing logic combination includes a pre-parsing logic combination, a type serial parsing logic combination, and a post-parsing logic combination.
[0104] The type serial parsing logic combination is suitable for a specific object type. When the object type can be identified, the corresponding type serial parsing logic combination can be called according to the object type.
[0105] In this way, the parsing logic can be executed sequentially in the type serial parsing logic combination, and the obtained parsing result will be passed to the next parsing logic, and so on, until all the parsing logics in the type serial parsing logic combination are executed.
[0106] It should be understood that after each parsing logic is executed, the parsing result obtained is passed to the next parsing logic and merged or replaced with the parsing result obtained by the next parsing logic, and so on. The final parsing result is the collection of all parsing results.
[0107] Based on the configuration of each parsing logic, data can be extracted from the specified target object and structured and then parsed one by one to extract content and other data, such as images, tables, etc. As the parsing logic is continuously executed, it is continuously passed to the next parsing logic to obtain the new parsing result. After the entire parsing process is completed, the final parsing result is returned to the target parsing architecture.
[0108] This is an example of the execution of each layer serial parsing logic combination. After completing the execution of the type serial parsing logic combination, jump to the next layer, that is, the execution of the post parsing logic combination.
[0109] The post-parsing logic combination is still configured with several parsing logics, and then the execution of the post-parsing logic combination is completed by sequentially executing the parsing logics.
[0110] When the object type is clear, the parsing of the specified target object can be completed through the type serial parsing logic combination and the post-parsing logic combination.
[0111] However, when the object type is not clear, that is, the corresponding object type is not obtained through the identification and authentication of the aforementioned specified target object, the specified target object will be attempted to be resolved through the sequential execution of the pre-parsing logic combination, the type serial parsing logic combination and the post-parsing logic combination.
[0112] The pre-parsing logic combination is used to implement the parsing process common to various target objects, such as reading their content, formatting and standardizing the extracted data, and processing various parameters.
[0113] Before the formal parsing is carried out, various preprocessing is completed to preliminarily obtain the basic data of the target object suitable for the type serial parsing logic combination to enhance the subsequent parsing efficiency.
[0114] The type serial parsing logic combination will perform deep parsing of the specified target object based on the basic data obtained by the pre-parsing logic combination to obtain specific content or structured data. For example, the specific content is obtained by deeply parsing the file content, such as parsed JSON data, read image metadata, etc.
[0115] For the specific content or structured data obtained, the parsing logic will be executed to generate a standard parsing result that conforms to the corresponding possible type format.
[0116] The parsing results are passed to the post-parsing logic combination for optimization and supplementation to ensure the integrity and practicality of the data, so that it is suitable for the connected application. For example, minor errors in the parsing process (such as default values for missing fields) can be fixed, or additional contextual information can be added for better display.
[0117] In summary, the pre-parse logic combination, the type serial parsing logic combination corresponding to each identifiable and parsable object type, and the post-parse logic combination complement each other and depend on each other to form an efficient and reliable target object recognition and parsing framework implementation under the target parsing architecture, which can be used as a bottom-level tool for many applications.
[0118] See also Figure 4 of, Figure 4 It is a method flow chart describing the steps of calling a target parsing architecture to combine serial parsing logics corresponding to an object type, and sequentially executing the parsing logics until a parsing result of a target object is obtained according to an exemplary embodiment.
[0119] The calling target parsing architecture corresponds to the serial parsing logic combination of the object type, and the steps of sequentially executing the parsing logic until the parsing result of the specified target object is obtained include:
[0120] Step S301, calling a type serial parsing logic combination for performing a specific type of parsing in a target parsing architecture according to an object type;
[0121] Step S302, the parsing logic is sequentially executed in the type serial parsing logic combination, and the parsing result returned by the parsing logic is passed to the next parsing logic, until the parsing logic in the type serial parsing logic combination is completed, and the final parsing result is passed to the post-parsing logic combination;
[0122] Step S303, executing all the parsing logics in the post-parsing logic combination in sequence obtains the parsing result as the parsing result of the designated target object.
[0123] This is an implementation of parsing a specified target object when the object type can be identified, so that file parsing can be achieved by directly calling the corresponding type serial parsing logic combination and the post-parsing logic combination without going through the pre-parsing logic combination, thereby improving the file preview speed.
[0124] After obtaining the parsing result, the target content of the target object can be output under the control of the target parsing architecture, such as the execution of step S130. So far, the implementation process of step S130 is explained by taking the application implementation of the target object quick preview as an example.
[0125] See also Figure 5 of, Figure 5 is based on Figure 1 A method flow chart describing the steps of previewing the file content of a target object through parsing results is shown in the corresponding embodiment.
[0126] The step S130 of outputting the target content of the target object by using the parsing result of the called serial parsing logic combination provided in the embodiment of the present application includes:
[0127] Step S131, the serial parsing logic combination returns the parsing result of the target object to the target parsing architecture;
[0128] Step S132: the target parsing framework loads the parsing result, and displays the target content of the target object through the parsing result.
[0129] As mentioned above, the execution of the serial parsing logic ensures that different parts of the target object can be parsed in the appropriate order, so that the target content can be extracted efficiently and accurately. The step-by-step object parsing ensures that the contents of complex file formats, such as source code, configuration files, document files, etc., can be fully parsed to avoid omissions.
[0130] Furthermore, once the object type is determined, other identification functions do not need to be executed repeatedly, thereby improving the efficiency of object type identification and identification.
[0131] For the completed target content analysis, the target analysis framework will preview the target object content through the analysis results. The target content preview is adapted to different object types and has different formatting and display methods.
[0132] Exemplarily, for source code files, the target parsing architecture will perform syntax highlighting according to the programming language, and different language elements, such as keywords, variable names, function names, comments, etc., will be displayed in different colors so that the implemented preview can clearly display the code results.
[0133] For document files, such as specified target objects of PDF type, text, images, tables and other contents can be extracted through hierarchical execution of serial parsing logic, and then displayed in the document format, retaining the original typesetting and layout.
[0134] For configuration files, the target content can be displayed in the form of key-value pairs or tree structures, so that detailed information of different configuration items can be quickly viewed.
[0135] In summary, under the influence of the parsing results, the target parsing architecture can automatically realize file preview and support the display of multiple object types. It can adopt different formatting and display methods according to the object type to meet diverse file preview needs.
[0136] The addition of identification function groups adapted to various object types and the addition of serial parsing logic combinations in the target parsing architecture can be achieved through the registration mechanism under the target parsing architecture.
[0137] Exemplarily, first create a target parsing architecture instance, that is, an instance of recognize-parse, and add an identification function group for identifying an object type, and / or a serial parsing logic combination under this instance to form a key-value pair of object type and identification function group, and / or serial parsing logic combination for easy calling, thereby ultimately realizing the quick preview function of file content and improving data processing efficiency.
[0138] In an exemplary embodiment, the present application further provides a computer device, including a memory, a processor, and a computer program stored in the memory, wherein the processor executes the computer program to implement the steps of the method described above.
[0139] In an exemplary embodiment, the present application further provides a computer program product, including a computer program, wherein the computer program implements the steps of the above-mentioned method when executed by a processor.
[0140] In an exemplary embodiment, the present application further provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, the steps of the method described above are implemented.
[0141] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0142] In an exemplary embodiment of the present application, a computer program medium is further provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer is enabled to execute the method described in the above method embodiment.
[0143] According to one embodiment of the present application, a program product for implementing the method in the above method embodiment is also provided, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited to this. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0144] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable 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 above.
[0145] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0146] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0147] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0148] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0149] In addition, although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0150] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0151] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the appended claims.
Claims
1. A target object recognition and analysis method, characterized in that: A target parsing framework is pre-built, and the target parsing framework provides an interface for parsing the target object, which is used to automatically parse the target object and provide corresponding target content. The method includes: Performing hierarchical execution of the identification functions in the identification function group under the target resolution architecture on the target object, and stopping the subsequent function execution of the hierarchical identification function group after the executed hierarchical identification function group successfully obtains the object type, the hierarchical identification function group includes a pre-identification function group, a main identification function group and a post-identification function group; Requesting the target parsing architecture for file content according to the object type, triggering the target parsing architecture to initiate a call to the serial parsing logic combination corresponding to the object type; The target content of the target object is outputted through the parsing result of the called serial parsing logic combination.
2. The method according to claim 1, characterized in that The identification functions in the hierarchical identification function group include subclass identification functions and general identification functions, and the subclass identification function takes precedence over the general identification function.
3. The method according to claim 1, characterized in that The object extension object type is obtained by identifying the source address and object extension of the target object through the identification function group.
4. The method according to claim 1, characterized in that: The step of performing hierarchical execution of the identification functions in the identification function group under the target resolution architecture on the target object and stopping subsequent function execution of the hierarchical identification function group after the executed hierarchical identification function group successfully obtains the object type includes: Adapt the target object, perform serial execution of the subclass identification function in the mapped main identification function group to the general identification function, and stop the subsequent function execution after successfully obtaining the object type; In response to the main identification function group stopping execution, the next layer of the identification function is jumped to perform post-identification of the output object type through the post-identification function group of the next layer.
5. The method according to claim 4, characterized in that The adapting structured data performs hierarchical execution of the identification functions in the identification function group under the target parsing architecture, and stops subsequent function execution of the hierarchical identification function group after the executed hierarchical identification function group successfully obtains the object type, including: The pre-identification function group is called for the target object to perform object pre-identification, obtain the identification result of the object pre-identification, and pass it into the main identification function group mapped to the target object.
6. The method according to claim 5, characterized in that The calling of the pre-identification function group for the target object to perform object pre-identification, obtaining the identification result of the object pre-identification, and passing the result to the main identification function group mapped to the target object includes: Calling a pre-authentication function group on a target object, the pre-authentication function group being a previous layer of the main authentication function group in the deployed authentication function; Obtaining the source address through the pre-identification function, executing the identification functions of the pre-identification function group in the identification function group under the target resolution architecture in sequence, so as to stop the subsequent function execution after completing the object pre-identification and successfully obtaining the object extension name, and the object extension name is the identification result obtained by the object pre-identification; In response to the preceding identification function group stopping execution, jumping into the next layer of the identification function, triggering the calling of the main identification function group mapped to the target object at the next layer, and passing the identification result of the object pre-identification to the main identification function group.
7. The method according to claim 1, characterized in that The number of object types obtained is multiple, and multiple serial parsing logic combinations are called corresponding to the multiple numbers of object types.
8. The method according to claim 7, characterized in that A plurality of the serial parsing logic combinations output a plurality of parsing results, so that the designated target object is adapted to the plurality of object types and the number of the plurality of target content is outputted in a diversified manner.
9. A computer device comprising a memory, a processor and a computer program stored in the memory, characterized in that: The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 8.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.