[go: up one dir, main page]

CN111026466A - File processing method and device, computer readable storage medium and electronic equipment - Google Patents

File processing method and device, computer readable storage medium and electronic equipment Download PDF

Info

Publication number
CN111026466A
CN111026466A CN201911222988.5A CN201911222988A CN111026466A CN 111026466 A CN111026466 A CN 111026466A CN 201911222988 A CN201911222988 A CN 201911222988A CN 111026466 A CN111026466 A CN 111026466A
Authority
CN
China
Prior art keywords
interface
target
functional
file processing
standard
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
CN201911222988.5A
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.)
Chengdu Westone Information Industry Inc
Original Assignee
Chengdu Westone Information Industry Inc
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 Chengdu Westone Information Industry Inc filed Critical Chengdu Westone Information Industry Inc
Priority to CN201911222988.5A priority Critical patent/CN111026466A/en
Publication of CN111026466A publication Critical patent/CN111026466A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)

Abstract

The present disclosure relates to a file processing method, a file processing apparatus, a computer-readable storage medium, and an electronic device. The file processing method comprises the following steps: when a file processing instruction is received, determining a standard function interface corresponding to the file processing instruction in a unified calling interface model; judging whether a target function interface matched with the standard function interface exists in the interfaces provided by the target word processor; if so, calling a target function interface to execute file processing operation; if not, determining a target interface group from all functional interfaces of the target word processor in a functional interface combination mode, and calling the target interface group to execute file processing operation; all the functional interfaces of the target interface group comprise interface functions corresponding to the standard functional interfaces. The method and the system can make the word processor compatible with various browsers on the premise of reducing the code complexity.

Description

File processing method and device, computer readable storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a file processing method and apparatus, a computer-readable storage medium, and an electronic device.
Background
With the rapid development of network technology, the number of online streaming file processing programs of electronic documents is also greatly increased, and word processors used for online streaming file processing are also diversified. However, word processing software manufacturers in the market only provide different types of plug-in interfaces for different browser clients, and in order to meet the requirements of users on editing streaming files by using various word processing software in different operating system browsers, application programs need to develop implementation codes of multiple sets of online word processors.
The interfaces of word processors provided by various manufacturers have similar functions, but the names of the interfaces are different, some interfaces are decomposed into a plurality of thinner interfaces, and some interface methods have differences. In the related art, in order to support the use of a new word processor, judgment statements must be added and then implemented separately, so that the code is long, and the problems of poor generality and compatibility, low efficiency of application program development and the like are caused.
Therefore, how to make a word processor compatible with multiple browsers with the premise of reducing the code complexity is a technical problem which needs to be solved by the technical personnel in the field at present.
Disclosure of Invention
The invention aims to provide a file processing method, a file processing device, a computer readable storage medium and electronic equipment, which can enable a word processor to be compatible with various browsers on the premise of reducing code complexity.
In order to solve the above technical problem, the present application provides a file processing method, including:
when a file processing instruction is received, determining a standard function interface corresponding to the file processing instruction in a unified calling interface model;
judging whether a target function interface matched with the standard function interface exists in the interfaces provided by the target word processor;
if the target functional interface matched with the standard functional interface exists in the interfaces provided by the target word processor, calling the target functional interface to execute file processing operation;
if the target functional interface matched with the standard functional interface does not exist in the interfaces provided by the target word processor, determining a target interface group from all functional interfaces of the target word processor in a functional interface combination mode, and calling the target interface group to execute file processing operation; all the functional interfaces of the target interface group comprise interface functions corresponding to the standard functional interfaces.
Optionally, the determining whether a target function interface matched with the standard function interface exists in the interfaces provided by the target word processor includes:
acquiring standard interface information of the standard functional interface;
and judging whether a target function interface with interface information consistent with the standard interface information exists in the interfaces provided by the target word processor.
Optionally, the interface information of the functional interface includes any one or a combination of any several of an interface name, an interface function, a number of parameters, a parameter type, a parameter order, a return value, and a return value type.
Optionally, the method further includes:
when a target function interface exists, recording the interface corresponding relation between the standard function interface and the target function interface so as to call an interface to execute file processing operation according to the interface corresponding relation when a file processing instruction is received next time.
Optionally, after determining the target interface group from all the functional interfaces of the target word processor by means of a combination of the functional interfaces, the method further includes:
recording the corresponding relation between the standard functional interface and the interface group of the target interface group so as to call the interface group to execute the file processing operation according to the corresponding relation of the interface group when receiving the file processing instruction next time.
Optionally, the determining a target interface group from all functional interfaces of the target word processor by a functional interface combination mode includes:
determining a target interface function set according to all interface functions of the standard function interface;
setting a functional interface with any one or several interface functions in the target interface function set in the interfaces provided by the target word processor as an alternative functional interface;
and setting the combination of all the alternative function interfaces as the target interface group.
Optionally, the invoking the target interface group to perform the file processing operation includes:
determining an execution sequence of file processing operations according to the file processing instruction;
determining the calling sequence of each functional interface in the target interface group according to the execution sequence;
and sequentially calling each functional interface in the target interface group according to the calling sequence to execute the file processing operation.
The present disclosure also provides a document processing apparatus including:
the standard functional interface determining module is used for determining a standard functional interface corresponding to the file processing instruction in the unified calling interface model when the file processing instruction is received;
the judging module is used for judging whether a target function interface matched with the standard function interface exists in the interfaces provided by the target word processor;
the first processing module is used for calling a target function interface to execute file processing operation when the target function interface matched with the standard function interface exists in the interfaces provided by the target word processor;
the second processing module is used for determining a target interface group from all functional interfaces of the target word processor in a functional interface combination mode and calling the target interface group to execute file processing operation when the target functional interface matched with the standard functional interface does not exist in the interfaces provided by the target word processor; all the functional interfaces of the target interface group comprise interface functions corresponding to the standard functional interfaces.
Optionally, the second processing module includes:
the interface group determining unit is used for determining a target interface group from all functional interfaces of the target word processor in a functional interface combination mode when the target functional interface matched with the standard functional interface does not exist in the interfaces provided by the target word processor;
a sequence determination unit configured to determine an execution sequence of the file processing operations according to the file processing instruction;
and the execution unit is used for determining the calling sequence of each functional interface in the target interface group according to the execution sequence and calling each functional interface in the target interface group in sequence according to the calling sequence to execute the file processing operation.
The present disclosure also provides a computer-readable storage medium having stored thereon a computer program that, when executed, implements the steps performed by the above-described file processing method.
The present disclosure also provides an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps executed by the file processing method when calling the computer program in the memory.
The disclosure provides a file processing method, which comprises the steps of determining a standard function interface corresponding to a file processing instruction in a unified calling interface model when the file processing instruction is received; judging whether a target function interface matched with the standard function interface exists in the interfaces provided by the target word processor; if so, calling a target function interface to execute file processing operation; if not, determining a target interface group from all functional interfaces of the target word processor in a functional interface combination mode, and calling the target interface group to execute file processing operation.
According to the method and the device, after the file processing instruction is received, the standard functional interface corresponding to the file processing instruction is determined in all the functional interfaces of the unified calling interface model. When the target functional interface matched with the standard functional interface exists in the interfaces provided by the target word processor, the target functional interface can be directly called to execute the operation corresponding to the file processing instruction. And when the target functional interface matched with the standard functional interface does not exist in the interfaces provided by the target word processor, combining a plurality of functional interfaces of the target word processor in a functional combination mode to obtain a target interface group matched with the standard functional interface so as to call the target interface group to execute the operation corresponding to the file processing instruction. The method determines a standard function interface by using a uniform calling interface model, calls the function interface of the target word processor by adopting a direct selection or interface combination mode, and can make the word processor compatible with various browsers on the premise of reducing the code complexity. The present disclosure also provides a file processing apparatus, a computer-readable storage medium, and an electronic device, which have the above beneficial effects and are not described herein again.
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.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. The accompanying drawings, which are included to provide a further understanding of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the disclosure without limiting the disclosure. In the drawings:
FIG. 1 is a flow diagram illustrating a method of file processing in accordance with an exemplary embodiment;
FIG. 2 is a flow diagram illustrating an interface group call method in accordance with an illustrative embodiment;
FIG. 3 is a block diagram illustrating a cross-platform word processor application framework in accordance with an exemplary embodiment;
FIG. 4 is a diagram illustrating an interface compatibility method for common components of an online word processor, according to an example embodiment;
FIG. 5 is a schematic diagram illustrating the structure of a document processing apparatus according to one exemplary embodiment;
fig. 6 is a schematic structural diagram of an electronic device according to an exemplary embodiment.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all embodiments of the present disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
Referring now to fig. 1, fig. 1 is a flowchart illustrating a file processing method according to an exemplary embodiment, where the relevant steps may include:
s101: when a file processing instruction is received, determining a standard function interface corresponding to the file processing instruction in a unified calling interface model;
the embodiment can be applied to a cross-platform browser compatible with various word processors, which are also called word editors or word processing software, and the word processors can include word, WPS, and ever-central office, etc. Each browser of the operating system may have its corresponding word processor, which may provide a suitable type of plug-in interface for the browser client.
Before S101, there may be an operation of receiving a file processing instruction sent by the terminal device, and after receiving the file processing instruction, the file processing instruction may be parsed to determine a standard functional interface corresponding to the file processing instruction. The embodiment may be preset with a unified call interface model, where the unified call interface model may include one or more standard function interfaces, for example, the unified call interface model may include any one or a combination of any several of an initialization interface, a document opening interface, a content replacement interface, and a file printing interface, and the number and the type of the standard function interfaces included in the unified call interface model are not limited herein.
As a possible implementation manner, the embodiment may store the corresponding relationship between the file processing instruction and the standard functional interface in a table in advance, and when the file processing instruction is received, the standard functional interface may be determined in a table lookup manner.
Because the functional interfaces of the word processor provided by the word processor developer may have the similar functions but different interface names, and also may have the condition that part of the functional interfaces are differentiated into a plurality of more detailed interfaces, the unified calling interface model provided by the embodiment can be used as an external representation form of the functional interfaces in the word processor.
S102: judging whether a target function interface matched with the standard function interface exists in the interfaces provided by the target word processor; if the target word processor has a target function interface with an interface function including a standard function interface, the step S103 is entered; if the target word processor does not have a target function interface with the interface function of the standard function interface, the step S104 is entered;
the target word processor may be a word processor employed by a currently used browser. Upon determining the standard functional interface, the purpose of this step is to determine one or more functional interfaces in the target word processor that correspond to the standard functional interface. And determining the target function interface with the same interface function as the standard function interface in all the function interfaces of the target word processor by judging whether the interface provided by the target word processor has the target function interface matched with the standard function interface. Optionally, in this embodiment, when the unified call module is set, a corresponding interface function may be set for each standard function interface. The matching between the standard functional interface and the target functional interface mentioned in this step may be that the target functional interface has interface parameters consistent with those of the standard functional interface, that is: the interface function of the target function interface includes an interface function of a standard function interface.
Before S102, interface information of each functional interface of the target word processor may also be obtained, and interface functions of each functional interface may be determined through the interface information, so that interface function matching is performed in S102 to determine whether a target functional interface exists.
S103: calling a target function interface to execute file processing operation;
the step is realized based on the condition that a target functional interface with the interface function of the standard functional interface exists in the target word processor, so that a developer of the target word processor does not split the corresponding function of the target functional interface during development. Since the interface function of the target word processor is used as the selection standard of the target function interface in the embodiment, even if the names of the target function interface and the standard function interface are inconsistent, the target function interface with the matched function can be called to execute the file processing operation corresponding to the file processing instruction.
It should be noted that the interface function of the target function interface may be more than that of the target function interface, for example, the standard function interface can only provide the file printing function, and the target function interface having the file printing function in this embodiment can also implement the bookmark replacing function. Therefore, the function of the target function interface in this embodiment may also be a set of functions possessed by a plurality of standard function interfaces, and this step is intended to execute the file processing operation corresponding to the file processing instruction by using the target function interface having the interface function of the standard function interface.
S104: and determining a target interface group from all functional interfaces of the target word processor in a functional interface combination mode, and calling the target interface group to execute file processing operation.
The step is realized based on the condition that a target function interface with the interface function of the standard function interface does not exist in the target word processor, and when an interface with the same function of the standard function interface is found in all the function interfaces of the target word processor, the interface function corresponding to the standard function interface in the target word processor is divided by a plurality of function interfaces. For example, when the standard functional interface is a file print interface, the functions of the standard functional interface can be split into 4 sub-functions of obtaining a document object, printing, controlling, displaying, printing and outputting, so that the functional interfaces corresponding to the 4 sub-functions in the target word processor can be combined to obtain a target interface group. The sum of the functions of all the functional interfaces in the target interface group may include the function corresponding to the standard functional interface.
After receiving the file processing instruction, the embodiment determines a standard functional interface corresponding to the file processing instruction in all the functional interfaces of the unified call interface model. When the target functional interface matched with the standard functional interface exists in the interfaces provided by the target word processor, the target functional interface can be directly called to execute the operation corresponding to the file processing instruction. And when the target functional interface matched with the standard functional interface does not exist in the interfaces provided by the target word processor, combining a plurality of functional interfaces of the target word processor in a functional combination mode to obtain a target interface group matched with the standard functional interface so as to call the target interface group to execute the operation corresponding to the file processing instruction. The method determines a standard function interface by using a uniform calling interface model, calls the function interface of the target word processor by adopting a direct selection or interface combination mode, and can make the word processor compatible with various browsers on the premise of reducing the code complexity.
As a supplementary explanation to the previous embodiment, the operation of determining whether a target functional interface matching the standard functional interface exists in the interfaces provided by the target word processor in the embodiment corresponding to fig. 1 may include: acquiring standard interface information of the standard functional interface, and judging whether a target functional interface with interface information consistent with the standard interface information exists in the interface provided by the target word processor; if a target function interface with the interface information consistent with the standard interface information exists, judging that a target function interface matched with the standard function interface exists; and if the target function interface with the interface information consistent with the standard interface information does not exist, judging that the target function interface matched with the standard function interface does not exist.
The interface information mentioned above may include any one or a combination of any several of an interface name, an interface function, a number of parameters, a parameter type, a parameter order, a return value, and a return value type of each functional interface of the target word processor. The standard interface information may include any one or a combination of any several of an interface name, an interface function, a number of parameters, a parameter type, a parameter order, a return value, and a return value type of each standard function interface of the unified call interface model. The corresponding operation of S102 in the corresponding embodiment of fig. 1 may be: judging whether a target function interface with interface information consistent with standard interface information exists or not; if yes, judging that a target function interface matched with the standard function interface exists; if not, judging that the target function interface matched with the standard function interface does not exist.
As a possible implementation manner, after the target function interface is determined in the embodiment corresponding to fig. 1, the interface corresponding relationship between the standard function interface and the target function interface may be recorded, so that an interface is called to execute a file processing operation according to the interface corresponding relationship when a file processing instruction is received next time. The above feasible implementation manner can record the interface corresponding relationship between the target function interface and the standard function interface, and when the same file processing instruction is received again, the relevant interface can be directly called to execute the file processing operation according to the pre-recorded interface corresponding relationship.
If the foregoing embodiment is combined with the embodiment corresponding to fig. 1, the determining whether the target function interface exists in S102 may specifically include: judging whether a target function interface corresponding to the standard function interface exists or not by inquiring the corresponding relation of the interfaces; if yes, executing the relevant operation of calling the target function interface to execute the file processing operation in S103; if not, judging whether a target function interface matched with the standard function interface exists in the interfaces provided by the target word processor. In the above embodiment, before the interface provided by the target word processor is determined, the target function interface is queried based on the interface correspondence, so that the query efficiency of the target function interface can be improved. It can be understood that, in this embodiment, a first relationship table may be pre-constructed, a correspondence relationship among the standard interface, the word processor, and the word processor interface may be stored in the first relationship table, and the first relationship table may be queried before determining whether the target word processor has the target function interface. Of course, in the process of executing the scheme, if the corresponding relationship between the new word processing interface and the standard interface is matched, the first relationship table may also be updated.
As another possible implementation manner, after the target interface group is determined in the embodiment corresponding to fig. 1, the interface group correspondence between the standard functional interface and the target interface group may be recorded, so that the interface group is called to execute the file processing operation according to the interface group correspondence when the file processing instruction is received next time. The other possible implementation manner can record the interface group corresponding relationship between the target interface group and the standard functional interface, and when the same file processing instruction is received again, the target interface group can be directly called to execute the related file processing operation according to the pre-recorded interface group corresponding relationship.
If the foregoing embodiment is combined with the embodiment corresponding to fig. 1, the determining whether the target function interface exists in S102 may specifically include: judging whether a target interface group corresponding to the standard functional interface exists or not by inquiring the corresponding relation of the interface groups; if yes, executing the relevant operation of calling the target interface group to execute the file processing operation in the S104; if not, judging whether a target function interface matched with the standard function interface exists in the interfaces provided by the target word processor. In the above embodiment, before the interface provided by the target word processor is determined, the target interface group is queried based on the interface correspondence, so that the query efficiency of the target functional interface can be improved. It can be understood that, in this embodiment, a second relationship table may be pre-constructed, in which the corresponding relationship among the standard interface, the word processor, and the word processor interface group is stored, and the query may be performed according to the second relationship table before determining whether the target word processor has the target function interface. Of course, in the process of executing the scheme, if the corresponding relationship between the new word processing interface group and the standard interface is matched, the second relationship table may also be updated.
Further, in the embodiment corresponding to fig. 1, the process of determining the target interface group from all the functional interfaces of the target word processor by the S104 in a functional interface combination manner may specifically include the following steps:
step 1: determining a target interface function set according to all interface functions of the standard function interface;
step 2: setting a functional interface with any one or several interface functions in the target interface function set in the interfaces provided by the target word processor as an alternative functional interface;
and step 3: and setting the combination of all the alternative function interfaces as the target interface group.
The above embodiment is implemented on the basis of the condition that a target functional interface including interface functions of a standard functional interface does not exist in a target word processor, and is implemented by first determining a target interface function set including all interface functions of the standard functional interface, and then combining functional interfaces in the target word processor to obtain a target interface group, where all interface functions of the target interface group may include all interface functions in the target interface function set.
As a possible implementation manner, after the candidate function interfaces are obtained, it may be determined whether a function coverage exists between the candidate function interfaces, and if so, the candidate function interfaces covered by the functions of other candidate function interfaces are reset to be the normal function interfaces and are not used as the candidate function interfaces in the target interface group. The function coverage refers to a case where all interface functions of one functional interface are completely included by another functional interface, for example, the a interface can implement a file acquiring function, a print setting control and display function, and a print output function, the B interface can only implement the print output function, it is determined that the B interface is covered by the a interface function, and the finally obtained target interface group may include the a interface but not include the B interface. By the method, the number of the functional interfaces in the target interface group can be reduced on the premise of ensuring the completeness of the interface function, and the interface calling efficiency is improved.
Referring now to fig. 2, fig. 2 is a flow diagram illustrating an interface group call method in accordance with an exemplary embodiment; this embodiment is further described with respect to S104 in the embodiment corresponding to fig. 1, and may be combined with the embodiment corresponding to fig. 1, where the relevant steps of this embodiment may include:
s201: determining an execution sequence of file processing operations according to the file processing instruction;
s202: determining the calling sequence of each functional interface in the target interface group according to the execution sequence;
s203: and sequentially calling each functional interface in the target interface group according to the calling sequence to execute the file processing operation.
In this embodiment, based on selecting a target interface group to be called to execute a file processing operation, since the function of the standard functional interface is split into a plurality of sub-functions, when a target interface group is used to execute a related operation, a call sequence of each functional interface in the target interface group needs to be determined. The present embodiment first determines the execution sequence of the document processing operations according to the document processing instruction, for example, when the document processing instruction is a print instruction, the execution sequence of the document processing operations is: acquiring a file, controlling display of print settings, and printing output. Furthermore, a calling sequence corresponding to the execution sequence may be determined according to the functional interfaces in the target interface group, so as to sequentially call the functional interfaces according to the calling sequence of the interfaces to execute the file processing operation.
The flow described in the above embodiment is described below by an embodiment in practical application, and the embodiment implements the file processing method described in any of the above embodiments by using a common component of an Online Word processor (OWE).
The common components of the online word processor may be written in a standard JavaScript scripting language, please refer to fig. 3, where fig. 3 is a schematic structural diagram illustrating an application framework of a cross-platform word processor according to an exemplary embodiment, and the common components of the online word processor may include a runtime environment monitoring module, an interface adapter module, a word processor plug-in and an extensible engine module.
The operation environment detection module is used for detecting an operating system, a browser and an installed manufacturer word processor and feeding back a detection result to the OWE so as to initialize online word processing. The interface adapter module can provide a unified interface method with the same function and format for the application, and the unified interface method comprises an interface name, a parameter number, a parameter type, a parameter sequence, a return value and a return value type. The target word processor needing compatibility can be determined according to the application program requirement or the word processor needing compatibility in the future, and a common main stream word processor can be used as the target word processor. Firstly, the functional interfaces of the target word processor plug-ins which need to be compatible can be classified and sorted. The classification basis can refer to the uniform call interface requirement, and the sorted content can comprise the name, the function, the parameter type, the return value type and the like of the target word processor component interface. The compatible operation of the word processor can be realized by comparing the functional interfaces of the target word processor and the unified calling interface model, if the interface functions are consistent, the compatible operation can be directly called, if the interface functions are inconsistent, the compatible operation can be realized by combining a plurality of functional interfaces, and finally the use requirement of the unified calling interface is met.
Referring to fig. 4, fig. 4 is a diagram illustrating an interface compatibility method for common components of an online word processor according to an exemplary embodiment, where DI denotes that the same interface is directly called, and AI denotes that different interfaces are called in combination. The uniform calling interface in fig. 3 can provide a simple and consistent use method for the application, thereby simplifying the code structure of the service module and facilitating the use of the service program. The extensible engine module can increase the software support of a new word processor without modifying any service program code, so the OWE has good extensibility and strong reusability, greatly improves the development efficiency, and reduces the research and development and maintenance costs of an application system. When different interfaces are called in a combined mode, the execution sequence of the file processing operation can be determined so as to obtain the calling sequence of each functional interface in the target interface group, and then each functional interface in the target interface group is called in sequence according to the calling sequence to execute the file processing operation. After the interface corresponding relation between the unified calling interface model and the target word processor is determined, the interface corresponding relation can be stored, so that the interface unified calling can be realized directly according to the interface corresponding relation in the subsequent operation.
The embodiment realizes the cross-platform on-line word processor common assembly through the operating environment detection module and the dynamic loading technology on the basis of various manufacturer word processor interface plug-ins. Therefore, when the word processor code is developed, a large amount of learning time is not needed, even when the service logic of an application program is complex, a consistent calling interface is provided through the OWE, and the problem of stream type editing by using different word processing software in browsers of various operating systems can be well solved. OWE is very simple to use and maintain. After the business function is introduced into the JS library file of the OWE, the corresponding function call can be completed only through the unified call interface, and the code amount of the business module is reduced. Even if the code has defects, only one set of OWE code needs to be maintained, so that the development efficiency is greatly improved, and the compatibility is better. When more word processors need to be supported, the OWE has the expandable capability through the operation environment detection module and the dynamic loading technology.
Referring to fig. 5, fig. 5 is a schematic structural diagram of a document processing apparatus according to an exemplary embodiment;
the document processing apparatus 500 may include:
a standard functional interface determining module 501, configured to determine, when a file processing instruction is received, a standard functional interface corresponding to the file processing instruction in the unified call interface model;
a judging module 502, configured to judge whether a target function interface matched with the standard function interface exists in the interfaces provided by the target word processor;
a first processing module 503, configured to, when a target function interface matching the standard function interface exists in the interfaces provided by the target word processor, call the target function interface to perform a file processing operation;
and the second processing module 504 is configured to, when there is no target functional interface matching the standard functional interface in the interfaces provided by the target word processor, determine a target interface group from all functional interfaces of the target word processor in a functional interface combination manner, and call the target interface group to perform a file processing operation.
After receiving the file processing instruction, the embodiment determines a standard functional interface corresponding to the file processing instruction in all the functional interfaces of the unified call interface model. When the target functional interface matched with the standard functional interface exists in the interfaces provided by the target word processor, the target functional interface can be directly called to execute the operation corresponding to the file processing instruction. And when the target functional interface matched with the standard functional interface does not exist in the interfaces provided by the target word processor, combining a plurality of functional interfaces of the target word processor in a functional combination mode to obtain a target interface group matched with the standard functional interface so as to call the target interface group to execute the operation corresponding to the file processing instruction. The method determines a standard function interface by using a uniform calling interface model, calls the function interface of the target word processor by adopting a direct selection or interface combination mode, and can make the word processor compatible with various browsers on the premise of reducing the code complexity.
Further, the second processing module includes:
an interface group determining unit, configured to determine a target interface function set according to all interface functions of a standard function interface when a target function interface matching the standard function interface does not exist in a target word processor, set a function interface having any one or several interface functions in the target interface function set among interfaces provided by the target word processor as an alternative function interface, and set a combination of all the alternative function interfaces as the target interface group.
A sequence determination unit configured to determine an execution sequence of the file processing operations according to the file processing instruction;
and the execution unit is used for determining the calling sequence of each functional interface in the target interface group according to the execution sequence and calling each functional interface in the target interface group in sequence according to the calling sequence to execute the file processing operation.
Further, the determining module 502 includes:
the information acquisition unit is used for acquiring standard interface information of the standard functional interface;
and the information judgment unit is used for judging whether a target function interface with interface information consistent with the standard interface information exists in the interfaces provided by the target word processor.
Further, the interface information of the functional interface includes any one or a combination of any several of an interface name, an interface function, a number of parameters, a parameter type, a parameter order, a return value, and a return value type.
Further, the file processing apparatus further includes:
and the first corresponding relation recording module is used for recording the interface corresponding relation between the standard function interface and the target function interface when the target function interface exists so as to call an interface to execute file processing operation according to the interface corresponding relation when a file processing instruction is received next time.
Further, the file processing apparatus further includes:
and the second corresponding relation recording module is used for recording the corresponding relation between the standard functional interface and the interface group of the target interface group after determining the target interface group from all the functional interfaces of the target word processor in a functional interface combination mode so as to call the interface group to execute file processing operation according to the corresponding relation of the interface group when receiving a file processing instruction next time.
Since the embodiments of the apparatus portion and the method portion correspond to each other, please refer to the description of the embodiments of the method portion for the embodiments of the apparatus portion, which is not repeated here.
Fig. 6 is a schematic structural diagram of an electronic device according to an exemplary embodiment. As shown in fig. 6, the electronic device 600 may include: a processor 601 and a memory 602. The electronic device 600 may also include one or more of a multimedia component 603, an input/output (I/O) interface 604, and a communications component 605.
The processor 601 is configured to control the overall operation of the electronic device 600, so as to complete all or part of the steps in the file processing method. The memory 602 is used to store various types of data to support operation at the electronic device 600, such as instructions for any application or method operating on the electronic device 600 and application-related data, such as contact data, transmitted and received messages, pictures, audio, video, and so forth. The Memory 602 may be implemented by any type of volatile or non-volatile Memory device or combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk or optical disk. The multimedia components 603 may include a screen and audio components. Wherein the screen may be, for example, a touch screen and the audio component is used for outputting and/or inputting audio signals. For example, the audio component may include a microphone for receiving external audio signals. The received audio signal may further be stored in the memory 602 or transmitted through the communication component 605. The audio assembly also includes at least one speaker for outputting audio signals. The I/O interface 604 provides an interface between the processor 601 and other interface modules, such as a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 605 is used for wired or wireless communication between the electronic device 600 and other devices. Wireless communication, such as Wi-Fi, bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination of one or more of them, so that the corresponding communication component 605 may include: Wi-Fi module, bluetooth module, NFC module.
In an exemplary embodiment, the electronic Device 600 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components for performing the file Processing method described above.
In another exemplary embodiment, there is also provided a computer readable storage medium including program instructions which, when executed by a processor, implement the steps of the above-described file processing method. For example, the computer readable storage medium may be the memory 602 described above including program instructions that are executable by the processor 601 of the electronic device 600 to perform the file processing method described above.
The preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the present disclosure is not limited to the specific details of the above embodiments, and various simple modifications may be made to the technical solution of the present disclosure within the technical idea of the present disclosure, and these simple modifications all belong to the protection scope of the present disclosure. It should be noted that, in the foregoing embodiments, various features described in the above embodiments may be combined in any suitable manner, and in order to avoid unnecessary repetition, various combinations that are possible in the present disclosure are not described again. In addition, various different embodiments of the disclosure can be combined arbitrarily, for example, the embodiment corresponding to fig. 1 and the embodiment corresponding to fig. 2 can be combined, and the disclosure of the disclosure should be regarded as the disclosure of the disclosure as long as the concept of the disclosure is not violated.
The embodiments are described in a progressive manner in the specification, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description. It should be noted that, for those skilled in the art, it is possible to make several improvements and modifications to the present disclosure without departing from the principle of the present disclosure, and such improvements and modifications also fall within the scope of the claims of the present disclosure.
It is further noted that, in the present specification, relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.

Claims (10)

1. A file processing method, comprising:
when a file processing instruction is received, determining a standard function interface corresponding to the file processing instruction in a unified calling interface model;
judging whether a target function interface matched with the standard function interface exists in the interfaces provided by the target word processor;
if the target functional interface matched with the standard functional interface exists in the interfaces provided by the target word processor, calling the target functional interface to execute file processing operation;
if the target functional interface matched with the standard functional interface does not exist in the interfaces provided by the target word processor, determining a target interface group from all functional interfaces of the target word processor in a functional interface combination mode, and calling the target interface group to execute file processing operation; and all the functional interfaces of the target interface group comprise interface functions corresponding to the standard functional interfaces.
2. The document processing method according to claim 1, wherein determining whether a target functional interface matching the standard functional interface exists in the interfaces provided by the target word processor comprises:
acquiring standard interface information of the standard functional interface;
and judging whether a target function interface with interface information consistent with the standard interface information exists in the interfaces provided by the target word processor.
3. The file processing method according to claim 2, wherein the interface information includes any one or a combination of any several of an interface name, an interface function, a number of parameters, a parameter type, a parameter order, a return value, and a return value type.
4. The file processing method according to claim 2 or 3, further comprising:
when the target function interface exists, recording the interface corresponding relation between the standard function interface and the target function interface so as to call an interface to execute file processing operation according to the interface corresponding relation when a file processing instruction is received next time.
5. The document processing method according to claim 2 or 3, further comprising, after determining a target interface group from all functional interfaces of the target word processor by means of a combination of functional interfaces:
and recording the corresponding relation between the standard functional interface and the interface group of the target interface group so as to call the interface group to execute file processing operation according to the corresponding relation of the interface group when a file processing instruction is received next time.
6. The document processing method according to claim 1, wherein the determining a target interface group from all functional interfaces of the target word processor by means of a combination of functional interfaces comprises:
determining a target interface function set according to all interface functions of the standard function interface;
setting a functional interface with any one or several interface functions in the target interface function set in the interfaces provided by the target word processor as an alternative functional interface;
and setting the combination of all the alternative function interfaces as the target interface group.
7. The file processing method of claim 1, wherein said invoking the target interface group to perform the file processing operation comprises:
determining an execution sequence of file processing operations according to the file processing instruction;
determining the calling sequence of each functional interface in the target interface group according to the execution sequence;
and sequentially calling each functional interface in the target interface group according to the calling sequence to execute file processing operation.
8. A document processing apparatus, characterized by comprising:
the standard functional interface determining module is used for determining a standard functional interface corresponding to the file processing instruction in the unified calling interface model when the file processing instruction is received;
the judging module is used for judging whether a target function interface matched with the standard function interface exists in the interfaces provided by the target word processor;
the first processing module is used for calling the target function interface to execute file processing operation when the target function interface matched with the standard function interface exists in the interfaces provided by the target word processor;
the second processing module is used for determining a target interface group from all functional interfaces of the target word processor in a functional interface combination mode and calling the target interface group to execute file processing operation when a target functional interface matched with the standard functional interface does not exist in the interfaces provided by the target word processor; and all the functional interfaces of the target interface group comprise interface functions corresponding to the standard functional interfaces.
9. A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, which computer program, when being executed by a processor, carries out the steps of the file processing method according to any one of claims 1 to 7.
10. An electronic device, comprising:
a memory for storing a computer program;
a processor for implementing the steps of the document processing method according to any one of claims 1 to 7 when executing the computer program.
CN201911222988.5A 2019-12-03 2019-12-03 File processing method and device, computer readable storage medium and electronic equipment Pending CN111026466A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911222988.5A CN111026466A (en) 2019-12-03 2019-12-03 File processing method and device, computer readable storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911222988.5A CN111026466A (en) 2019-12-03 2019-12-03 File processing method and device, computer readable storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN111026466A true CN111026466A (en) 2020-04-17

Family

ID=70204154

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911222988.5A Pending CN111026466A (en) 2019-12-03 2019-12-03 File processing method and device, computer readable storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111026466A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112511343A (en) * 2020-11-17 2021-03-16 上海金卓科技有限公司 Configuration method, device and equipment of forward interface and storage medium
CN117708036A (en) * 2022-09-08 2024-03-15 中移物联网有限公司 An AT command processing method, device, terminal and terminal equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090307303A1 (en) * 2008-06-10 2009-12-10 Microsoft Corporation Providing partner services within a host application
CN105653363A (en) * 2015-12-28 2016-06-08 北京致远协创软件有限公司 Interface function realization method and apparatus
CN105912362A (en) * 2016-04-11 2016-08-31 北京金山安全软件有限公司 Method and device for loading plug-in and electronic equipment
CN106599687A (en) * 2016-11-18 2017-04-26 北京奇虎科技有限公司 Method and device for opening Flash file in application program
CN106648790A (en) * 2016-12-28 2017-05-10 北京金山安全软件有限公司 Application program implementation method and device and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090307303A1 (en) * 2008-06-10 2009-12-10 Microsoft Corporation Providing partner services within a host application
CN105653363A (en) * 2015-12-28 2016-06-08 北京致远协创软件有限公司 Interface function realization method and apparatus
CN105912362A (en) * 2016-04-11 2016-08-31 北京金山安全软件有限公司 Method and device for loading plug-in and electronic equipment
CN106599687A (en) * 2016-11-18 2017-04-26 北京奇虎科技有限公司 Method and device for opening Flash file in application program
CN106648790A (en) * 2016-12-28 2017-05-10 北京金山安全软件有限公司 Application program implementation method and device and electronic equipment

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112511343A (en) * 2020-11-17 2021-03-16 上海金卓科技有限公司 Configuration method, device and equipment of forward interface and storage medium
CN117708036A (en) * 2022-09-08 2024-03-15 中移物联网有限公司 An AT command processing method, device, terminal and terminal equipment
CN117708036B (en) * 2022-09-08 2025-03-28 中移物联网有限公司 AT command processing method, device, terminal and terminal equipment

Similar Documents

Publication Publication Date Title
CN110221872B (en) Page jump method and device, electronic equipment and storage medium
US11538046B2 (en) Page data acquisition method, apparatus, server, electronic device and computer readable medium
CN107562556B (en) Failure recovery method, recovery device and storage medium
CN110688232A (en) Application program calling method, terminal device and computer readable storage medium
CN110955428A (en) Page display method and device, electronic equipment and medium
CN111399840A (en) Module development method and device
CN111736825B (en) Information display method, device, equipment and storage medium
CN101656623A (en) Software installing method, sever and system
CN105224401A (en) Scheduled task control method and device
CN112948264B (en) Method and device for executing test task, system, storage medium and electronic device
CN112269622B (en) Page management method, device, equipment and medium
CN111158654A (en) Algorithm calling method, device, server and storage medium
CN108255708A (en) Method, apparatus, storage medium and the equipment of production file are accessed in test environment
CN110795353A (en) Debugging method, device and equipment for fast application and storage medium
CN107102937B (en) User interface testing method and device
CN117289906A (en) Low-code application development method, equipment and medium
CN103440295A (en) Method for uploading multimedia files and electronic terminal
CN111880996B (en) Bare metal data acquisition method, device, equipment and readable storage medium
CN107908679B (en) Script statement conversion method and device and computer readable storage medium
CN111026466A (en) File processing method and device, computer readable storage medium and electronic equipment
CN116594676A (en) Application packaging method, device, equipment and storage medium
CN105278928A (en) IVR external interface configuration method and IVR external interface configuration device
WO2020168570A1 (en) Quick application add method, apparatus, electronic device, and storage medium
CN113590564B (en) Data storage method, device, electronic equipment and storage medium
WO2023151397A1 (en) Application program deployment method and apparatus, device, and 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200417