CN115469917A - File processing method, device, equipment and storage medium - Google Patents

File processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN115469917A
CN115469917A CN202211008616.4A CN202211008616A CN115469917A CN 115469917 A CN115469917 A CN 115469917A CN 202211008616 A CN202211008616 A CN 202211008616A CN 115469917 A CN115469917 A CN 115469917A
Authority
CN
China
Prior art keywords
file
target
bytecode
initial
function configuration
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211008616.4A
Other languages
Chinese (zh)
Inventor
董磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202211008616.4A priority Critical patent/CN115469917A/en
Publication of CN115469917A publication Critical patent/CN115469917A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3089Monitoring arrangements determined by the means or processing involved in sensing the monitored data, e.g. interfaces, connectors, sensors, probes, agents
    • G06F11/3093Configuration details thereof, e.g. installation, enabling, spatial arrangement of the probes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Quality & Reliability (AREA)
  • Computer Security & Cryptography (AREA)
  • Mathematical Physics (AREA)
  • Stored Programmes (AREA)

Abstract

The disclosure relates to a file processing method, a file processing device, a file processing equipment and a storage medium, relates to the technical field of computers, and can improve the efficiency of a program configuration dotting monitoring function. The file processing method comprises the following steps: acquiring an initial byte code file; determining a target function configuration program corresponding to the initial byte code file; the target function configuration program is used for configuring the byte codes corresponding to the preset monitoring function for the initial byte code file; calling a target function configuration program to execute modification operation on the initial byte code file to obtain a corresponding target byte code file; the target bytecode file is configured with a preset monitoring function.

Description

File processing method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a file processing method, apparatus, device, and storage medium.
Background
Currently, in order to ensure the performance (such as efficiency and stability) of a program during running, it is often necessary to acquire running information of the program during actual running, so as to monitor whether the program meets an expected requirement during actual running, and when the program does not meet the expected requirement, a related processing measure may be further taken. When obtaining the running information of the program in the actual running process, generally, a mode of performing dotting monitoring on the program is considered. The dotting monitoring means that when the program runs to a specified point, information acquisition operation is automatically triggered to acquire running information of the program at the point.
In the related art, when implementing dotting monitoring on a program, it is common that a developer manually adds source code for dotting monitoring in the source code of the program in a source code writing stage of the program. Therefore, in the subsequent program running process, the dotting monitoring of the program can be realized. However, this method relying on manual source code addition requires a developer to rewrite a whole set of source code when performing dotting monitoring for a large number of existing software tools, which is time-consuming, labor-consuming, and inefficient.
Disclosure of Invention
The present disclosure provides a file processing method, apparatus, device, and storage medium, which can improve efficiency of configuring additional functions for a program.
The technical scheme of the embodiment of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, there is provided a file processing method, including: acquiring an initial byte code file; determining a target function configuration program corresponding to the initial byte code file; the target function configuration program is used for configuring the byte codes corresponding to the preset monitoring function for the initial byte code file; calling a target function configuration program to execute modification operation on the initial byte code file to obtain a corresponding target byte code file; the target bytecode file is configured with a preset monitoring function.
Optionally, the file processing method further includes: acquiring a plurality of function configuration programs; the plurality of functional configuration programs are generated in response to a compilation operation; the plurality of function configuration programs include a target function configuration program; each function configuration program is used for configuring byte codes corresponding to the preset monitoring function for byte code files of at least one type; the byte code file of at least one type is used for generating an instantiation object of at least one built-in middleware or at least one third-party middleware; and storing a plurality of function configuration programs in a data file of a preset type.
Optionally, the specific method for obtaining the initial bytecode file includes: acquiring a bytecode file to be instantiated from a virtual machine; and determining the acquired bytecode file to be instantiated as an initial bytecode file.
Optionally, target parameters are pre-configured in the virtual machine; the target parameters are used for identifying data files of preset types; the specific method for determining the target function configuration program corresponding to the initial bytecode file comprises the following steps of: determining the type identification of the initial byte code file; determining a preset type of data file according to the target parameters, and acquiring a plurality of function configuration programs from the preset type of data file; and determining the function configuration program matched with the type identifier in the plurality of function configuration programs as a target function configuration program.
Optionally, the specific method for calling the target function configuration program to perform a modification operation on the initial bytecode file to obtain a corresponding target bytecode file includes: calling a target function configuration program, and adding the byte codes corresponding to the preset monitoring function at the preset position of the initial byte code file to obtain a target byte code file; the preset positions include a start position and an end position of the initial bytecode file.
Optionally, the file processing method further includes: executing instantiation operation on the target bytecode file to obtain a target instantiation object; running the target instantiation object to obtain monitoring information corresponding to a preset monitoring function; the monitoring information includes runtime information of the target instantiation object.
Optionally, the file processing method further includes: receiving a request message for accessing a target resource; the target resource is realized by operating an instantiation object of the bytecode file to be instantiated; determining a class loader corresponding to a bytecode file to be instantiated; and calling a class loader, and loading the bytecode file to be instantiated into the virtual machine.
According to a second aspect of the embodiments of the present disclosure, there is provided a file processing apparatus including: the device comprises an acquisition unit, a determination unit and a calling unit; the acquisition unit is used for acquiring an initial byte code file; a determining unit, configured to determine a target function configuration program corresponding to the initial bytecode file; the target function configuration program is used for configuring the byte codes corresponding to the preset monitoring function for the initial byte code file; the calling unit is used for calling a target function configuration program to execute modification operation on the initial byte code file to obtain a corresponding target byte code file; the target bytecode file is configured with a preset monitoring function.
Optionally, the file processing method further includes: a storage unit; the acquisition unit is also used for acquiring a plurality of function configuration programs; the plurality of functional configuration programs are generated in response to a compilation operation; the plurality of function configuration programs include a target function configuration program; each function configuration program is used for configuring byte codes corresponding to the preset monitoring function for byte code files of at least one type; the byte code file of at least one type is used for generating an instantiation object of at least one built-in middleware or at least one third-party middleware; the storage unit is used for storing a plurality of function configuration programs in a data file of a preset type.
Optionally, the obtaining unit is specifically configured to: acquiring a bytecode file to be instantiated from a virtual machine; and determining the acquired bytecode file to be instantiated as an initial bytecode file.
Optionally, target parameters are pre-configured in the virtual machine; the target parameters are used for identifying data files of preset types; a determination unit, specifically configured to: determining the type identification of the initial byte code file; determining a preset type of data file according to the target parameters, and acquiring a plurality of function configuration programs from the preset type of data file; and determining the function configuration program matched with the type identifier in the plurality of function configuration programs as a target function configuration program.
Optionally, the calling unit is specifically configured to: calling a target function configuration program, and adding a byte code corresponding to a preset monitoring function at a preset position of the initial byte code file to obtain a target byte code file; the preset positions include a start position and an end position of the initial bytecode file.
Optionally, the file processing method further includes: a processing unit and an operating unit; the processing unit is used for executing instantiation operation on the target bytecode file to obtain a target instantiation object; the operation unit is used for operating the target instantiation object to obtain monitoring information corresponding to a preset monitoring function; the monitoring information includes runtime information of the target instantiation object.
Optionally, the file processing method further includes: a receiving unit; a receiving unit configured to receive a request message for accessing a target resource; the target resource is realized by operating an instantiation object of the bytecode file to be instantiated; the determining unit is further used for determining a class loader corresponding to the bytecode file to be instantiated; and the calling unit is also used for calling the class loader and loading the bytecode file to be instantiated into the virtual machine.
According to a third aspect of embodiments of the present disclosure, there is provided an electronic device, which may include: a processor and a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement any one of the optional file processing methods of the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium having stored thereon instructions, which, when executed by a processor of an electronic device, enable the electronic device to perform any one of the above-mentioned optional file processing methods of the first aspect.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product, which includes computer instructions that, when run on a processor of an electronic device, cause the electronic device to perform the file processing method according to any one of the optional implementations of the first aspect.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
based on any one of the above aspects, in the present disclosure, the electronic device may obtain an initial bytecode file, and determine a target function configuration program corresponding to the initial bytecode file. Because the target function configuration program can add the bytecode with the preset monitoring function in the initial bytecode file, the electronic equipment can call the target function configuration program to modify the initial bytecode file so as to obtain the target bytecode file with the preset monitoring function. Therefore, compared with the mode of manually adding the source code to configure the dotting monitoring function in the general technology, the method and the device can call the target function configuration program to add the bytecode of the dotting monitoring function to the initial bytecode file after the initial bytecode file is generated, so that the problem of low efficiency caused by manually adding the source code when the dotting monitoring function is configured for a large number of programs is solved. Therefore, the efficiency of configuring the dotting monitoring function for the program can be improved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a schematic diagram illustrating a structure of a document processing system according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a terminal provided in an embodiment of the present disclosure;
FIG. 3 is a flowchart illustrating a file processing method according to an embodiment of the disclosure;
FIG. 4 is a flowchart illustrating a further file processing method provided by an embodiment of the disclosure;
FIG. 5 is a flowchart illustrating a further file processing method provided by an embodiment of the disclosure;
FIG. 6 is a flow chart illustrating an execution sequence of functions provided by an embodiment of the present disclosure;
FIG. 7 is a flowchart illustrating another file processing method provided by an embodiment of the disclosure;
FIG. 8 is a flowchart illustrating a further file processing method provided by an embodiment of the disclosure;
FIG. 9 is a flowchart illustrating a further file processing method provided by an embodiment of the disclosure;
FIG. 10 is a flowchart illustrating another file processing method provided by an embodiment of the disclosure;
fig. 11 is a schematic flowchart illustrating an interface registration method according to an embodiment of the present disclosure;
FIG. 12 is a flowchart illustrating a further file processing method provided by an embodiment of the disclosure;
FIG. 13 is a flowchart illustrating a further file processing method provided by an embodiment of the disclosure;
FIG. 14 is a flow chart illustrating a further process for executing a program provided by an embodiment of the present disclosure;
FIG. 15 is a schematic structural diagram of another document processing apparatus provided in an embodiment of the present disclosure;
fig. 16 is a schematic structural diagram of another terminal provided in the embodiment of the present disclosure;
fig. 17 shows a schematic structural diagram of a server provided in an embodiment of the present disclosure.
Detailed Description
In order to make the technical solutions of the present disclosure better understood, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing drawings are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below do not represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
The data to which the present disclosure relates is data that is authorized by a user or sufficiently authorized by parties.
In the general technology, when dotting on a program is realized, usually in a source code writing stage of the program, a developer manually adds source code for dotting in the source code of the program. In this way, in the subsequent program running process, dotting on the program can be realized. However, this method of manually adding source code is inefficient in that a developer needs to rewrite a whole set of source code when a large number of existing software tools are checked.
Based on this, an embodiment of the present disclosure provides a file processing method, where an electronic device may obtain an initial bytecode file and determine a target function configuration program corresponding to the initial bytecode file. Because the target function configuration program can add the bytecode with the preset monitoring function in the initial bytecode file, the electronic equipment can call the target function configuration program to modify the initial bytecode file so as to obtain the target bytecode file with the preset monitoring function. Thus, compared with the mode of manually adding the source code to configure the dotting monitoring function in the general technology, the method and the device can configure the bytecode with the dotting monitoring function for the bytecode of the program through the electronic equipment, so that the problem of low efficiency caused by manually adding the source code when configuring the dotting monitoring function for a large number of programs is solved. Therefore, the efficiency of configuring the dotting monitoring function for the program can be improved.
Fig. 1 is a schematic diagram of a document processing system according to an embodiment of the disclosure, and as shown in fig. 1, the functional configuration system 100 may include: electronic device 101, first terminal 102 and second terminal 103. The electronic device 101 and the first terminal 102 are communicatively connected. The electronic device 101 and the second terminal 103 are communicatively connected.
The electronic device 101 in fig. 1 may be a server of a world wide Web application, may be configured with bytecode files that support various built-in middleware and third-party middleware required by the Web application to complete a specific task, and may be configured with a Virtual Machine (JVM), various class loaders, various Web components (Web components), and the like. The Web application is an application that can be accessed through the Web, and may be an application such as a short video application, a live service application, a shopping service application, and a takeaway service application. In practical applications, the Web application may be composed of a plurality of servlets (Server applets, servlets), java Server Pages (JSPs), image files, and the like. When receiving the resource access request sent by the first terminal 102, the electronic device 101 may invoke corresponding middleware or the like to implement the resource accessed by the first terminal 102.
The electronic device 101 may be a single server, or may be a server cluster including a plurality of servers. In some embodiments, the server cluster may also be a distributed cluster. The present disclosure is also not limited to a specific implementation of the server.
The first terminal 102 in fig. 1 may be a terminal that facilitates a user to initiate various resource access requests (e.g., web application access requests).
The second terminal 103 in fig. 1 may be a terminal configured with a programming platform (e.g., eclipse and Edit Plus) for a developer to write source code and the like regarding a function configuration program.
The first terminal 102 or the second terminal 103 may be a mobile phone, a tablet computer, a desktop computer, a laptop computer, a handheld computer, a notebook computer, an ultra-mobile personal computer (UMPC), a netbook, a cellular phone, a Personal Digital Assistant (PDA), an Augmented Reality (AR) \ Virtual Reality (VR) device, or the like, which may be installed and used for a content community application, and the present disclosure does not particularly limit the specific form of the terminal. The system can be used for man-machine interaction with a user through one or more modes of a keyboard, a touch pad, a touch screen, a remote controller, voice interaction or handwriting equipment and the like.
Optionally, in the file processing system shown in fig. 1, the first terminal 102 or the second terminal 103 may be connected to at least one electronic device, and the electronic device 101 may also be connected to more terminals. The present disclosure does not limit the number and types of the electronic device 101, the first terminal 102, and the second terminal 103.
For ease of understanding, the present disclosure is described taking the example where the electronic device 101 is connected to the first terminal 102 and the second terminal 103, respectively.
With reference to fig. 1, as shown in fig. 2, a schematic structural diagram of a second terminal 103 according to an embodiment of the present disclosure is provided. The second terminal 103 may be configured with a processing module 21, an input module 22, and a display module 23. Wherein, the processing module 21 can be used for carrying a programming platform configured by the second terminal 103. The input module 22 may be a computer external input device of a mouse and a keyboard for a developer to perform a code writing operation, etc. The display module 23 may be a liquid crystal display or the like, and is used for displaying codes or the like input by the developer through the input module 22. The communication module 24 may be a transceiver or the like for communicating with the electronic device 101.
The file processing method provided by the embodiment of the present disclosure may be applied to the electronic device 101 in the application scenario shown in fig. 1.
The following describes a document processing method provided by an embodiment of the present disclosure in detail with reference to the accompanying drawings.
As shown in fig. 3, when the file processing method is applied to an electronic device, the file processing method may include: S301-S303.
S301, the electronic equipment acquires an initial byte code file.
Specifically, the electronic device may determine a program capable of meeting a user requirement according to a resource access request of the user, and obtain an initial bytecode file of the program.
In the practical application scenario, the requirement of the user may be a requirement for processing a picture or a video, or may be other types of requirements, in conjunction with fig. 1. To initiate a resource access request, a user may perform a resource request operation on a first terminal that is related to a requirement. In response to a resource request operation performed by a user, the first terminal may send a resource access request to the electronic device. Accordingly, the electronic device may receive the resource access request sent by the first terminal. In this case, in response to the resource access request, the electronic device may determine a program for satisfying the requirement and acquire an initial bytecode file of the program. Subsequently, the electronic device may generate an instantiation object from the initial bytecode file of the program, so as to meet the requirement of the user through the instantiation object generated from the initial bytecode file.
In one possible example, the user's requirements may be requirements for processing an image. The one image may have a plurality of image layers. Accordingly, the program determined by the electronic device for processing the image may include a plurality of processes corresponding to a plurality of layers of the image. Wherein, one process is used for correspondingly processing one layer. In this way, after the electronic device obtains the initial bytecode file of the program and generates the instantiation object, a first process of the multiple processes may be used to process a first layer of the multiple layers of the image, and a second process may be used to process a second layer of the multiple layers of the image. Until the processing of the layers of the one image is completed.
S302, the electronic equipment determines a target function configuration program corresponding to the initial byte code file.
The target function configuration program is used for configuring the byte codes corresponding to the preset monitoring function for the initial byte code file.
Specifically, when the instantiation object generated by the initial bytecode file meets the user requirement, in order to enable the instantiation object generated by the initial bytecode file to have an additional preset monitoring function, the electronic device needs to configure a bytecode corresponding to the preset monitoring function for the initial bytecode file. In this case, the electronic device may determine the target function configuration program corresponding to the initial bytecode file.
In one possible manner, the preset monitoring function may be a dotting monitoring function, and may be used to obtain operation information generated during the operation of the program.
In a possible manner, the electronic device may determine, from the type identifier of the initial bytecode file, a target function configuration program matching the type identifier among the plurality of function configuration programs. Specifically, the process may be described with reference to S601 to S603 described below.
S303, the electronic equipment calls a target function configuration program to modify the initial bytecode file to obtain a corresponding target bytecode file.
Wherein, the target byte code file is configured with a preset monitoring function.
Specifically, after determining the target function configuration program corresponding to the initial bytecode file, the electronic device may call the target function configuration program to perform modification operation on the initial bytecode file, so as to obtain a target bytecode file with a preset monitoring function. Subsequently, the electronic device may generate an instantiation object of the target bytecode file to obtain an instantiation object that can simultaneously implement the function of the initial bytecode and the additional preset monitoring function.
In a possible example, with reference to the example in S301, when the preset monitoring function is the dotting monitoring function, the electronic device invokes the target function configuration program to modify the initial bytecode file, that is, after the bytecode corresponding to the dotting monitoring function is added to the preset position in the initial bytecode, the target bytecode file with the dotting monitoring function can be obtained. Therefore, after the electronic equipment generates the instantiation object of the target byte code file, when the electronic equipment processes the layers of the image one by utilizing the processes of the program, the electronic equipment can acquire the processing result, the processing time consumption and other information of each process through the dotting monitoring function, and monitor the processes.
The technical scheme provided by the embodiment at least has the following beneficial effects: from S301-S303, the electronic device may obtain the initial bytecode file and determine the target function configuration program corresponding to the initial bytecode file. Because the target function configuration program can add the bytecode corresponding to the preset monitoring function in the initial bytecode file, the electronic device can call the target function configuration program to perform modification operation on the initial bytecode file to obtain the target bytecode file with the preset monitoring function. In this way, when one or more programs start running, the disclosure may configure the program with the bytecode having the preset monitoring function through the electronic device. Compared with the mode that the preset monitoring function is configured by manually adding the source code in the general technology, the method and the device can avoid the problem of low efficiency caused by manually adding the source code when the preset monitoring function is configured for a large number of programs. Therefore, the present disclosure can improve the efficiency of configuring the preset monitoring function for the program.
In one embodiment, as shown in fig. 4, in order to pre-configure a method for implementing a plurality of function configuration programs in an electronic device, the file processing method further includes: S401-S402.
S401, the electronic equipment acquires a plurality of function configuration programs.
Wherein the plurality of functional configuration programs are generated in response to a compilation operation. The plurality of function configuration programs includes a target function configuration program. Each function configuration program is used for configuring the byte codes corresponding to the preset monitoring functions for the byte code files of at least one type. The bytecode file of at least one type is used for generating instantiation objects of at least one built-in middleware or at least one third-party middleware.
Specifically, in conjunction with fig. 2, a developer may execute a code writing operation through the input module configured by the second terminal, and write a source code for implementing each function configuration program. The source code of each function configuration program may include a source code corresponding to a preset monitoring function. Accordingly, the processing module of the second terminal configuration may receive the source code written by the developer and generate the source code for implementing each functional configuration program.
Then, the developer may select a compiler through the input module configured by the second terminal and perform a compiling operation on the source code for implementing each functional configuration program. In response to the compiling operation, the processing module of the second terminal configuration may compile a source code process for implementing each functional configuration program to obtain a bytecode file for implementing each functional configuration program.
It should be understood that, since the source code for implementing each function configuration program includes the source code corresponding to the preset monitoring function, the bytecode file for implementing each function configuration program also includes the bytecode corresponding to the preset monitoring function.
Then, the developer may perform a file transmission operation directed to the electronic device through the input module configured by the second terminal. In response to the file transmission operation, the second terminal may transmit a bytecode file for implementing each functional configuration program to the electronic device. Accordingly, the electronic device may receive the bytecode file for implementing each functional configuration program from the second terminal. In this way, the electronic device acquires a plurality of function configuration programs.
In one possible approach, the at least one third-party middleware may be a class file configured by the user in the electronic device for implementing a specific function. When the specific function is realized, the third-party middleware can be composed of one class file or a plurality of class files.
It should be noted that the source code for implementing the preset monitoring function generally has a fixed template. Therefore, after writing source codes for implementing modification operations, such as source codes for specifying at least one type of bytecode file and source codes related to the configuration mode of the bytecode corresponding to the preset monitoring function, a developer can conveniently add the source codes for implementing the preset monitoring function in the source codes for implementing the modification operations. Therefore, when the preset monitoring function needs to be configured for the byte code file of at least one type, the byte code corresponding to the preset monitoring function can be automatically and efficiently added, and the byte code enhancement of the byte code file of at least one type is realized.
Therefore, no matter when the third-party middleware which cannot know the source code is faced, or when a large amount of built-in middleware which can know the source code is faced, since the plurality of function configuration programs can configure the byte codes corresponding to the preset monitoring function for the byte code files of the plurality of types, the configuration of the preset monitoring function can be realized through the function configuration programs corresponding to the types of the byte code files of the third-party middleware or the built-in middleware only by determining the types of the byte code files of the third-party middleware or the built-in middleware, the problems that the preset monitoring function cannot be configured for the third-party middleware and the preset monitoring function is configured for the large amount of built-in middleware is low in efficiency can be avoided, and the expandability and the compatibility are good.
S402, the electronic equipment stores a plurality of function configuration programs in a data file of a preset type.
Specifically, after obtaining the plurality of function configuration programs, the electronic device may register the plurality of function configuration programs as a method in a class of a preset type, and store the method in a data file of the preset type. Subsequently, the electronic device can conveniently call a plurality of function configuration programs without any adaptive change of the existing operation mechanism.
In one possible example, the class of the preset type may be a class provided in the virtual machine that may be used to modify a class file (i.e., a bytecode file).
The technical scheme provided by the embodiment at least has the following beneficial effects: as can be seen from S401-S402, in order to pre-configure a method for implementing a plurality of function configuration programs in an electronic device, the electronic device may acquire the plurality of function configuration programs and store the plurality of function configuration programs in a data file of a preset type. Therefore, the method and the device can converge a plurality of function configuration programs together, realize unified management and maintenance of the programs for configuring the preset monitoring function for the byte code files of a plurality of types, reduce labor and time cost, and facilitate the electronic equipment to call the function configuration programs, so that the preset monitoring function can be automatically and efficiently configured for all types of files including the built-in middleware and the third-party middleware.
In an embodiment, with reference to fig. 3, in S301, when the electronic device acquires the initial bytecode file, as shown in fig. 5, the present disclosure provides an implementation manner, which specifically includes: S501-S502.
S501, the electronic equipment obtains the bytecode file to be instantiated from the virtual machine.
Specifically, as described in S301, after determining the program for satisfying the user requirement, the electronic device may match the class loader to load the bytecode file of the program into the virtual machine in order to generate the instantiation object of the program. Then, before the virtual machine generates the instantiation object of the program, the electronic device may acquire the bytecode file to be instantiated of the program from the virtual machine.
In an implementation manner, the electronic device may acquire the bytecode file to be instantiated from the virtual machine by using a proxy mechanism. When the agent mechanism is adopted, the electronic device needs to add the target parameter in the virtual machine in advance, so that the bytecode file to be instantiated is obtained before the virtual machine generates the instantiation object of the bytecode file. Wherein the target parameter may be a proxy parameter.
Fig. 6 is a schematic flow chart illustrating a function execution sequence according to the present disclosure. After the proxy mechanism is introduced, that is, after the target parameters are added to the virtual machine, the bytecode file is loaded to the virtual machine by the class loader, and then the previous main function may be executed first, and then the main function may be executed. That is, the bytecode file can be snapped into the pre-master function before the instantiation object of the bytecode file is generated, i.e., before the bytecode file is instantiated.
Based on this, the electronic device may execute the pre-main function on the initial bytecode file before the virtual machine generates the instantiation object of the bytecode file, i.e., before executing the main function on the initial bytecode file. Among them, a program for realizing the relevant actions in S302 and S303 described above may be provided in advance in the pre-master function. Therefore, the electronic device can acquire the initial bytecode file to be instantiated through the proxy mechanism, and further acquire the target bytecode file.
S502, the electronic equipment determines the acquired bytecode file to be instantiated as an initial bytecode file.
In an implementation manner, after the electronic device acquires the bytecode file to be instantiated from the virtual machine, the bytecode file to be instantiated may be determined as an initial bytecode file. Subsequently, the electronic device may determine a target function configuration program corresponding to the initial bytecode file, and further obtain a target bytecode file having a preset monitoring function.
The technical scheme provided by the embodiment at least has the following beneficial effects: S501-S502 show a specific implementation manner for the electronic device to obtain the initial bytecode file. The electronic device may obtain the bytecode file to be instantiated corresponding to the program by using an agent mechanism after the virtual machine is loaded into the bytecode file of the program and before the virtual machine generates the instantiation object of the program, and determine the bytecode file to be instantiated as the initial bytecode file. In this way, the electronic device can regenerate the instantiated object corresponding to the program after configuring the bytecode corresponding to the preset monitoring function for the initial bytecode file, so as to realize the enhanced hot update based on the bytecode under the condition of no service perception and zero interruption.
In an example that can be implemented, with reference to fig. 3, in the above S302, when the electronic device determines the target function configuration program corresponding to the initial bytecode file, as shown in fig. 7, the present disclosure provides an implementation manner, which specifically includes: S601-S603.
S601, the electronic equipment determines the type identification of the initial byte code file.
It is understood that when a developer writes source code before compiling the initial bytecode, the developer usually needs to add the type identifier of the initial bytecode to a specific position (e.g. a starting position) in the source code.
Based on this, after acquiring the initial bytecode file, the electronic device may determine the type identifier of the initial bytecode file by identifying the bytecode of the initial bytecode file at a specific location.
In one possible approach, the type identification of the initial bytecode can be a class name of a class to which the initial bytecode belongs. Wherein a class is a user-defined type of reference data, also called class type. Each class contains a description of the data and a set of functions that operate on the data or pass messages. The class to which the initial bytecode belongs may be a string class, a thread class, a tool class related to mathematics, and the like.
S602, the electronic equipment determines a data file of a preset type according to the target parameters, and acquires a plurality of function configuration programs from the data file of the preset type.
It should be noted that, in combination with the description about the proxy mechanism in S501, the target parameters may be configured in advance in the virtual machine. The target parameter may be used to identify a preset type of data file. In this way, the virtual machine can establish a communication channel with the preset type of data file through the target parameters.
Specifically, under the condition that the target parameters are configured in the starting parameters of the virtual machine, the target parameters are used for identifying the data files of the preset type, which is equivalent to establishing a communication channel between the virtual machine and the data files of the preset type, so that the electronic device can determine the data files of the preset type according to the target parameters, analyze the data files of the preset type, and acquire the plurality of function configuration programs.
S603, the electronic equipment determines the function configuration program matched with the type identifier in the plurality of function configuration programs as a target function configuration program.
Specifically, after determining the type identifier of the initial bytecode file and obtaining the plurality of function configuration programs, the electronic device may perform matching among the plurality of function configuration programs according to the type identifier of the initial bytecode file, and determine the function configuration program matched with the type identifier among the plurality of function configuration programs as the target function configuration program.
The technical scheme provided by the embodiment at least has the following beneficial effects: from S601-S603, a specific implementation manner for determining, by the electronic device, the target function configuration program corresponding to the initial bytecode file is provided. After determining the type identifier of the initial bytecode file and acquiring the plurality of function configuration programs in the preset type data file according to the target parameter, the electronic device may determine a function configuration program matched with the type identifier among the plurality of function configuration programs as a target function configuration program. Therefore, the electronic equipment can configure the bytecode corresponding to the preset monitoring function for the initial bytecode file in a bytecode enhancement mode according to the target function configuration program.
In an example that can be implemented, with reference to fig. 3, in S303, when the electronic device invokes the target function configuration program to perform a modification operation on the initial bytecode file to obtain a corresponding target bytecode file, as shown in fig. 8, the present disclosure provides an implementation manner, which specifically includes: and S701.
S701, the electronic equipment calls a target function configuration program, and the byte codes corresponding to the preset monitoring function are added to the preset position of the initial byte code file to obtain a target byte code file.
The preset position may include a start position and an end position of the initial bytecode file.
Specifically, after determining the target function configuration program corresponding to the initial bytecode file, the electronic device may call the target function configuration program, and add the bytecode corresponding to the preset monitoring function to the preset position of the initial bytecode file, so as to obtain the target bytecode file. By adopting the mode of overlapping and combining the initial byte code file and the byte code corresponding to the preset monitoring function, the preset monitoring function is configured for the object generated by the initial byte code, and simultaneously, the source code before compiling the initial byte code is not changed, namely, the readability of the source code before compiling the initial byte code is not influenced.
The technical scheme provided by the embodiment at least has the following beneficial effects: as can be seen from S701, a specific implementation manner is provided in which the electronic device invokes the target function configuration program to perform a modification operation on the initial bytecode file to obtain a corresponding target bytecode file, that is, the electronic device may invoke the target function configuration program to add the bytecode corresponding to the preset monitoring function to the start position and the end position of the initial bytecode file to obtain the target bytecode file. Therefore, compared with the general technology, the method has the advantages that the method depends on the mode that developers manually add the source code of the preset monitoring function in the source code of the method, the high coupling degree between the source code of the method and the source code of the preset monitoring function can be avoided, and workers can modify and debug the source code of the method conveniently.
In an example that can be implemented, as shown in fig. 9, one way for implementing a preset monitoring function in an object generated by a target bytecode includes: S801-S802.
S801, the electronic equipment executes instantiation operation on the target bytecode file to obtain a target instantiation object.
Specifically, in combination with the description about the proxy mechanism in S501, after the bytecode corresponding to the preset monitoring function is added to the preset position of the initial bytecode file, and the target bytecode file with the preset monitoring function is generated, it indicates that the execution process of the previous main function has been completed. In this case, the target bytecode file may be reloaded into the virtual machine as an output of the previous main function. Then, the electronic device may execute the target bytecode file through a main function in the virtual machine, that is, perform instantiation operation on the target bytecode file with the preset monitoring function, so as to obtain a target instantiation object.
S802, the electronic equipment runs the target instantiation object to obtain monitoring information corresponding to the preset monitoring function.
Wherein the monitoring information may include runtime information of the target instantiation object.
It can be understood that the electronic device has already started running the target instantiation object at the same time as the target instantiation object is obtained. And in the running process of the target instantiation object, the preset monitoring function can be automatically triggered, and the running information of the target instantiation object is output. In this way, the electronic device can obtain monitoring information corresponding to the preset monitoring function.
In a possible manner, the electronic device may store the monitoring information corresponding to the preset monitoring function in a specific database, complete a data compass, and display the information through a visualization platform.
The technical scheme provided by the embodiment at least has the following beneficial effects: from the above S801 to S802, after obtaining the target bytecode file, the electronic device may perform instantiation operation on the target bytecode file to obtain a target instantiation object, and in the running process of the target instantiation object, may further obtain monitoring information corresponding to a preset monitoring function output by the target instantiation object, thereby implementing monitoring on the running process of the target instantiation object.
In an example that can be implemented, as shown in fig. 10, the file processing method provided by the present disclosure further includes: S901-S903.
S901, the electronic equipment receives a request message for accessing the target resource.
The target resource is realized by operating an instantiation object of the bytecode file to be instantiated.
Specifically, in conjunction with fig. 1, in an actual application scenario, when a user needs to process a picture or a video, etc., a request operation regarding a target resource may be performed on a first terminal. In response to a request operation performed by a user, the first terminal may transmit a request message for accessing a target resource to the electronic device. Accordingly, the electronic device may receive a request message sent by the first terminal for accessing the target resource. Subsequently, the electronic device can provide the target resource to the user to meet the user's needs.
S902, the electronic equipment determines a class loader corresponding to the bytecode file to be instantiated.
In one possible approach, after receiving a request message for accessing a target resource, the electronic device may parse the request message and determine that the target resource is a resource implemented for running an instantiation object of a bytecode file to be instantiated.
In order to generate an instantiation object of a bytecode file to be instantiated, the electronic device may determine, among a plurality of class loaders configured, a class loader corresponding to the bytecode file to be instantiated, to load the bytecode file to be instantiated into the virtual machine.
S903, the electronic equipment calls a class loader to load the bytecode file to be instantiated into the virtual machine.
In one possible approach, in order to load the bytecode file to be instantiated into the virtual machine, the electronic device may call a class loader corresponding to the bytecode file to be instantiated, and load the bytecode file to be instantiated into the virtual machine. Subsequently, the electronic device can generate an instantiation object of the bytecode file to be instantiated to provide the target resource to the user.
The technical scheme provided by the embodiment at least has the following beneficial effects: as can be seen from the foregoing S901 to S903, after receiving the request message for accessing the target resource, the electronic device may call a class loader corresponding to the bytecode file to be instantiated, so as to load the bytecode file to be instantiated into the virtual machine. In this case, before generating an instantiation object of the bytecode file to be instantiated, the electronic device may obtain the initial bytecode file, and further obtain the target bytecode file with a preset monitoring function, so as to monitor an implementation process of the target resource, ensure that the target resource can be provided to a user, and ensure user experience.
In one example that may be implemented, as shown in fig. 11, the present disclosure provides an interface registration method for implementing registration of a plurality of functional configuration programs in an electronic device. The interface registration method comprises the following steps: S1001-S1005.
S1001, the second terminal sends a configuration acquisition request to the electronic equipment.
The configuration acquisition request is used for acquiring the type information of a plurality of class files configured by the electronic equipment.
Specifically, when adding the bytecode corresponding to the preset monitoring function to the class files of different types, the adding modes to be adopted may be different. Therefore, the staff member can write source codes of a plurality of function configuration programs based on the type information of a plurality of class files configured by the electronic equipment, so as to ensure that byte codes corresponding to preset monitoring functions can be configured for the plurality of class files configured by the electronic equipment. In this case, the worker may perform the configuration acquisition operation directed to the electronic device on the second terminal. In response to the configuration acquisition operation, the second terminal may send a configuration acquisition request to the electronic device. Accordingly, the electronic device may receive a configuration acquisition request from the second terminal.
S1002, the electronic equipment sends local configuration information to the second terminal.
The local configuration information may include type information of a plurality of class files configured by the electronic device.
Specifically, after receiving the configuration acquisition request from the second terminal, the electronic device may parse the configuration acquisition request. And, in response to the configuration acquisition request, the electronic device may read the type information of the configured plurality of class files and transmit the type information of the configured plurality of class files to the second terminal. Accordingly, the second terminal may receive type information of the plurality of class files configured by the electronic device.
And S1003, the second terminal generates a byte code file for realizing a plurality of function configuration programs.
Specifically, with reference to fig. 2, after receiving the type information of the multiple class files configured by the electronic device, the second terminal may display the type information of the multiple class files through the configured display module. In this way, the developer can know the type information of the plurality of class files configured by the electronic device, and execute the code writing operation through the input module configured by the second terminal, so that the second terminal generates the byte code file for realizing the plurality of function configuration programs.
It should be understood that, a developer executes a code writing operation through the input module configured by the second terminal, so that the second terminal generates a specific implementation manner of the bytecode file for implementing the multiple function configuration programs, which may refer to the description in S401 and is not described herein again.
In combination with the foregoing step S401, when the bytecode file of one type is used to generate an instantiation object of the built-in middleware, the electronic device may determine the built-in middleware function configuration program matched with the bytecode file of one type, and then call the matched built-in middleware function configuration program to configure the bytecode corresponding to the preset monitoring function for the bytecode file of one type. When one type of bytecode file is used for generating an instantiation object of a third-party middleware, the electronic device may determine a third-party middleware function configuration program matched with the one type of bytecode file, and then call the matched third-party middleware function configuration program to configure a bytecode corresponding to a preset monitoring function for the one type of bytecode file.
And S1004, the second terminal sends byte code files for realizing a plurality of function configuration programs to the electronic equipment.
It should be understood that, for a specific implementation of S1004, reference may be made to the description in S401, and details are not described here.
S1005, the electronic device registers a plurality of interfaces corresponding to the plurality of function configuration programs one to one.
Specifically, in combination with S402, after storing a plurality of function configuration programs in a data file of a preset e type, if the functions of the plurality of function configuration programs are to be implemented in the virtual machine, the electronic device may register an interface for each function configuration program in the virtual machine. In this way, after the electronic device registers a plurality of interfaces corresponding to a plurality of function configuration programs one to one, the function configuration programs in the interfaces are called when the initial bytecode file is loaded to configure the bytecode of the preset monitoring function for the initial bytecode file, that is, to execute the function defined in the function configuration program on the initial bytecode file.
In an example that can be implemented, as shown in fig. 12, a flowchart of a file processing method provided by the present disclosure is shown. When the electronic equipment calls a byte code file of a class, class loading is triggered firstly to determine a class loader corresponding to the byte code file. The electronic device may then load the bytecode file into the virtual machine via a class loader corresponding to the bytecode file. Then, the electronic device may call a function configuration program matched with the bytecode file in the virtual machine to modify the bytecode file and configure the bytecode of the preset monitoring function for the bytecode file. Therefore, the electronic equipment can obtain the bytecode file with the preset monitoring function and generate the instantiation object of the bytecode file with the preset monitoring function, so that the initialization of the bytecode file is completed.
In an example that can be implemented, as shown in fig. 13, a flowchart of another file processing method provided by the present disclosure is shown. With reference to S301, after receiving the resource access request sent by the first terminal and used for indicating the user requirement, the electronic device may determine a program for meeting the user requirement in response to the resource access request. This procedure to meet the user's needs may also be referred to as the service in FIG. 13. Then, to start starting the service, the electronic device may call the bytecode file of the class required for starting the service, trigger class loading and call the related function configuration program to modify the bytecode file, and further complete bytecode file initialization. Therefore, the electronic equipment can start the service normally, and the user requirement is met.
In an example that can be implemented, as shown in fig. 14, a flowchart of a program running process provided by the present disclosure is shown. Referring to fig. 13, when the electronic device calls the relevant function configuration program to modify the bytecode file, the bytecode for the dotting monitoring function may be added to the bytecode file. In this way, after the electronic device normally starts the program, that is, generates the instantiation object of the bytecode file, since the bytecode file includes the bytecode of the dotting monitoring function, when the program runs to the bytecode of the dotting monitoring function, the electronic device may start to execute the dotting monitoring function, so as to obtain the relevant running information (for example, the consumed time and the return value). The program may then continue to execute.
In a possible mode, an information reporting mode may be preset in the byte code of the dotting monitoring function. That is, the developer may preset a database in which information acquired by executing the dotting monitoring function needs to be reported. Therefore, after the dotting monitoring function is executed to acquire the relevant operation information, the electronic equipment can transmit the acquired relevant operation information to a preset database. Therefore, according to the method and the device for adding the dotting monitoring function to the plurality of class files configured by the electronic equipment, after the types of the plurality of class files configured by the electronic equipment and the types of the database are obtained, the dotting monitoring function can be added to the plurality of class files configured by the electronic equipment, and information obtained by executing the dotting monitoring function can be stored in the database configured by the electronic equipment. Namely, the file processing method provided by the disclosure can perform technical optimization at the data acquisition end without changing any other system architecture. Therefore, the method and the device have good compatibility and can be adapted to various monitoring systems.
It is understood that, in practical implementation, the terminal/server according to the embodiments of the present disclosure may include one or more hardware structures and/or software modules for implementing the corresponding file processing methods, and these hardware structures and/or software modules may constitute an electronic device. Those of skill in the art will readily appreciate that the present disclosure can be implemented in hardware or a combination of hardware and computer software for performing the exemplary algorithm steps described in connection with the embodiments disclosed herein. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present disclosure.
Based on the understanding, the embodiment of the disclosure also correspondingly provides a file processing device. Fig. 15 shows a schematic structural diagram of a document processing apparatus provided by an embodiment of the present disclosure. As shown in fig. 15, the document processing apparatus may include: an acquisition unit 1101, a determination unit 1102 and a calling unit 1103. An acquisition unit 1101, a determination unit 1102 and a calling unit 1103; an obtaining unit 1101 configured to obtain an initial bytecode file; a determining unit 1102, configured to determine a target function configuration program corresponding to the initial bytecode file; the target function configuration program is used for configuring the byte codes corresponding to the preset monitoring function for the initial byte code file; a calling unit 1103, configured to call a target function configuration program to perform a modification operation on the initial bytecode file, so as to obtain a corresponding target bytecode file; the target bytecode file is configured with a preset monitoring function.
Optionally, the file processing method further includes: a storage unit 1104; an obtaining unit 1101, configured to obtain a plurality of function configuration programs; the plurality of functional configuration programs are generated in response to a compilation operation; the plurality of function configuration programs include a target function configuration program; each function configuration program is used for configuring byte codes corresponding to the preset monitoring function for byte code files of at least one type; the byte code file of at least one type is used for generating an instantiation object of at least one built-in middleware or at least one third-party middleware; a storage unit 1104 for storing a plurality of function configuration programs in a data file of a preset type.
Optionally, the obtaining unit 1101 is specifically configured to: acquiring a bytecode file to be instantiated from a virtual machine; and determining the acquired bytecode file to be instantiated as an initial bytecode file.
Optionally, target parameters are pre-configured in the virtual machine; the target parameters are used for identifying data files of preset types; the determining unit 1102 is specifically configured to: determining the type identification of the initial byte code file; determining a preset type of data file according to the target parameters, and acquiring a plurality of function configuration programs from the preset type of data file; and determining the function configuration program matched with the type identifier in the plurality of function configuration programs as a target function configuration program.
Optionally, the invoking unit 1103 is specifically configured to: calling a target function configuration program, and adding the byte codes corresponding to the preset monitoring function at the preset position of the initial byte code file to obtain a target byte code file; the preset positions include a start position and an end position of the initial bytecode file.
Optionally, the file processing method further includes: a processing unit 1105 and an execution unit 1106; the processing unit 1105 is configured to perform an instantiation operation on the target bytecode file to obtain a target instantiation object; an operation unit 1106, configured to operate the target instantiation object to obtain monitoring information corresponding to a preset monitoring function; the monitoring information includes runtime information of the target instantiation object.
Optionally, the file processing method further includes: a receiving unit 1107; a receiving unit 1107, configured to receive a request message for accessing a target resource; the target resource is realized by operating an instantiation object of the bytecode file to be instantiated; a determining unit 1102, configured to determine a class loader corresponding to a bytecode file to be instantiated; the calling unit 1103 is further configured to call a class loader, and load the bytecode file to be instantiated into the virtual machine. Preset monitoring function
As described above, the embodiments of the present disclosure may perform functional module division on the server according to the above method examples. The integrated module can be realized in a hardware form, and can also be realized in a software functional module form. In addition, it should be noted that, the division of the modules in the embodiment of the present disclosure is schematic, and is only one logic function division, and there may be another division manner in actual implementation. For example, each functional module may be divided in accordance with each function, or two or more functions may be integrated into one processing module.
Regarding the file processing apparatus in the foregoing embodiment, the specific manner in which each module performs operations and the beneficial effects thereof have been described in detail in the foregoing method embodiment, and are not described herein again.
The embodiment of the disclosure also provides a terminal, which can be a user terminal such as a mobile phone, a computer and the like. Fig. 16 shows a schematic structural diagram of a terminal provided by an embodiment of the present disclosure. The terminal, which may be a document processing device, may include at least one processor 61, a communication bus 62, a memory 63, and at least one communication interface 64.
The processor 61 may be a Central Processing Unit (CPU), a micro-processing unit, an ASIC, or one or more integrated circuits for controlling the execution of programs according to the present disclosure.
The communication bus 62 may include a path that carries information between the aforementioned components.
The communication interface 64 may be any device, such as a transceiver, for communicating with other devices or communication networks, such as a server, an ethernet, a Radio Access Network (RAN), a Wireless Local Area Network (WLAN), etc.
The memory 63 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that may store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that may store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disk read-only memory (CD-ROM) or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory may be self-contained and connected to the processing unit by a bus. The memory may also be integrated with the processing unit.
The memory 63 is used for storing application program codes for executing the disclosed solution, and is controlled by the processor 61. The processor 61 is configured to execute application program code stored in the memory 63 to implement the functions in the disclosed methods.
In a specific implementation, processor 61 may include one or more CPUs, such as CPU0 and CPU1 in fig. 16, as one embodiment.
In one implementation, the terminal may include multiple processors, such as processor 61 and processor 65 in fig. 16, for example, as an example. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-CPU) processor. A processor herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
In one implementation, the terminal may further include an input device 66 and an output device 67, as one example. The input device 66 communicates with the output device 67 and may accept user input in a variety of ways. For example, the input device 66 may be a mouse, a keyboard, a touch screen device or a sensing device, and the like. The output device 67 is in communication with the processor 61 and may display information in a variety of ways. For example, the output device 61 may be a Liquid Crystal Display (LCD), a Light Emitting Diode (LED) display device, or the like.
Those skilled in the art will appreciate that the configuration shown in fig. 16 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
The embodiment of the disclosure also provides a server. Fig. 17 shows a schematic structural diagram of a server provided by an embodiment of the present disclosure. The server may be a file processing device. The server, which may vary considerably due to configuration or performance, may include one or more processors 71 and one or more memories 72. At least one instruction is stored in the memory 72, and the at least one instruction is loaded and executed by the processor 71 to implement the file processing method provided by each of the above-mentioned method embodiments. Of course, the server may also have components such as a wired or wireless network interface, a keyboard, and an input/output interface, so as to perform input/output, and the server may also include other components for implementing the functions of the device, which are not described herein again.
The present disclosure also provides a computer-readable storage medium including instructions stored thereon, which, when executed by a processor of a computer device, enable a computer to perform the file processing method provided by the above-described illustrated embodiment. For example, the computer readable storage medium may be a memory 63 comprising instructions executable by the processor 61 of the terminal to perform the above described method. Also for example, the computer readable storage medium may be a memory 72 comprising instructions executable by a processor 71 of the server to perform the above-described method. Alternatively, the computer readable storage medium may be a non-transitory computer readable storage medium, for example, which may be a ROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
The present disclosure also provides a computer program product comprising computer instructions which, when run on an electronic device, cause the electronic device to perform the file processing method illustrated in any of the above figures 3-5, 7-10 and 12-13.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements 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.

Claims (11)

1. A method of processing a file, comprising:
acquiring an initial byte code file;
determining a target function configuration program corresponding to the initial byte code file; the target function configuration program is used for configuring the byte codes corresponding to the preset monitoring function for the initial byte code file;
calling the target function configuration program to execute modification operation on the initial bytecode file to obtain a corresponding target bytecode file; the target bytecode file is configured with the preset monitoring function.
2. The document processing method according to claim 1, further comprising:
acquiring a plurality of function configuration programs; the plurality of functional configuration programs are generated in response to a compilation operation; the plurality of function configuration programs includes the target function configuration program; each function configuration program is used for configuring byte codes corresponding to the preset monitoring function for byte code files of at least one type; the bytecode file of at least one type is used for generating an instantiation object of at least one built-in middleware or at least one third-party middleware;
and storing the plurality of function configuration programs in a preset type of data file.
3. The file processing method according to claim 2, wherein the obtaining the initial bytecode file comprises:
acquiring a bytecode file to be instantiated from a virtual machine;
and determining the acquired bytecode file to be instantiated as the initial bytecode file.
4. The file processing method according to claim 3, wherein a target parameter is pre-configured in the virtual machine; the target parameter is used for identifying the data file of the preset type; the determining the target function configuration program corresponding to the initial bytecode file includes:
determining the type identification of the initial byte code file;
determining the data files of the preset type according to the target parameters, and acquiring the plurality of function configuration programs from the data files of the preset type;
and determining the function configuration program matched with the type identifier in the plurality of function configuration programs as the target function configuration program.
5. The method of claim 1, wherein said invoking the target function configuration program to perform a modification operation on the initial bytecode file to obtain a corresponding target bytecode file, comprises:
calling the target function configuration program, and adding the byte code corresponding to the preset monitoring function at the preset position of the initial byte code file to obtain the target byte code file; the preset position comprises a starting position and an ending position of the initial byte code file.
6. The file processing method according to any one of claims 1 to 5, further comprising:
executing instantiation operation on the target bytecode file to obtain a target instantiation object;
running the target instantiation object to obtain monitoring information corresponding to the preset monitoring function; the monitoring information includes runtime information of the target instantiation object.
7. The document processing method according to claim 3, further comprising:
receiving a request message for accessing a target resource; the target resource is realized by operating the instantiation object of the bytecode file to be instantiated;
determining a class loader corresponding to the bytecode file to be instantiated;
and calling the class loader to load the bytecode file to be instantiated into the virtual machine.
8. A document processing apparatus, characterized by comprising: an acquisition unit, configured to acquire an initial bytecode file;
a determining unit, configured to determine a target function configuration program corresponding to the initial bytecode file acquired by the acquiring unit; the target function configuration program is used for configuring the byte codes corresponding to the preset monitoring function for the initial byte code file;
a calling unit, configured to call the target function configuration program determined by the determining unit to perform a modification operation on the initial bytecode file, so as to obtain a corresponding target bytecode file; the target bytecode file is configured with the preset monitoring function.
9. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the file processing method of any of claims 1-7.
10. A computer-readable storage medium having instructions stored thereon, wherein the instructions in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the file processing method of any of claims 1-7.
11. A computer program product comprising instructions which, when run on a processor of an electronic device, cause the electronic device to perform the file processing method of any of claims 1-7.
CN202211008616.4A 2022-08-22 2022-08-22 File processing method, device, equipment and storage medium Pending CN115469917A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211008616.4A CN115469917A (en) 2022-08-22 2022-08-22 File processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211008616.4A CN115469917A (en) 2022-08-22 2022-08-22 File processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115469917A true CN115469917A (en) 2022-12-13

Family

ID=84366833

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211008616.4A Pending CN115469917A (en) 2022-08-22 2022-08-22 File processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115469917A (en)

Similar Documents

Publication Publication Date Title
US11853820B2 (en) Cross-process communication method, apparatus, and device
US10191733B2 (en) Software change process orchestration in a runtime environment
CN109445841B (en) Interface document management method, device, server and storage medium
CN107153495B (en) Method and device for establishing service link between network elements
CN113448650A (en) Live broadcast function plug-in loading method, device, equipment and storage medium
KR20210040322A (en) Scheduling method and apparatus, device and storage medium
CN116932168A (en) Heterogeneous core scheduling method and device, storage medium and electronic equipment
CN115633073B (en) Micro-service calling method, electronic device, system and readable storage medium
CN111158777A (en) Component calling method and device and computer readable storage medium
CN116051031A (en) Project scheduling system, medium and electronic equipment
CN110764864A (en) Terraform-based visual resource arrangement method
CN115469917A (en) File processing method, device, equipment and storage medium
KR101418390B1 (en) system for remotely debugging an application programming and controlling method therefor
EP3872630A2 (en) Request processing method and apparatus, electronic device, and computer storage medium
CN110599112A (en) Method and device for developing and maintaining network page
CN114726905A (en) Method, device, equipment and storage medium for accessing Tbox network to Android system
CN116048600A (en) Applet function development method, device, computer equipment and storage medium
CN113326052A (en) Method and device for upgrading service component, computer equipment and storage medium
CN111857782A (en) Interface updating method and device, computer equipment and storage medium
CN105930431A (en) Method, device and system for accessing database
CN115168228A (en) Process debugging method, device, equipment and storage medium
US20240224062A1 (en) Orchestrating simulator application in wireless network
CN114385163A (en) Development method and terminal for application of MVVM (multifunction vehicle virtual machine) architecture
CN114816416A (en) Information processing method, device, equipment and storage medium
CN114942796A (en) Plug-in compiling and calling method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination