Operation request processing method and device, computer equipment and storage medium
By receiving file type and operation information, determining and calling the corresponding subroutine library, the problem of high complexity in IO program calls in traditional technology is solved, and efficient processing of diversified data is achieved.
Patent Information
- Application Number
- CN202310637228.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-31
- Publication Date
- 2024-12-03
AI Technical Summary
In traditional technology, the IO program call process is complicated and it is difficult to adapt to diverse data types and data structures, resulting in high processing complexity.
By receiving file type and operation information, determine the corresponding subroutine library, and call the target program in the subroutine library to respond to operation requests, simplifying the calling process of the program library.
It reduces the complexity of IO program calls, improves the response efficiency for different file types and operation information, and simplifies the calling process of the program library.
Smart Images

Figure CN119065746A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method, apparatus, computer device and storage medium for processing an operation request. Background Art
[0002] Generally, the field of earth science involves multidimensional data in time and space, such as multidimensional data from ground observation stations, satellite remote sensing, and numerical simulation systems. Furthermore, the basic climate data of the target location can be obtained by processing the data obtained from ground observation stations; the surface data can be obtained by processing the data obtained from satellite remote sensing.
[0003] However, the data types, application scenarios, data structures, etc. of the above data are diverse, and the input / output (IO) program called when processing these data can only be applicable to specific scenarios or specific data structures.
[0004] Therefore, the traditional technology has the problem that the IO program calling process is relatively complicated. Summary of the invention
[0005] Based on this, it is necessary to provide a method, device, computer equipment and storage medium for processing operation requests that can reduce the complexity of IO program calls in response to the above technical problems.
[0006] In a first aspect, the present application provides a method for processing an operation request. The method comprises:
[0007] Receive an operation request for a file to be processed; the operation request includes a file type and operation information of the file to be processed;
[0008] Determining a subroutine library corresponding to the file type from a pre-compiled program library according to the file type;
[0009] A target program that can respond to the operation request is determined from the subroutine library according to the operation information, and the target program is called to respond to the operation request.
[0010] In one embodiment, the operation information includes an operation type and an operation mode; and determining a target program that can respond to the operation request from the subroutine library according to the operation information includes:
[0011] Determining, from the subroutine library according to the operation type, a candidate program corresponding to the operation type;
[0012] The target program corresponding to the operation mode is determined from the candidate programs according to the operation mode.
[0013] In one embodiment, determining, according to the operation type, from the subroutine library, a candidate program corresponding to the operation type includes:
[0014] In the case where the operation type is a read operation type, obtaining a file information acquisition program and a file read operation program from the subroutine library;
[0015] The file information acquisition program and the file read operation program are used as the candidate programs.
[0016] In one embodiment, determining, according to the operation type, from the subroutine library, a candidate program corresponding to the operation type includes:
[0017] When the operation type is a write operation type, obtaining a file definition program and a file write operation program from the subroutine library;
[0018] The file definition program and the file writing program are taken as the candidate programs.
[0019] In one embodiment, determining, according to the operation type, from the subroutine library, a candidate program corresponding to the operation type includes:
[0020] In the case where the operation type is a continue-write operation type, obtaining a file information acquisition program and a file continue-write operation program from the subroutine library;
[0021] The file information acquisition program and the file continuation operation program are used as the candidate programs.
[0022] In one embodiment, determining, according to the operation type, from the subroutine library, a candidate program corresponding to the operation type includes:
[0023] In case the operation type is an update operation type, obtaining a file definition program and a file update operation program from the subroutine library;
[0024] The file information acquisition program and the file update operation program are used as the candidate programs.
[0025] In one embodiment, determining the target program corresponding to the operation mode from the candidate programs according to the operation mode includes:
[0026] In the case where the operation mode is serial processing, determining a serial operation program among the candidate programs as the target program;
[0027] In a case where the operation mode is parallel processing, a parallel operation program among the candidate programs is determined as the target program.
[0028] In one of the embodiments, the file type includes any one of a text format type and a network common data format type.
[0029] In a second aspect, the present application also provides a device for processing an operation request. The device comprises:
[0030] A receiving module, configured to receive an operation request for a file to be processed; the operation request includes a file type and operation information of the file to be processed;
[0031] A calling module, used for determining a subroutine library corresponding to the file type from a pre-compiled program library according to the file type;
[0032] The determination module is used to determine a target program that can respond to the operation request from the subroutine library according to the operation information, and call the target program to respond to the operation request.
[0033] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0034] Receive an operation request for a file to be processed; the operation request includes a file type and operation information of the file to be processed;
[0035] Determining a subroutine library corresponding to the file type from a pre-compiled program library according to the file type;
[0036] A target program that can respond to the operation request is determined from the subroutine library according to the operation information, and the target program is called to respond to the operation request.
[0037] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0038] Receive an operation request for a file to be processed; the operation request includes a file type and operation information of the file to be processed;
[0039] Determining a subroutine library corresponding to the file type from a pre-compiled program library according to the file type;
[0040] A target program that can respond to the operation request is determined from the subroutine library according to the operation information, and the target program is called to respond to the operation request.
[0041] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0042] Receive an operation request for a file to be processed; the operation request includes a file type and operation information of the file to be processed;
[0043] Determining a subroutine library corresponding to the file type from a pre-compiled program library according to the file type;
[0044] A target program that can respond to the operation request is determined from the subroutine library according to the operation information, and the target program is called to respond to the operation request.
[0045] The above-mentioned operation request processing method, device, computer equipment and storage medium, since the received operation request for the file to be processed includes the file type and operation information of the file to be processed, the subroutine library corresponding to the file type can be determined from the pre-compiled program library according to the file type of the file to be processed, so that the determined subroutine library corresponds to the file type of the file to be processed, and then the target program that can respond to the operation request can be determined from the determined subroutine library according to the operation information of the file to be processed, and the target program is called to respond to the operation request. Compared with the method in the prior art that needs to call different programs from multiple internal or external program libraries for different file types and operation information, the operation request processing method provided by the present application only needs to call a pre-compiled program library each time an operation request is received, so that the subroutine library corresponding to the file type of the file to be processed can be determined from the program library according to the file type of the file to be processed, and further the target program that can respond to the operation request can be determined in the determined subroutine library according to the operation information of the file to be processed. For operation requests of different categories and different operation information, there is no need to call different program libraries multiple times, and only one program library needs to be called to determine the target program that can respond to the operation request, thereby simplifying the program library calling process. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 An application environment diagram of a method for processing an operation request in an embodiment;
[0047] Figure 2 A flowchart of a method for processing an operation request in an embodiment;
[0048] Figure 3 A flowchart of a method for processing an operation request in another embodiment;
[0049] Figure 4 A flowchart of a method for processing an operation request in another embodiment;
[0050] Figure 5 A flowchart of a method for processing an operation request in another embodiment;
[0051] Figure 6 A flowchart of a method for processing an operation request in another embodiment;
[0052] Figure 7 A flowchart of a method for processing an operation request in another embodiment;
[0053] Figure 8 A flowchart of a method for processing an operation request in another embodiment;
[0054] Fig. 9 The present invention is an implementation process of a process group parallel processing program in one embodiment;
[0055] Fig.10 is a structural block diagram of a device for processing operation requests in one embodiment;
[0056] Fig.11 It is a structural block diagram of a device for processing operation requests in another embodiment. DETAILED DESCRIPTION
[0057] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0058] The method for processing an operation request provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown in FIG. 1 , the computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 1 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store processing data of operation requests. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for processing an operation request is implemented.
[0059] In one embodiment, Figure 2 As shown, a method for processing an operation request is provided, and the method is applied to Figure 1The computer device in the example is used to illustrate, including the following steps:
[0060] S201, receiving an operation request for a file to be processed; the operation request includes a file type and operation information of the file to be processed.
[0061] Among them, the file to be processed can be a file in the field of earth science, for example, it can be a file generated using satellite remote sensing data, or a file generated using observation data from a ground observation station. Alternatively, the file to be processed in this embodiment can also be a file in other technical fields. This embodiment does not limit the technical field corresponding to the file to be processed.
[0062] Optionally, the operation request in this embodiment may include an operation process, or may also include multiple operation processes. In this embodiment, the operation request may be any one of a read operation, a write operation, an update operation, a continue write operation, etc. The computer device may perform a read operation, a write operation, an update operation, a continue write operation, etc. on the file to be processed according to the operation request; the file type of the file to be processed includes any one of a text format type and a network common data (NetCDF) format type. It can be understood that the file type of the file to be processed may also be other file types recognizable by the computer device. This embodiment does not limit the file type of the file to be processed; wherein, the text format type refers to a computer file format consisting of several lines of characters, and the NetCDF format type is a file format that is array-oriented and suitable for the description and encoding standard of network shared data.
[0063] In this embodiment, as an optional implementation, the received operation request may also include the file name of the file to be processed, and the address number of the file to be processed may be obtained through the file name, so that the obtained operation request is stored in the form of a structure according to the address number of the file to be processed. Exemplarily, the computer device may obtain the operation request for the file to be processed input by the user through the display interface. Further, the computer device may store the obtained operation request in the structure IO_file(unit), wherein unit is the address number of the file to be processed obtained according to the file name corresponding to the operation request.
[0064] S202, determining a subroutine library corresponding to the file type from a pre-compiled program library according to the file type.
[0065] Optionally, in this embodiment, the computer device calls a pre-compiled program library by calling the program use IO_module. As an optional implementation, the pre-compiled program library can be embedded in the computer device in an embedded form, or the program library can be compiled into a dynamic or static software library and stored in the computer device, wherein the embedded type means that when the processing file needs to be operated in a specified application, the program library is called by calling the program use IO_module. Usually, the embedded program library is compiled with the target application after the corresponding data reading and writing code is added; and in the form of a dynamic or static software library, all program files in the program library can be compiled into a dynamic or static library in advance, and the program, structure variables and control parameters in the program library are called by calling the program use IO_module in the target application.
[0066] In the present embodiment, the pre-compiled program library can be obtained by pre-compiled the programs required for executing different operation requests according to the actual application requirements. The pre-compiled program library can include different subroutine libraries corresponding to various file types, and the number of subroutine libraries and the corresponding programs can be added and modified according to the application requirements of the file type. In the present embodiment, the corresponding subroutine library can be selected from the pre-compiled program library according to the file type included in the operation request. For example, if the file type included in the operation request is a text format type, the subroutine library corresponding to the text format in the program library can be determined as the required subroutine library. If the file type included in the operation request is a NetCDF format type, the subroutine library corresponding to the NetCDF format in the program library can be determined as the required subroutine library. Optionally, the pre-compiled program library can be obtained by compiling the Fortran programming language. As an optional implementation method, when compiling the program library, the gfortran compiler or the Intel compiler can be used for compilation.
[0067] Optionally, each subroutine library may further include programs such as a file opening program, a file definition program, a file writing program, a file reading program, and a file closing program. Exemplarily, a text format subroutine library may be represented as IO_ascii_mod, and the text format subroutine library may include programs such as file definition programs def_dim_ascii and def_field_ascii, a file write operation program write_ascii, a file read operation program read_ascii, and a file closing program close_ascii, wherein the file definition program def_dim_ascii is used to define the coordinate information of the data in the file to be processed, and the file definition program def_field_ascii is used to define the variable information in the file to be processed; a NetCDF format subroutine library may be represented as IO_netcdf_mod, and the NetCDF subroutine library may include programs such as file definition programs def_dim_netcdf and def_field_netcdf, a file write operation program write_netcdf, a file read operation program read_netcdf, and a file closing program close_netcdf, wherein the file definition program def_dim_netcdf is used to define the coordinate information of the data in the file to be processed, and the file definition program def_field_netcdf is used to define the variable information in the file to be processed.
[0068] S203, determining a target program that can respond to the operation request from a subroutine library according to the operation information, and calling the target program to respond to the operation request.
[0069] In this embodiment, based on the operation information of the operation request, a target program that can respond to the operation request is determined from the subroutine library, and the determined target program is called to perform operation processing on the file to be processed. After the operation is performed on the file to be processed, the file closing program is called to end all operation processes corresponding to the operation request.
[0070] Optionally, when the operation information is a read operation, the file read operation program in the subroutine library may be determined as the target program; when the operation information is a write operation, the file write operation program in the subroutine library may be determined as the target program.
[0071] It should be noted that when calling the target program to respond to an operation request, the dimension of the data and the variable type may not be considered. When compiling the above-mentioned program library, different data types, such as integer, floating point, single-precision type, double-precision type, etc., can be integrated through the class(*) class. When calling the target program to respond to an operation request, the computer device can judge the data type corresponding to the operation request through the class(*) class, obtain the data type corresponding to the current operation request, and then call the corresponding program in the program library to respond to the operation request.
[0072] In the above-mentioned operation request processing method, since the received operation request for the file to be processed includes the file type and operation information of the file to be processed, the subroutine library corresponding to the file type can be determined from the pre-compiled program library according to the file type of the file to be processed. The subroutine library determined in this way corresponds to the file type of the file to be processed, and then the target program that can respond to the operation request can be determined from the determined subroutine library according to the operation information of the file to be processed, and the target program is called to respond to the operation request. Compared with the method in the prior art that needs to call different programs from multiple internal or external program libraries for different file types and operation information, the operation request processing method provided by the present application only needs to call a pre-compiled program library each time an operation request is received, so that the subroutine library corresponding to the file type of the file to be processed can be determined from the program library according to the file type of the file to be processed, and the target program that can respond to the operation request can be further determined in the determined subroutine library according to the operation information of the file to be processed. For operation requests of different categories and different operation information, there is no need to call different program libraries multiple times, and only one program library needs to be called to determine the target program that can respond to the operation request, thereby simplifying the program library calling process.
[0073] In the above scenario of determining a target program that can respond to an operation request from a subroutine library based on operation information, the operation information may include an operation type and an operation mode. Further, a candidate program may be determined based on the operation type, and a target program may be determined based on the candidate program and the operation mode. Figure 3 As shown, the above-mentioned "determining a target program that can respond to the operation request from a subroutine library according to the operation information" in S203 includes:
[0074] S301, determining a candidate program corresponding to the operation type from a subroutine library according to the operation type.
[0075] The operation type includes any operation that needs to be performed, such as a read operation, a write operation, an update operation, and a write-once operation, which is not limited in this embodiment. Different operation types correspond to different operation programs. In this embodiment, the corresponding operation program can be determined as a candidate program from a determined subprogram library according to the operation type of the file to be processed. Each operation request corresponds to a candidate program, and each candidate program may include multiple subprograms. For example, when the candidate program is a read operation program, the candidate program may include a serial processing read operation subprogram and a parallel processing read operation subprogram.
[0076] Optionally, when the operation type is a read operation, the read operation program in the subroutine library can be determined as a candidate program; when the operation type is a write operation, the write operation program in the subroutine library can be determined as a candidate program; when the operation type is an update operation, the update operation program in the subroutine library can be determined as a candidate program; when the operation type is a continue write operation, the continue write operation type in the subroutine library can be determined as a candidate operation type.
[0077] Optionally, when compiling a program library, the operation program corresponding to the operation type in the program library may be added or modified according to the addition or modification of the operation type.
[0078] S302, determining a target program corresponding to the operation mode from candidate programs according to the operation mode.
[0079] The operation mode includes serial processing or parallel processing. Serial processing is to call corresponding programs multiple times to complete multiple processes in sequence according to the order of each process; parallel processing is to call programs at the same time to complete multiple processes.
[0080] In this embodiment, the program corresponding to the operation mode is determined as the target program according to the operation mode of the operation request, so as to respond to the above operation request using the target program. For example, when the operation type is a read operation and the operation mode is a serial operation, the serial operation program in the read program can be called from the determined subroutine library to respond to the operation request of the file to be processed.
[0081] As an optional implementation, the candidate program corresponding to the operation mode can be determined in a preset subroutine library according to the operation mode corresponding to the above operation request, and further, the target program corresponding to the operation type can be determined from the candidate programs according to the operation type corresponding to the operation request.
[0082] In this embodiment, the corresponding candidate program can be quickly determined from the subroutine library through the operation type corresponding to the operation request, so that the corresponding target program can be selected from the candidate programs according to the operation mode corresponding to the operation request. Since the candidate program is a partial program in the pre-compiled program library, and since the target program corresponding to the operation request is determined from the partial program in the pre-compiled program library, this can make the process of determining the target program corresponding to the operation request simpler and reduce the complexity of determining the target program that can respond to the operation request.
[0083] In the above scenario of determining the candidate program corresponding to the operation type from the subroutine library according to the operation type, if the operation type is a read operation, the file information acquisition program and the file read operation program can be determined as candidate programs. Figure 4 As shown, the above S301 includes:
[0084] S401, when the operation type is a read operation type, obtain a file information acquisition program and a file read operation program from a subroutine library.
[0085] In this embodiment, when performing a read operation, it is necessary to obtain the data information required for the read operation in the to-be-processed file, and the data information of the to-be-processed file can be obtained through a file information acquisition program, thereby performing a read operation on the to-be-processed file through an operation request for the to-be-processed file, the data information of the to-be-processed file, and a read operation program. Among them, the data information may include coordinate information and variable information, and further, the read operation can be performed on the to-be-processed file according to the coordinate information and the variable information. Exemplarily, each operation type can correspond to a numerical value. For example, the numerical value corresponding to the read operation can be defined as 1, so that the subroutine library can be searched according to the numerical value 1 to obtain the program corresponding to the numerical value 1, and the program corresponding to the numerical value 1 is determined as a file information acquisition program and a file read operation program.
[0086] Exemplarily, the file information acquisition program may be an IO_get_info program and an IO_get_fields program in a subroutine library; and the file read operation program may be an IO_read program in a subroutine library.
[0087] S402, taking the file information acquisition program and the file reading operation program as candidate programs.
[0088] In this embodiment, after the file information acquisition program and the read operation program are acquired according to the read operation type, the file information acquisition program and the read operation program are used as candidate programs for the read operation, thereby further determining a target program that can respond to the operation request from the candidate programs for the read operation.
[0089] In this embodiment, when the operation type is a read operation, the information that needs to be obtained when performing the read operation is fully considered, and the file information acquisition program and the file read operation program in the subroutine library are determined as candidate programs corresponding to the read operation program. Since the candidate programs are determined from the subroutine library, the complexity of determining the candidate programs is reduced and the accuracy of the candidate programs corresponding to the determined read operation programs is improved, thereby also improving the success rate of responding to operation requests.
[0090] This embodiment will explain in detail how to determine the candidate program corresponding to the operation type from the subroutine library according to the operation type when the operation type is a write operation. Figure 5 As shown, the above S301 includes:
[0091] S501, when the operation type is a write operation type, obtaining a file definition program and a file write operation program from a subroutine library.
[0092] In this embodiment, when performing a write operation, it is necessary to obtain the data information of the to-be-processed file that needs to be written, and the data information that needs to be written can be obtained through the file definition program, so that the write operation is performed on the to-be-processed file through the operation request for the to-be-processed file, the data information that needs to be written, and the write operation program, wherein the data information may include coordinate information and variable information, and further, the write operation can be performed on the to-be-processed file according to the coordinate information and the variable information. Exemplarily, each operation type can correspond to a value, for example, the value corresponding to the write operation can be defined as 2, so that the subroutine library can be searched according to the value 2, the program corresponding to the value 2 can be obtained, and the program corresponding to the value 2 is determined as the file definition program and the file write operation program.
[0093] Exemplarily, the file definition program may be an IO_def_dim program and an IO_def_field program in a subroutine library, and the file writing program may be an IO_write_axis program and an IO_write program in a subroutine library.
[0094] S502: Take the file definition program and the file writing program as candidate programs.
[0095] In this embodiment, after the file definition program and the file writing operation program are acquired according to the write operation type, the file definition program and the file writing operation program are used as candidate programs for the write operation, thereby further determining a target program that can respond to the operation request from the candidate programs for the write operation.
[0096] In this embodiment, when the operation type is a write operation type, since the information required to obtain when performing the write operation is taken into consideration in the process of determining the candidate program corresponding to the write operation, the file definition program and the file write operation program in the subroutine library are used as candidate programs for the write operation program, thereby ensuring the accuracy of the determined candidate programs corresponding to the write operation, thereby improving the success rate of responding to the operation request.
[0097] In the above scenario of determining the candidate program corresponding to the operation type from the subroutine library according to the operation type, if the operation type is a continuation operation, the file information acquisition program and the file continuation operation program can be determined as candidate programs. Figure 6 As shown, the above S301 includes:
[0098] S601, when the operation type is a continue-write operation type, obtain a file information acquisition program and a file continue-write operation program from a subroutine library.
[0099] The rewrite operation is a rewrite operation for time dimension data, and is mainly applied to files to be processed in NetCDF format.
[0100] When executing a rewrite operation, it is necessary to obtain data information for the rewrite operation. In this embodiment, the data information for the rewrite operation can be obtained through a file information acquisition program, so that the rewrite operation is performed on the processed file through an operation request for the processed file, the data information for the rewrite operation and the rewrite operation program, wherein the data information for the rewrite operation may include coordinate information and variable information, and further, the rewrite operation can be performed on the processed file according to the coordinate information and the variable information. Exemplarily, each operation type can correspond to a value. For example, the value corresponding to the rewrite operation can be defined as 3, so that the subroutine library can be searched according to the value 3 to obtain the program corresponding to the value 3, and the program corresponding to the value 3 is determined as the file information acquisition program and the file rewrite operation program.
[0101] Exemplarily, the file information acquisition program may be an IO_get_info program and an IO_get_fields program in a subroutine library; and the file continuation operation program may be an IO_overwrite program in a subroutine library.
[0102] S602: Take the file information acquisition program and the file continuation operation program as candidate programs.
[0103] In this embodiment, after the file information acquisition program and the continuation operation program are acquired according to the continuation operation type, the file information acquisition program and the continuation operation program are used as candidate programs for the continuation operation, thereby further determining a target program that can respond to the operation request from the candidate programs for the continuation operation.
[0104] In this embodiment, when the operation type is a continuation operation, since the file information acquisition program and the file continuation operation program are obtained from a subroutine library in a pre-compiled program library, the process is relatively simple, so the file information acquisition program and the file continuation operation program can be quickly used as candidate programs corresponding to the continuation operation, thereby improving the efficiency of determining the candidate programs corresponding to the continuation operation.
[0105] This embodiment will explain in detail how to determine the candidate program corresponding to the operation type from the subroutine library according to the operation type when the operation type is an update operation. Figure 7 As shown, the above S301 includes:
[0106] S701, when the operation type is an update operation type, obtain a file definition program and a file update operation program from a subroutine library.
[0107] In this embodiment, when executing the update operation, it is necessary to obtain the data information of the to-be-processed file that needs to be updated, and the data information of the to-be-processed file that needs to be updated can be obtained through the file definition program, so that the update operation is performed on the to-be-processed file through the operation request of the to-be-processed file, the data information that needs to be updated, and the update operation program, wherein the data information that needs to be updated can include coordinate information and variable information, and further, the to-be-processed file can be continued to be written according to the coordinate information and the variable information. Exemplarily, each operation type can correspond to a value, for example, the value corresponding to the update operation can be defined as 4, so that the subroutine library can be searched according to the value 4, the program corresponding to the value 4 can be obtained, and the program corresponding to the value 4 is determined as the file definition program and the file update operation program.
[0108] Optionally, the file definition program may be an IO_def_dim program and an IO_def_field program in a subroutine library, and the file update operation program may be an IO_append in a subroutine library.
[0109] S702, taking the file information acquisition program and the file update operation program as candidate programs.
[0110] In this embodiment, after the file definition program and the update operation program are acquired according to the write operation type, the file definition program and the file update operation program are used as candidate programs for the update operation, thereby further determining a target program that can respond to the operation request from the candidate programs for the update operation.
[0111] In the present embodiment, when the operation type is an update operation, the file definition program and the file update operation program corresponding to the update operation are obtained from the subroutine library in the pre-compiled program library. The acquisition process is relatively simple, that is, the process of obtaining the candidate program corresponding to the update operation is relatively simple, which improves the efficiency of determining the candidate program corresponding to the update operation and reduces the complexity of determining the candidate program corresponding to the update operation.
[0112] In the above scenario of determining the target program corresponding to the operation mode from the candidate programs according to the operation mode, the operation mode may include serial operation and parallel operation. Figure 8 As shown, the above S302 includes:
[0113] S801, when the operation mode is serial processing, determining a serial operation program among candidate programs as a target program.
[0114] Among them, serial processing refers to processing each operation process in sequence. In this embodiment, if the operation mode is serial processing, the serial operation program in the candidate program is determined as the target program, so that the target program can be used to operate the file to be processed. Optionally, the serial operation program can be represented as IO_single. For example, when there are currently 3 processes that need to perform write operations, the response can be completed by calling the serial operation program in the candidate program for 3 write operations.
[0115] S802: When the operation mode is parallel processing, a parallel operation program in the candidate programs is determined as a target program.
[0116] Wherein, parallel processing refers to calling corresponding programs to respond to multiple processes simultaneously. In this embodiment, if the operation mode is parallel processing, the parallel operation program in the candidate program can be determined as the target program, so that the target program can be used to process the to-be-processed file.
[0117] Furthermore, the parallel operation program includes each process parallel processing program, the root process parallel processing program and the process group parallel processing program. Among them, each process parallel processing program is used to operate and process each process separately; the root process parallel processing program is used to aggregate the data on each process to the root process, and the root process performs the operation and processing; Fig. 9 As shown, the process group parallel processing program is used to aggregate the data of each process group to the root process of each process group, and the root process of each process group performs operation processing. In this embodiment, when the operation mode is parallel processing, the target program can be determined from the parallel processing program of each process, the root process parallel processing program, and the process group parallel processing program according to the type of parallel processing, so as to use the target program to process the received operation request.
[0118] It should be noted that the above-mentioned parallel processing programs of each process can be represented as IO_process. As an optional implementation method, the grid information of the data to be processed on each process can be obtained by calling the grid information acquisition program IO_get_grid preset in each process processing program, and then the grid information of the data to be processed and the target program are used to respond to the operation request; the above-mentioned root process parallel processing program can be represented as IO_root, and the grid information of the data to be processed on each process can be obtained by calling the grid information acquisition program IO_get_grid and the data aggregation program IO_global_field preset in the root process processing program, and the grid data of each process is aggregated to the root process, and the target program and the aggregated grid information are used in the root process to respond to the operation request; the above-mentioned process group parallel processing program can be represented as IO_group, and the grid information of the data to be processed on each process can be obtained by calling the grid information acquisition program IO_get_grid and the data aggregation program IO_group_field preset in the process group processing program, and the data of each process is aggregated to the root processes of each process group, and the target program and the aggregated grid information are used in the root process of each process group to respond to the operation request. The grid information indicates the starting position of the data to be processed in the file to be processed and the data length of the data to be processed. It should be noted that in the subroutine library corresponding to the NetCDF format, when the root process handler is used to respond to the operation request of the read operation, the root process completes the read operation and the operation ends after the data is read. When the root process handler and the process group handler are used to perform read operations on other file format processes, after the root process completes the data reading, the read data needs to be distributed to each process.
[0119] For example, the process group handler process is as follows: Fig. 9 As shown, assuming that the operation type corresponding to the current operation request is a read operation type, Fig. 9 There are 16 processes in total, which are divided into 4 process groups. The processes with process numbers 0, 2, 8, and 10 are the root processes in each process group. The grid information of the 16 processes and 4 process groups is obtained by calling the preset grid information acquisition program IO_get_grid in the process group handler. The data aggregation program IO_group_field preset in the process group handler is called to aggregate the pending data of each process in each process group to the root process of each process group. The target program is called in the root process to write the pending data into the pending file.
[0120] In this embodiment, programs corresponding to multiple operation modes are pre-set in the program library, and the corresponding operation programs are determined as target programs according to the operation modes, so that processing efficiency can still be guaranteed when performing large-scale data reading and writing, and different data sizes can be taken into account, thereby improving the processing speed of the program library and expanding the scope of use of the program library.
[0121] An embodiment of the present disclosure is described below in conjunction with a specific operation request processing scenario. The method includes the following steps:
[0122] S1, receiving an operation request for a file to be processed; the operation request includes the file type and operation information of the file to be processed; the operation information includes the operation type and operation mode.
[0123] S2, determining a subroutine library corresponding to the file type from a pre-compiled program library according to the file type.
[0124] S3. Determine the candidate program corresponding to the operation type from the subroutine library according to the operation type. When the operation type is a read operation type, the file information acquisition program and the file read operation program in the subroutine library are used as candidate programs. When the operation type is a write operation type, the file definition program and the file write operation program in the subroutine library are used as candidate programs. When the operation type is a continue write operation type, the file information acquisition program and the file continue write operation program in the subroutine library are used as candidate programs. When the operation type is an update operation type, the file definition program and the file update operation program in the subroutine library are used as candidate programs.
[0125] S4, when the operation mode is serial processing, determining the serial operation program in the candidate programs as the target program; when the operation mode is parallel processing, determining the parallel operation program in the candidate programs as the target program.
[0126] S5, calling the target program to respond to the operation request.
[0127] In the above-mentioned method for processing operation requests, since the received operation request for the file to be processed includes the file type and operation information of the file to be processed, the subroutine library corresponding to the file type can be determined from the pre-compiled program library according to the file type of the file to be processed. The subroutine library determined in this way corresponds to the file type of the file to be processed, and then the target program that can respond to the operation request can be determined from the determined subroutine library according to the operation information of the file to be processed, and the target program is called to respond to the operation request. Compared with the method in the prior art that needs to call different programs from multiple internal or external program libraries for different file types and operation information, the method for processing operation requests provided by the present application only needs to call a pre-compiled program library each time an operation request is received, so that the subroutine library corresponding to the file type of the file to be processed can be determined from the program library according to the file type of the file to be processed, and the target program that can respond to the operation request can be further determined in the determined subroutine library according to the operation information of the file to be processed. For operation requests of different categories and different operation information, there is no need to call different program libraries multiple times, and only one program library needs to be called to determine the target program that can respond to the operation request, thereby simplifying the program library calling process.
[0128] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0129] Based on the same inventive concept, the embodiment of the present application also provides an operation request processing device for implementing the operation request processing method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in the embodiment of the one or more operation request processing devices provided below can refer to the limitations of the operation request processing method above, and will not be repeated here.
[0130] In one embodiment, Fig.10 As shown, a device for processing an operation request is provided, comprising: a receiving module 10, a calling module 11 and a determining module 12, wherein:
[0131] The receiving module 10 is used to receive an operation request for a file to be processed; the operation request includes the file type and operation information of the file to be processed.
[0132] Calling module 11, for determining the subroutine library corresponding to the file type from the pre-compiled program library according to the file type.
[0133] The determination module 12 is used to determine a target program that can respond to the operation request from the subroutine library according to the operation information, and call the target program to respond to the operation request.
[0134] The operation request processing device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0135] In one embodiment, Fig.11 As shown, the above-mentioned determination module 12 includes: a first determination unit 121 and a second determination unit 122, wherein:
[0136] The first determining unit 121 is used to determine a candidate program corresponding to the operation type from a subroutine library according to the operation type.
[0137] The second determining unit 122 is used to determine a target program corresponding to the operation mode from the candidate programs according to the operation mode.
[0138] The operation request processing device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0139] In one embodiment, the first determining unit 121 is used to obtain a file information obtaining program and a file reading operation program from a subroutine library when the operation type is a read operation type; and use the file information obtaining program and the file reading operation program as candidate programs.
[0140] The operation request processing device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0141] In one embodiment, the first determining unit 121 is configured to obtain a file definition program and a file write operation program from a subroutine library when the operation type is a write operation type; and use the file definition program and the file write operation program as candidate programs.
[0142] The operation request processing device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0143] In one embodiment, the first determining unit 121 is used to obtain a file information obtaining program and a file continuing operation program from a subroutine library when the operation type is a continuing operation type; and use the file information obtaining program and the file continuing operation program as candidate programs.
[0144] The operation request processing device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0145] In one embodiment, the first determining unit 121 is used to obtain a file definition program and a file update operation program from a subprogram library when the operation type is an update operation type; and to use the file information acquisition program and the file update operation program as candidate programs.
[0146] The operation request processing device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0147] In one embodiment, the first determining unit 122 is used to determine a serial operation program in the candidate programs as the target program when the operation mode is serial processing; and to determine a parallel operation program in the candidate programs as the target program when the operation mode is parallel processing.
[0148] The operation request processing device provided in this embodiment can execute the above method embodiment, and its implementation principle and technical effect are similar, which will not be repeated here.
[0149] Each module in the processing device of the above operation request can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module.
[0150] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0151] Receive an operation request for a file to be processed; the operation request includes a file type and operation information of the file to be processed;
[0152] Determine a subroutine library corresponding to the file type from a pre-compiled program library according to the file type;
[0153] A target program that can respond to the operation request is determined from a subroutine library according to the operation information, and the target program is called to respond to the operation request.
[0154] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0155] According to the operation type, determine a candidate program corresponding to the operation type from the subroutine library;
[0156] According to the operation mode, a target program corresponding to the operation mode is determined from the candidate programs.
[0157] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0158] When the operation type is a read operation type, a file information acquisition program and a file read operation program are acquired from a subroutine library;
[0159] The file information acquisition program and the file reading operation program are selected as candidate programs.
[0160] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0161] In the case where the operation type is a write operation type, a file definition program and a file write operation program are obtained from a subroutine library;
[0162] The file definition program and the file writing program are considered as candidate programs.
[0163] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0164] When the operation type is a write-on operation type, a file information acquisition program and a file write-on operation program are acquired from a subroutine library;
[0165] The file information acquisition program and the file continuation operation program are taken as candidate programs.
[0166] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0167] In case the operation type is an update operation type, a file definition program and a file update operation program are obtained from a subroutine library;
[0168] The file information acquisition program and the file update operation program are considered as candidate programs.
[0169] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0170] In the case where the operation mode is serial processing, determining a serial operation program among the candidate programs as a target program;
[0171] When the operation mode is parallel processing, a parallel operation program among the candidate programs is determined as a target program.
[0172] In one embodiment, when the processor executes the computer program, the following steps are further implemented: the file type includes any one of a text format type and a network common data format type.
[0173] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0174] Receive an operation request for a file to be processed; the operation request includes a file type and operation information of the file to be processed;
[0175] Determine a subroutine library corresponding to the file type from a pre-compiled program library according to the file type;
[0176] A target program that can respond to the operation request is determined from a subroutine library according to the operation information, and the target program is called to respond to the operation request.
[0177] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0178] According to the operation type, determine a candidate program corresponding to the operation type from the subroutine library;
[0179] According to the operation mode, a target program corresponding to the operation mode is determined from the candidate programs.
[0180] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0181] When the operation type is a read operation type, a file information acquisition program and a file read operation program are acquired from a subroutine library;
[0182] The file information acquisition program and the file reading operation program are selected as candidate programs.
[0183] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0184] In the case where the operation type is a write operation type, a file definition program and a file write operation program are obtained from a subroutine library;
[0185] The file definition program and the file writing program are considered as candidate programs.
[0186] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0187] When the operation type is a write-on operation type, a file information acquisition program and a file write-on operation program are acquired from a subroutine library;
[0188] The file information acquisition program and the file continuation operation program are taken as candidate programs.
[0189] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0190] In case the operation type is an update operation type, a file definition program and a file update operation program are obtained from a subroutine library;
[0191] The file information acquisition program and the file update operation program are considered as candidate programs.
[0192] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0193] In the case where the operation mode is serial processing, determining a serial operation program among the candidate programs as a target program;
[0194] When the operation mode is parallel processing, a parallel operation program among the candidate programs is determined as a target program.
[0195] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: the file type includes any one of a text format type and a network common data format type.
[0196] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0197] Receive an operation request for a file to be processed; the operation request includes a file type and operation information of the file to be processed;
[0198] Determine a subroutine library corresponding to the file type from a pre-compiled program library according to the file type;
[0199] A target program that can respond to the operation request is determined from a subroutine library according to the operation information, and the target program is called to respond to the operation request.
[0200] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0201] According to the operation type, determine a candidate program corresponding to the operation type from the subroutine library;
[0202] According to the operation mode, a target program corresponding to the operation mode is determined from the candidate programs.
[0203] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0204] When the operation type is a read operation type, a file information acquisition program and a file read operation program are acquired from a subroutine library;
[0205] The file information acquisition program and the file reading operation program are selected as candidate programs.
[0206] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0207] In the case where the operation type is a write operation type, a file definition program and a file write operation program are obtained from a subroutine library;
[0208] The file definition program and the file writing program are considered as candidate programs.
[0209] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0210] When the operation type is a write-on operation type, a file information acquisition program and a file write-on operation program are acquired from a subroutine library;
[0211] The file information acquisition program and the file continuation operation program are taken as candidate programs.
[0212] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0213] In case the operation type is an update operation type, a file definition program and a file update operation program are obtained from a subroutine library;
[0214] The file information acquisition program and the file update operation program are considered as candidate programs.
[0215] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0216] In the case where the operation mode is serial processing, determining a serial operation program among the candidate programs as a target program;
[0217] When the operation mode is parallel processing, a parallel operation program among the candidate programs is determined as a target program.
[0218] In one embodiment, when the computer program is executed by a processor, the following steps are further implemented: the file type includes any one of a text format type and a network common data format type.
[0219] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0220] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0221] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0222] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for processing an operation request, It is characterized in that The method comprises: Receive an operation request for a file to be processed; the operation request includes the file type and operation information of the file to be processed; Determining a subroutine library corresponding to the file type from a pre-compiled program library according to the file type; A target program that can respond to the operation request is determined from the subroutine library according to the operation information, and the target program is called to respond to the operation request.
2. The method according to claim 1, It is characterized in that The operation information includes an operation type and an operation mode; and determining a target program that can respond to the operation request from the subroutine library according to the operation information includes: Determining, from the subroutine library according to the operation type, a candidate program corresponding to the operation type; The target program corresponding to the operation mode is determined from the candidate programs according to the operation mode.
3. The method according to claim 2, It is characterized in that Determining, from the subroutine library according to the operation type, a candidate program corresponding to the operation type includes: When the operation type is a read operation type, obtaining a file information acquisition program and a file read operation program from the subroutine library; The file information acquisition program and the file read operation program are used as the candidate programs.
4. The method according to claim 2, It is characterized in that Determining, from the subroutine library according to the operation type, a candidate program corresponding to the operation type includes: When the operation type is a write operation type, obtaining a file definition program and a file write operation program from the subroutine library; The file definition program and the file writing program are taken as the candidate programs.
5. The method according to claim 2, It is characterized in that Determining, from the subroutine library according to the operation type, a candidate program corresponding to the operation type includes: In the case where the operation type is a continue-write operation type, obtaining a file information acquisition program and a file continue-write operation program from the subroutine library; The file information acquisition program and the file continuation operation program are used as the candidate programs.
6. The method according to claim 2, It is characterized in that Determining, from the subroutine library according to the operation type, a candidate program corresponding to the operation type includes: In case the operation type is an update operation type, obtaining a file definition program and a file update operation program from the subroutine library; The file information acquisition program and the file update operation program are used as the candidate programs.
7. The method according to any one of claims 2 to 6, It is characterized in that The determining, from the candidate programs according to the operation mode, the target program corresponding to the operation mode includes: In the case where the operation mode is serial processing, determining a serial operation program among the candidate programs as the target program; In a case where the operation mode is parallel processing, a parallel operation program among the candidate programs is determined as the target program.
8. The method according to claim 1, It is characterized in that The file type includes any one of a text format type and a network common data format type.
9. A device for processing an operation request, It is characterized in that The device comprises: A receiving module, configured to receive an operation request for a file to be processed; the operation request includes a file type and operation information of the file to be processed; A calling module, used for determining a subroutine library corresponding to the file type from a pre-compiled program library according to the file type; The determination module is used to determine a target program that can respond to the operation request from the subroutine library according to the operation information, and call the target program to respond to the operation request.
10. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
11. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
12. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.
