File parsing method, device, computer equipment and storage medium

By determining the program identity and operation environment information of the target application, a matching thread model is generated, which solves the problem of file parsing processing logic not adapting to the environment, improves analysis performance and reduces operation and maintenance costs.

CN113204376BActive Publication Date: 2024-12-13CHINABANK PAYMENT (BEIJING) TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202110460564.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-27
Publication Date
2024-12-13
Estimated Expiration
2041-04-27

AI Technical Summary

Technical Problem

In the prior art, file parsing processing logic is easily restricted by the operating environment carried by the application, resulting in low file parsing efficiency, especially when high transaction volumes require strong computing power server support, affecting performance.

Method used

By determining the program identity of the target application, obtaining the corresponding running environment information, generating a matching target thread model, and parsing the file based on the model to ensure that the parsing processing logic is consistent with the environment.

Benefits of technology

Improve file parsing performance, realize application portability, reduce operation and maintenance costs of multi-operation environment deployment, and improve file parsing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113204376B_ABST
    Figure CN113204376B_ABST
Patent Text Reader

Abstract

The present disclosure proposes a file parsing method, device, computer equipment and storage medium, the method comprising: determining a program identifier of a target application, wherein the target application is used to parse the file; obtaining operating environment information corresponding to the program identifier; generating a target thread model matching the operating environment information; and parsing the file according to the target thread model. The parsing processing logic of the application for the file can be adapted to the environment in which it is running, thereby effectively improving the parsing performance of the application for the file, and making the application used for parsing the file portable, thereby reducing the operation and maintenance costs of deploying multiple operating environments.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a file parsing method, device, computer equipment and storage medium. Background Art

[0002] At present, the volume of online transactions is increasing. For example, due to various promotional activities carried out by major e-commerce companies, a large number of orders are generated in a single day. These orders need to be reconciled by the initiator and the recipient the next day. Therefore, it is necessary to obtain the files used for reconciliation and parse the files to support the reconciliation operations. Usually, in order to ensure information security, the initiator will encrypt the files, and correspondingly, the acquirer will decrypt the files and then parse them. Since the files are large, the decryption operation requires a server with strong computing power to support it. During non-promotional periods, the transaction volume is relatively small, and the amount of files to be parsed is also small, so a server with normal computing power can be used accordingly.

[0003] In the related art, the parsing and processing logic for the files used for reconciliation is easily restricted by the operating environment of the application, thereby affecting the performance of the application's parsing and processing, and the file parsing efficiency is low. Summary of the invention

[0004] The present disclosure proposes a file parsing method, apparatus, computer device and storage medium, aiming to solve one of the technical problems in the related art at least to a certain extent.

[0005] According to a first aspect, a file parsing method is provided, comprising: determining a program identifier of a target application, wherein the target application is used to parse a file; obtaining operating environment information corresponding to the program identifier; generating a target thread model that matches the operating environment information; and parsing the file according to the target thread model.

[0006] According to a second aspect, a file parsing device is provided, comprising: a determination module for determining a program identifier of a target application, wherein the target application is used to parse the file; a first acquisition module for acquiring operating environment information corresponding to the program identifier; a generation module for generating a target thread model matching the operating environment information; and a parsing module for parsing the file according to the target thread model.

[0007] According to a third aspect, a computer device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable 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 file parsing method provided in an embodiment of the present disclosure.

[0008] According to a fourth aspect, a non-transitory computer-readable storage medium storing computer instructions is proposed, wherein the computer instructions are used to enable the computer to execute the file parsing method provided by the embodiment of the present disclosure.

[0009] The disclosed embodiments, by determining the program identifier of a target application, wherein the target application is used to parse files, and obtaining operating environment information corresponding to the program identifier, generating a target thread model that matches the operating environment information, and parsing the file according to the target thread model, can adapt the application's file parsing processing logic to the environment in which it runs, thereby effectively improving the application's file parsing performance, and making the application used to parse files portable, thereby reducing the operation and maintenance costs of deploying multiple operating environments.

[0010] Additional aspects and advantages of the present disclosure will be given in part in the following description and in part will be obvious from the following description or learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The above and / or additional aspects and advantages of the present disclosure will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0012] Figure 1 is a flowchart of a file parsing method according to the first embodiment of the present disclosure;

[0013] Figure 2 is a flowchart of a file parsing method according to a second embodiment of the present disclosure;

[0014] Figure 3 is a schematic diagram of a file parsing device according to a third embodiment of the present disclosure;

[0015] Figure 4 is a schematic diagram of a file parsing device according to a fourth embodiment of the present disclosure; and

[0016] Figure 5 It is a block diagram of a computer device used to implement the file parsing method of the embodiment of the present disclosure. DETAILED DESCRIPTION

[0017] Embodiments of the present disclosure are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present disclosure, and are not to be construed as limitations of the present disclosure. On the contrary, the embodiments of the present disclosure include all changes, modifications, and equivalents that fall within the spirit and connotation of the appended claims.

[0018] In view of the technical problem that the parsing and processing logic of files used for reconciliation in the related technology is easily restricted by the operating environment of the application, thereby affecting the performance of the application's parsing and processing, and the file parsing efficiency is low, the technical solution of this embodiment provides a file parsing method, device, computer equipment and storage medium. The method is explained in conjunction with specific embodiments below.

[0019] It should be noted that the executor of the file parsing method of this embodiment may be a file parsing device, which may be implemented by software and / or hardware, and which may be configured in a computer device, which may include but is not limited to a terminal, a server, etc.

[0020] Figure 1 It is a flowchart of a file parsing method according to the first embodiment of the present disclosure.

[0021] like Figure 1 As shown, the file parsing method includes:

[0022] S101: Determine a program identifier of a target application, wherein the target application is used to parse a file.

[0023] In some application scenarios, such as transferring files over the Internet, the files may be encrypted during the transfer process, and correspondingly, the files may be decrypted and parsed after being received, for example, to read the file contents.

[0024] For example, reconciliation analysis is performed on order files.

[0025] The application used to parse a file (for example, the order file mentioned above) can be called a target application, and the target application is used to perform corresponding parsing operations on the file.

[0026] In some embodiments, the target application is, for example but not limited to, a decompression application, a decryption application, and any other application that has the function of parsing files. The target application is not specifically limited here.

[0027] The program identifier can be used to uniquely identify the target application, that is, one program identifier corresponds to one target application. The program identifier is, for example, an icon, a number, a name, etc., and different applications can be distinguished by the program identifier.

[0028] In the embodiment of the present disclosure, during the process of parsing a file, a program identifier of a target application used for parsing the file may be determined, and then corresponding operating environment information may be determined based on the program identifier.

[0029] S102: Acquire the operating environment information corresponding to the program identifier.

[0030] After the program identifier is determined, further, the operating environment information corresponding to the program identifier may be obtained.

[0031] It is understandable that the target application may have different operating environment information in different environments, and the target application corresponds to a program identifier, so the embodiment of the present disclosure can obtain the corresponding operating environment information according to the program identifier.

[0032] The operating environment information may be configuration information required for the target application to run in different environments, such as operating environment information on different hardware devices or on different platforms, etc., which is not specifically limited here.

[0033] The operating environment information may include, for example, the hardware configuration information or software configuration information of the platform on which the target application is running, and there is no limitation on this.

[0034] Optionally, in some embodiments, when acquiring the operating environment information corresponding to the program identifier, the server identifier of the server on which the target application program is running may be determined first according to the program identifier.

[0035] That is to say, the operating environment of the target application provided by the embodiment of the present disclosure can be the environment of the server on which it is installed. When obtaining the operating environment information corresponding to the program identifier, the present embodiment can determine the server identifier of the server on which the target application is running based on the program identifier, that is: the server identifier running the target application can be determined from one or more servers, and then the environment information of the corresponding server is read based on the server identifier and used as the operating environment information.

[0036] Among them, the server can correspond to a server identifier, such as a number, name, etc. The server identifier can be used to distinguish different servers. The corresponding server identifier can be determined by the program identifier of the target application. For example, the corresponding server identifier can be determined according to the program identifier of the target application in combination with a pre-configured identifier correspondence table.

[0037] After determining the server identifier of the server on which the target application is running based on the program identifier, the hardware resource configuration parameters corresponding to the server identifier can be obtained, and the hardware resource configuration parameters can be used as the operating environment information. In some other embodiments, the software resource configuration parameters corresponding to the server identifier can also be obtained and used as the operating environment information, and there is no limitation on this.

[0038] In some embodiments, the hardware resource configuration parameters may be the full amount of hardware configuration parameters of the server, such as but not limited to: the number of cores of the central processing unit (CPU), disk size, disk type (including hard disk drive (HDD protocol), solid state drives with host controller interface and storage protocol (NVMExpress, NVME protocol), serial bus Serial ATA, solid state drives with SATA protocol), memory size, memory frequency and other parameters. In addition, the hardware resource configuration parameters may also include any other possible parameters, which are not specifically limited here.

[0039] In other embodiments, for example, the hardware resource configuration parameters can be obtained through class library methods of the computer programming language Java itself, such as Runtime.getRuntime().availableProcessors(), and combined with the return judgment statement Process pos=Runtime.getRuntime().exec("server command line") of the Java execution server command line, or the hardware resource configuration parameters can be obtained through any other possible way, which is not specifically limited here.

[0040] By determining the server identifier of the server on which the target application is running based on the program identifier, and obtaining the hardware resource configuration parameters corresponding to the server identifier, and using the hardware resource configuration parameters as the operating environment information, it is possible to quickly obtain the operating environment information corresponding to the program identifier, and enable the target application used to parse files to avoid being restricted by the hardware resource configuration parameters, which can effectively assist in expanding the deployment scenarios of the application and ensure the efficiency of file parsing.

[0041] It is understandable that the above example is only an illustrative description of obtaining the operating environment information. In actual applications, any other possible manner may be used to obtain the operating environment information corresponding to the program identifier, which is not specifically limited here.

[0042] S103: Generate a target thread model that matches the execution environment information.

[0043] Among them, the thread model refers to a multi-thread pool related model in a development language that supports multi-threading. The thread model can be applied to file parsing. For example, the thread model can be called based on the target application to realize parallel processing of files, etc., without any restriction.

[0044] The thread model that matches the operating environment information can be called a target thread model. That is, after obtaining the operating environment information, the embodiment of the present disclosure can refer to the operating environment information to generate a target thread model that matches the operating environment information.

[0045] S104: Parse the file according to the target thread model.

[0046] After the target thread model is determined, the target thread model can be called based on the target application to support parsing of the file.

[0047] For example, the encrypted bill file may be read first, and then the encrypted bill file may be decrypted and parsed step by step according to the target thread model to obtain the bill content.

[0048] The disclosed embodiments, by determining the program identifier of a target application, wherein the target application is used to parse files, and obtaining operating environment information corresponding to the program identifier, and generating a target thread model that matches the operating environment information, and parsing the file according to the target thread model, can adapt the application's parsing processing logic for files to the environment in which it runs, thereby effectively improving the application's file parsing performance, and making the application used to parse files portable, thereby reducing the operation and maintenance costs of deploying multiple operating environments.

[0049] Figure 2 It is a flowchart of a file parsing method according to the second embodiment of the present disclosure.

[0050] like Figure 2 As shown, the file parsing method includes:

[0051] S201: Determine a program identifier of a target application, wherein the target application is used to parse a file.

[0052] S202: Determine the server identifier of the server on which the target application program runs according to the program identifier.

[0053] S203: Acquire hardware resource configuration parameters corresponding to the server identifier, and use the hardware resource configuration parameters as operating environment information.

[0054] The description of S201 - S203 can be specifically referred to the above embodiment, which will not be repeated here.

[0055] S204: Acquire an initial thread model, where the initial thread model includes: multiple thread parameters.

[0056] After the operating environment information is determined, the embodiment of the present disclosure can obtain an initial thread model, wherein the initial thread model includes: a plurality of thread parameters.

[0057] Among them, a thread model with initial thread parameters can be called an initial thread model. For example, a thread model with empty parameter values ​​of multiple thread parameters can be called an initial thread model.

[0058] Among them, multiple thread parameters can be shown in Table 1:

[0059] Table 1

[0060] Serial number name type meaning 1 corePoolSize int Core thread pool size 2 maximumPoolSize int Maximum thread pool size 3 keepAliveTime long Maximum thread idle time 4 unit TimeUnit Time Unit 5 workQueue BlockingQueue <runnable> < / runnable> Thread waiting queue 6 threadFactory ThreadFactory Thread Creation Factory 7 handler RejectedExecutionHandler Rejection Strategy

[0061] As shown in Table 1, multiple thread parameters include, for example but not limited to, core thread pool size corePoolSize, maximum thread pool size maximumPoolSize, thread maximum idle time keepAliveTime, time unit unit, thread waiting queue workQueue, thread creation factory threadFactory, and rejection strategy handler, etc.

[0062] In the initial thread model of the embodiment of the present application, the above-mentioned multiple thread parameters may be empty.

[0063] S205: Determine a plurality of target thread parameter values ​​corresponding to the plurality of thread parameters respectively according to the hardware resource configuration parameter.

[0064] Among them, the parameter value corresponding to each thread parameter determined according to the hardware resource configuration parameters can be called the target thread parameter value. The present invention can determine different target thread parameter values ​​according to different hardware resource configuration parameters, and then support the target application to load the target thread model adapted to the hardware resource configuration parameters of the server running itself.

[0065] In combination with the multiple thread parameters in the above-mentioned initial thread model, the embodiment of the present disclosure supports determining multiple target thread parameter values ​​corresponding to the multiple thread parameters respectively according to the hardware resource configuration parameters, that is, determining the actual parameter values ​​of the thread parameters in the initial thread model.

[0066] In some embodiments, when determining multiple target thread parameter values ​​corresponding to multiple thread parameters respectively according to hardware resource configuration parameters, the multiple target thread parameter values ​​may be determined by rule matching or model calculation.

[0067] For example, an embodiment of the present disclosure may provide a mapping relationship table between hardware resource configuration parameters and thread parameter values. When determining multiple target thread parameter values ​​corresponding to multiple thread parameters, a rule matching method may be used to determine the target thread parameter values ​​from the mapping relationship table based on the hardware resource configuration parameters.

[0068] Alternatively, a model calculation method may be used, such as using a pre-trained artificial intelligence-based model, inputting hardware resource configuration parameters, and outputting corresponding multiple target thread parameter values. In addition, multiple target thread parameter values ​​may be determined in any other possible manner, which is not specifically limited here.

[0069] S206: assigning the multiple target thread parameter values ​​to the corresponding multiple thread parameters respectively to obtain a target thread model.

[0070] After the multiple target thread parameter values ​​are determined, the multiple target thread parameter values ​​can be assigned to the corresponding multiple thread parameters respectively, so that the thread model after the assignment is used as the target thread model.

[0071] In some embodiments, for example, a target thread model can be obtained by assigning the initial parameter values ​​in the above-mentioned initial thread model using multiple target thread parameter values. Since the target thread parameter values ​​are determined according to the hardware resource configuration parameters, the obtained target thread model can be adapted to the hardware resource configuration parameters, thereby improving the file parsing efficiency and the file parsing effect.

[0072] It is understandable that the above example is only an illustrative description of how to obtain the target thread model. In actual applications, the target thread model can also be obtained in any other possible manner, which is not specifically limited here.

[0073] S207: Obtain parsing configuration parameters corresponding to the file.

[0074] Configuration parameters related to the file parsing processing logic may be referred to as parsing configuration parameters, and the parsing configuration parameters may be configured in advance with reference to business scenario requirements of file parsing.

[0075] For example, the parsing configuration parameters are shown in Table 2:

[0076] Table 2

[0077] Serial number name type meaning 1 batchSize int Number of entries submitted in batches 2 Pages int The number of pages to split the file into 3 PageSize long Total number of pages after splitting the file

[0078] In conjunction with Table 2, the parsing configuration parameters include, but are not limited to, the number of batch submissions (batchSize), the number of pages for file segmentation (Pages), and the total number of file pages after segmentation (PageSize). In addition, parameters such as file size and number of file lines may also be included, which are not specifically limited here.

[0079] In some embodiments, if the target application has configured parsing configuration parameters, that is, the server on which the target application is mounted can pre-configure the corresponding parsing configuration parameters locally, then it indicates that the target application has configured parsing configuration parameters, and the parsing configuration parameters can be directly obtained and used as the corresponding parsing configuration parameters.

[0080] In other embodiments, if the target application does not have configured parsing configuration parameters, the parsing configuration parameters are generated based on the hardware resource configuration parameters in combination with the parsing business scenario requirements, that is, the parsing configuration parameters are generated in combination with the hardware resource configuration parameters and the actual application scenario, so that the parsing configuration parameters can be flexibly obtained and adapted to the hardware resource configuration parameters to meet the requirements of the parsing business scenario.

[0081] S208: Generate a target parsing model that matches the parsing configuration parameters.

[0082] Among them, the parsing model includes the parameters and structures set when the program of the parsing file is executed, which can help integrate business scenario requirements into the parsing processing logic.

[0083] Among them, the parsing model adapted to the business scenario requirements of file parsing in the embodiment of the present application can be called a target parsing model. When obtaining the parsing configuration parameters, the encryption and decryption algorithm corresponding to the file can also be obtained, and then the target parsing model is generated according to the parsing configuration parameters and the encryption and decryption algorithm to assist the file parsing operation.

[0084] Optionally, in some embodiments, when generating a target parsing model that matches the parsing configuration parameters, an initial parsing model may be obtained, where the initial parsing model includes: a plurality of parsing parameters.

[0085] Among them, the parsing model can be used to assist in file parsing, such as segmenting files, submitting them in batches, and calculating the number of pages of files after segmentation.

[0086] A parsing model with initial parsing parameters can be called an initial parsing model. For example, a parsing model with empty parameter values ​​of multiple parsing parameters can be called an initial parsing model. That is to say, multiple parsing parameters included in the initial parsing model can be empty values.

[0087] Furthermore, a plurality of target parsing parameter values ​​respectively corresponding to the plurality of parsing parameters may be determined according to the parsing configuration parameters.

[0088] Among them, the parsing parameter value determined according to the parsing configuration parameters can be called the target parsing parameter value. That is to say, the present invention can generate a target parsing model that is adapted to the business scenario requirements according to the parsing configuration parameters corresponding to the business scenario requirements of file parsing, thereby parsing the file based on the target parsing model combined with the above-mentioned target thread model.

[0089] In some embodiments, for example, multiple target parsing parameter values ​​may be determined by rule matching or model calculation.

[0090] For example, the embodiments of the present disclosure may provide a mapping relationship table between parsing configuration parameters and parsing parameter values. When determining multiple target parsing parameter values ​​corresponding to multiple parsing parameters, a rule matching method may be adopted to determine multiple target parsing parameter values ​​corresponding to multiple parsing parameters according to the parsing configuration parameters.

[0091] Alternatively, a model calculation method may be used, such as using a pre-trained artificial intelligence-based model, inputting parsing configuration parameters, and outputting corresponding multiple target parsing parameter values. In addition, multiple target parsing parameter values ​​may be determined in any other possible manner, which is not specifically limited here.

[0092] Further, multiple target parsing parameter values ​​are assigned to corresponding multiple parsing parameters to obtain a target parsing model. For example, multiple target parsing parameter values ​​are used to assign corresponding multiple parsing parameters in the above-mentioned initial parsing model to obtain a target parsing model. By determining the target parsing parameter values ​​according to the parsing configuration parameters, the model parameters of the target parsing model can be adapted to the file parsing, which is beneficial for subsequent auxiliary file parsing operations.

[0093] S209: Parse the file according to the target thread model and the target parsing model.

[0094] Furthermore, the file is parsed according to the target thread model and the target parsing model. For example, according to the above-mentioned target thread model and the target parsing model, the encrypted bill file is decrypted and parsed step by step to obtain the bill content.

[0095] In addition, this embodiment can also record the execution results and model parameters under the current model, and calculate the execution efficiency of various models, so as to analyze the overall parsing performance.

[0096] Optionally, in some embodiments, if the target application has configured parsing configuration parameters, the target thread model and the target parsing model are updated according to the configured parsing configuration parameters. That is to say, the disclosed embodiments also support updating the target thread model and the target parsing model, thereby reducing the consumption of software and hardware resources for model generation, facilitating the reuse of the target thread model and the target parsing model, and improving file parsing efficiency.

[0097] In practical applications, the target thread model and target parsing model of the disclosed embodiment also support manual configuration, for example, a configuration center may be provided, which is used to store manually configured parameters. A manual configuration may be pulled from the configuration center once, and if the manual configuration is not configured, the target thread model and target parsing model are generated according to the relevant parameters obtained by startup loading; if the configuration center stores the parameters for manually configuring the thread model, the target thread model and target parsing model may be updated using the parameters of the configuration center. In addition, the target thread model and target parsing model may be manually adjusted according to actual needs.

[0098] The disclosed embodiment, by determining the program identifier of the target application, wherein the target application is used to parse the file, and obtains the operating environment information corresponding to the program identifier, and generates a target thread model that matches the operating environment information, and parses the file according to the target thread model, can make the application's parsing processing logic for the file adapt to the environment in which it runs, thereby effectively improving the application's parsing performance for the file, and making the application used for parsing the file portable, reducing the operation and maintenance costs of multiple operating environment deployments. In addition, the disclosed embodiment can determine different target thread parameter values ​​according to different hardware resource configuration parameters, and can further support the target application to load the target thread model that is adapted to the hardware resource configuration parameters of the server on which it runs. Furthermore, it can also reduce the consumption of software and hardware resources for model generation, facilitate the reuse of the target thread model and the target parsing model, and improve the efficiency of file parsing.

[0099] Figure 3 is a schematic diagram of a file parsing device according to the third embodiment of the present disclosure.

[0100] like Figure 3 As shown, the file parsing device 30 includes:

[0101] A determination module 301 is used to determine a program identifier of a target application, wherein the target application is used to parse a file; a first acquisition module 302 is used to obtain operating environment information corresponding to the program identifier; a generation module 303 is used to generate a target thread model that matches the operating environment information; and a parsing module 304 is used to parse the file according to the target thread model.

[0102] Optionally, in some embodiments, Figure 4 As shown, Figure 4 It is a schematic diagram of a file parsing device according to the fourth embodiment of the present disclosure, and the first acquisition module 302 includes: a first determination submodule 3021, used to determine the server identifier of the server on which the target application is running according to the program identifier; a first acquisition submodule 3022, used to obtain hardware resource configuration parameters corresponding to the server identifier, and use the hardware resource configuration parameters as operating environment information.

[0103] Optionally, in some embodiments, Figure 4 As shown, the generation module 303 includes: a second acquisition sub-module 3031, used to obtain an initial thread model, the initial thread model includes: multiple thread parameters; a second determination sub-module 3032, used to determine multiple target thread parameter values ​​corresponding to the multiple thread parameters according to hardware resource configuration parameters; an assignment sub-module 3033, used to assign the multiple target thread parameter values ​​to the corresponding multiple thread parameters, so as to obtain a target thread model.

[0104] Optionally, in some embodiments, Figure 4 As shown, the device 30 also includes: a second acquisition module 305, used to obtain an initial thread model, the initial thread model includes: multiple thread parameters; a parsing module 304, including: a generation submodule 3041, used to generate a target parsing model that matches the parsing configuration parameters; a parsing submodule 3042, used to parse the file according to the target thread model and the target parsing model.

[0105] Optionally, in some embodiments, the generating submodule 3041 is specifically used to: obtain an initial parsing model, the initial parsing model comprising: multiple parsing parameters; determine multiple target parsing parameter values ​​corresponding to the multiple parsing parameters respectively according to the parsing configuration parameters; assign the multiple target parsing parameter values ​​to the corresponding multiple parsing parameters respectively to obtain the target parsing model.

[0106] Optionally, in some embodiments, the second acquisition module 305 is specifically used to: if the target application has configured parsing configuration parameters, then use the configured parsing configuration parameters as corresponding parsing configuration parameters; if the target application does not have configured parsing configuration parameters, then generate parsing configuration parameters based on the hardware resource configuration parameters combined with the parsing business scenario requirements.

[0107] Optionally, in some embodiments, the second acquisition module 305 is specifically configured to: if the target application has configured parsing configuration parameters, update the target thread model and the target parsing model according to the configured parsing configuration parameters.

[0108] It should be noted that the above explanation of the file parsing method is also applicable to the file parsing device of this embodiment and will not be repeated here.

[0109] The disclosed embodiments, by determining the program identifier of a target application, wherein the target application is used to parse files, and obtaining operating environment information corresponding to the program identifier, and generating a target thread model that matches the operating environment information, and parsing the file according to the target thread model, can adapt the application's parsing processing logic for files to the environment in which it runs, thereby effectively improving the application's file parsing performance, and making the application used to parse files portable, thereby reducing the operation and maintenance costs of deploying multiple operating environments.

[0110] In order to implement the above embodiments, the present disclosure further proposes a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, the file parsing method proposed in the above embodiments of the present disclosure is implemented.

[0111] In order to implement the above embodiments, the present disclosure further proposes a non-temporary computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the file parsing method proposed in the above embodiments of the present disclosure is implemented.

[0112] In order to implement the above embodiments, the present disclosure further proposes a computer program product. When an instruction processor in the computer program product is executed, the file parsing method proposed in the above embodiments of the present disclosure is executed.

[0113] Figure 5 A block diagram of an exemplary computer device suitable for implementing embodiments of the present disclosure is shown. Figure 5 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0114] like Figure 5 As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).

[0115] The bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnection (PCI) bus.

[0116] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.

[0117] The memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 5 Not shown, often called a "hard drive").

[0118] although Figure 5 Not shown in the figure, a disk drive for reading and writing a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing a removable non-volatile optical disk (e.g., a compact disc read only memory (CD-ROM), a digital versatile disc read only memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the various embodiments of the present disclosure.

[0119] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28, such program modules 42 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described in the present disclosure.

[0120] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the computer device 12, and / or any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed via an input / output (I / O) interface 22. In addition, the computer device 12 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the computer device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0121] The processing unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the file parsing method mentioned in the above embodiment.

[0122] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the applications disclosed herein. The present disclosure is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0123] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

[0124] It should be noted that, in the description of the present disclosure, the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of the present disclosure, unless otherwise specified, the meaning of "plurality" is two or more.

[0125] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present disclosure includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present disclosure belong.

[0126] It should be understood that the various parts of the present disclosure can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0127] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0128] In addition, each functional unit in each embodiment of the present disclosure may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0129] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.

[0130] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0131] Although the embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present disclosure. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present disclosure.

Claims

1. A file parsing method, characterized in that: The method comprises: determining a program identifier of a target application, wherein the target application is used to parse the file; Determining, based on the program identifier, a server identifier of a server on which the target application is running; Obtaining hardware resource configuration parameters corresponding to the server identifier; Acquire an initial thread model, the initial thread model including: a plurality of thread parameters, the thread model being called by the target application to implement parallel processing of the file; Determining, according to the hardware resource configuration parameter, a plurality of target thread parameter values ​​corresponding to the plurality of thread parameters respectively; Assigning the plurality of target thread parameter values ​​to the corresponding plurality of thread parameters respectively to obtain a target thread model; and The file is parsed according to the target thread model.

2. The method according to claim 1, characterized in that Before parsing the file according to the target thread model, the method further includes: Obtaining parsing configuration parameters corresponding to the file; Then, parsing the file according to the target thread model includes: Generating a target parsing model matching the parsing configuration parameters; The file is parsed according to the target thread model and the target parsing model.

3. The method according to claim 2, characterized in that The generating a target parsing model matching the parsing configuration parameters comprises: Acquire an initial analytical model, wherein the initial analytical model includes: a plurality of analytical parameters; Determining, according to the parsing configuration parameters, a plurality of target parsing parameter values ​​corresponding to the plurality of parsing parameters respectively; The multiple target parsing parameter values ​​are respectively assigned to the corresponding multiple parsing parameters to obtain the target parsing model.

4. The method according to claim 2, characterized in that The obtaining of the parsing configuration parameters corresponding to the file includes: If the target application has a configured parsing configuration parameter, the configured parsing configuration parameter is used as the corresponding parsing configuration parameter; If the target application does not have configured parsing configuration parameters, the parsing configuration parameters are generated according to the hardware resource configuration parameters in combination with the parsing business scenario requirements.

5. The method according to claim 4, characterized in that Also includes: If the target application has configured parsing configuration parameters, the target thread model and the target parsing model are updated according to the configured parsing configuration parameters.

6. A file parsing device, characterized in that: include: a determination module, configured to determine a program identifier of a target application, wherein the target application is used to parse the file; A first acquisition module, used to acquire the operating environment information corresponding to the program identifier; A generating module, configured to generate a target thread model matching the operating environment information; and A parsing module, used for parsing the file according to the target thread model; The first acquisition module includes: A first determination submodule, configured to determine, based on the program identifier, a server identifier of a server on which the target application is running; A first acquisition submodule is used to acquire hardware resource configuration parameters corresponding to the server identifier, and use the hardware resource configuration parameters as the operating environment information; The generating module comprises: A second acquisition submodule is used to acquire an initial thread model, wherein the initial thread model includes: a plurality of thread parameters, and the thread model is called by the target application to implement parallel processing of the file; A second determination submodule, configured to determine, according to the hardware resource configuration parameter, a plurality of target thread parameter values ​​respectively corresponding to the plurality of thread parameters; The assignment submodule is used to assign the multiple target thread parameter values ​​to the corresponding multiple thread parameters respectively to obtain the target thread model.

7. The device according to claim 6, characterized in that The device also includes: A second acquisition module, used to acquire parsing configuration parameters corresponding to the file; The parsing module comprises: A generation submodule, used to generate a target parsing model matching the parsing configuration parameters; The parsing submodule is used to parse the file according to the target thread model and the target parsing model.

8. The device according to claim 7, characterized in that The generating submodule is specifically used for: Acquire an initial analytical model, wherein the initial analytical model includes: a plurality of analytical parameters; Determining, according to the parsing configuration parameters, a plurality of target parsing parameter values ​​corresponding to the plurality of parsing parameters respectively; The multiple target parsing parameter values ​​are respectively assigned to the corresponding multiple parsing parameters to obtain the target parsing model.

9. The device according to claim 7, characterized in that The second acquisition module is specifically used for: If the target application has a configured parsing configuration parameter, the configured parsing configuration parameter is used as the corresponding parsing configuration parameter; If the target application does not have configured parsing configuration parameters, the parsing configuration parameters are generated according to the hardware resource configuration parameters in combination with the parsing business scenario requirements.

10. The device according to claim 9, characterized in that The second acquisition module is specifically used for: If the target application has configured parsing configuration parameters, the target thread model and the target parsing model are updated according to the configured parsing configuration parameters.

11. A computer 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 method according to any one of claims 1 to 5.

12. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-5.