CN106599045B - Request sending method and device - Google Patents

Request sending method and device Download PDF

Info

Publication number
CN106599045B
CN106599045B CN201610985894.3A CN201610985894A CN106599045B CN 106599045 B CN106599045 B CN 106599045B CN 201610985894 A CN201610985894 A CN 201610985894A CN 106599045 B CN106599045 B CN 106599045B
Authority
CN
China
Prior art keywords
unit
plug
identification information
request
operation request
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.)
Active
Application number
CN201610985894.3A
Other languages
Chinese (zh)
Other versions
CN106599045A (en
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.)
Shanghai I2finance Software Co ltd
Original Assignee
Shanghai I2finance Software Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai I2finance Software Co ltd filed Critical Shanghai I2finance Software Co ltd
Priority to CN201610985894.3A priority Critical patent/CN106599045B/en
Publication of CN106599045A publication Critical patent/CN106599045A/en
Application granted granted Critical
Publication of CN106599045B publication Critical patent/CN106599045B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a request sending method, which is used for solving the problem that the request sending speed between a raw application part and a web application part in hybrid application is low, so that the request response efficiency of the existing hybrid application is low in the prior art. The method comprises the following steps: obtaining identification information of at least one plug-in contained in a first unit; determining the corresponding relation between the identification information and the specified operation request, and storing the corresponding relation between the identification information and the specified operation request; receiving an operation request sent by a second unit, and determining identification information corresponding to the operation request according to the stored corresponding relation; and sending an operation request containing the determined identification information to the first unit according to the determined identification information so as to call the plug-in corresponding to the determined identification information contained in the first unit. The application also discloses a request sending device.

Description

Request sending method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a request sending method and apparatus.
Background
With the continuous development of internet information technology, more and more intelligent terminals are developed and widely applied to aspects of life, where the intelligent terminals may be, for example, desktop computers, notebook computers, smart phones, tablet computers, smart watches, and the like, and Applications (APPs) that can be installed on the intelligent terminals may be further divided into native applications, web applications, and hybrid applications.
The native applications are developed specifically for a certain type of intelligent terminal, and they may run directly on an operating system of the corresponding intelligent terminal, for example, applications developed for an iOS operating system or applications developed for an Android operating system. And Web applications may refer to applications designed and developed based on browsers, which may be run using browsers on smart terminals (e.g., IE in windows systems, Safari in iphones), and which may run on a variety of different operating systems. The mixed application is a combination of a native application and a Web application as the name implies, and a part of the native application and a part of the Web application are adopted. Since the hybrid application combines the advantages of good user interaction experience of native applications and the advantages of cross-platform development of web applications, nowadays, some mainstream applications are developed towards the hybrid application.
At present, when the hybrid application implements interaction between a native application part and a web application part, a protocol interception manner is often adopted, that is, when a request is sent by the native application part (or the web application part) in the hybrid application, the native application part (or the web application part) is intercepted by an operating system first, and then an implementation manner corresponding to the request is judged, and when the operating system judges that the request needs the web application part to be implemented, the request is sent to the web application part and is processed by the web application part.
When the hybrid application performs information interaction between the native application part and the web application part in the manner described above, since the request is first required to be intercepted and determined, problems of slow request response and low request processing efficiency may occur in the actual use of the existing hybrid application.
For example, as shown in fig. 1, for a user operation interface of a hybrid application installed on a smartphone in the prior art, an "a" area shown in the figure is an area in which a web application part is displayed in the hybrid application, and areas other than the "a" area in the figure are areas in which a native application part is displayed in the hybrid application, when a user clicks the "a" area to trigger starting of a function of the web application part of the hybrid application, since a request sending mechanism in the prior art is adopted, the request sending is slow, and a response time is long, the hybrid application needs a long time to switch to a function interface desired by the user for the user after clicking the "a" area, and the hybrid application generally shows a jump interface shown in fig. 2 for the user during a jump, which greatly affects a user experience of the user.
Therefore, how to avoid the problem that the request response efficiency of the existing hybrid application is low due to the low request sending speed between the native application part and the web application part in the existing hybrid application becomes a problem to be solved in the prior art.
Disclosure of Invention
The embodiment of the application provides a request sending method, which is used for solving the problem that the request sending speed between a raw application part and a web application part in hybrid application is low in the prior art, so that the request response efficiency of the conventional hybrid application is low.
The embodiment of the present application further provides a request sending apparatus, so as to solve the problem that, in the hybrid application, the request sending speed between the raw application part and the web application part is slow in the prior art, and thus the request response efficiency of the prior hybrid application is low.
The embodiment of the application adopts the following technical scheme:
a method for request transmission, comprising:
obtaining identification information of at least one plug-in contained in a first unit;
determining the corresponding relation between the identification information and the specified operation request, and storing the corresponding relation between the identification information and the specified operation request;
receiving an operation request sent by a second unit, and determining identification information corresponding to the operation request according to the stored corresponding relation;
and sending an operation request containing the determined identification information to the first unit according to the determined identification information so as to call the plug-in corresponding to the determined identification information contained in the first unit.
A request transmission apparatus comprising:
an identification information obtaining unit configured to obtain identification information of at least one plug-in included in the second unit;
a corresponding relation determining unit, configured to determine a corresponding relation between the identification information and a specified operation request, and store the corresponding relation between the identification information and the specified operation request;
an operation request receiving unit, configured to receive the operation request sent by the third unit, and determine, according to the stored correspondence, identification information corresponding to the operation request;
and the calling request sending unit is used for sending a calling request containing the determined identification information to the second unit according to the determined identification information so as to call the plug-in corresponding to the determined identification information contained in the second unit.
The embodiment of the application adopts at least one technical scheme which can achieve the following beneficial effects:
because the first unit can obtain the identification information of the plug-in contained in the second unit in advance, and after determining the corresponding relationship between the identification information and the designated operation request, the corresponding relationship between the identification information and the designated operation request is stored, when the first unit receives the operation request sent by the third unit, the first unit can determine the identification information corresponding to the operation request according to the corresponding relationship stored in advance, and further send a calling request containing the identification information to the second unit to call the plug-in contained in the second unit and corresponding to the determined identification information, and by adopting the method, when the operation request needs to be sent between the second unit and the third unit in the application, the sending of the operation request can be completed only through the first unit in the application, so that the operation request does not need to be intercepted first and then further processed as in the prior art, therefore, the problem that the request sending speed is low and the request response efficiency is low due to the fact that the sent request is intercepted is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a diagram illustrating an interface display effect of a hybrid application provided by the prior art;
FIG. 2 is a diagram illustrating the effect of a hybrid application responding to a wait interface provided by the prior art;
fig. 3 is a diagram illustrating an example of a specific process of a request sending method according to an embodiment of the present application;
FIG. 4 is an architecture diagram of a hybrid application provided by an embodiment of the present application;
fig. 5 is a schematic diagram illustrating a sending flow of a keyboard invocation request according to an embodiment of the present application;
FIG. 6 is a schematic diagram of an operation interface of a web application part according to an embodiment of the present application;
FIG. 7 is a schematic diagram illustrating an effect of a web application part invoking a keyboard through a keyboard call request according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of a request sending device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Example 1
The embodiment of the application provides a request sending method, which is used for solving the problem that the request sending speed between a raw application part and a web application part in hybrid application is low in the prior art, so that the request response efficiency of the conventional hybrid application is low.
The execution main body of the request sending method provided by the embodiment of the application can be, but is not limited to, at least one of a mobile phone, a tablet Computer, a Personal Computer (PC), a smart television and any terminal device capable of running an application. The execution subject of the method may be the application itself.
For convenience of description, the following description will be made of an embodiment of the method by taking an execution subject of the method as application software. It is to be understood that the implementation of the method is merely an exemplary illustration of an application and should not be construed as a limitation of the method.
The specific flow diagram of the method is shown in fig. 3, and mainly comprises the following steps:
step 11, the first unit obtains the identification information of at least one plug-in included in the second unit;
the first unit and the second unit are all part of functional units forming the application software. Taking the application as a hybrid application as an example, the second unit may be a native application part of the application, or the second unit may also be a web application part of the application.
Still taking an application as an example of a hybrid application, the first application may generally be a module for bridging interaction between a web application part and a native application part in the hybrid application, and implementing data communication between the native application part and the web application part in the hybrid application, and request sending, etc., for example, the first unit may be a hypertext markup language rendering Engine (html rendering Engine).
The second unit comprises a plurality of functional plug-ins, and the application software executes specified operation by calling at least one plug-in the second unit so as to realize some specified functions of the application software.
It should be noted that, in order to enable the application software to obtain the plug-ins included in the second unit and call the functions that these plug-ins can respectively implement, in a practical manner, after the application software is started, the second unit may register the plug-ins in the second unit according to the pre-stored configuration information, so that the identification information of the plug-ins included in the second unit is exposed in the process context of the application operation, and declares the functions corresponding to the plug-ins, and then the first unit may call a unified interface method to obtain the identification information of the plug-ins included in the second unit.
For example, if the unified Interface method predefined for the first unit by the hybrid Application is an "Bridge Native" Application Programming Interface (API), and for convenience of description, the first unit in the hybrid Application can realize communication with other parts in the Application through the "Bridge Native API". The identification information of the plug-in here may refer to, for example, a name of the plug-in, or a number automatically assigned to the plug-in by the mobile phone operating system when the plug-in is registered, and the identification information of the plug-in is not limited to what kind of identification information is, and the identification information only needs to uniquely represent the plug-in.
It should be noted that, after the application is closed each time, the process allocated by the operating system to run the application is also closed, so that the second unit in the application generally needs to register the plug-in the second unit according to the configuration information each time the application is started.
Step 12, determining the corresponding relation between the identification information obtained by executing step 11 and the specified operation request, and storing the corresponding relation between the identification information and the specified operation request;
in one embodiment, the specific implementation manner of step 12 may include: determining the function of the plug-in corresponding to the identification information; determining an operation request corresponding to the function; and determining the corresponding relation between the operation request and the identification information.
Specifically, the first unit may determine, through the information of the plugin registered in the process when the application runs by the second unit, the function that can be implemented by running the plugin, further establish an association relationship between the plugin and the operation request for calling the function, and store the association relationship between the identification information of the plugin and the operation request, so that when the first unit receives the operation request for calling the specified function, the plugin to be called by the operation request may be determined according to the association relationship between the identification information of the plugin and the operation request that are stored in advance.
Step 13, receiving the operation request sent by the third unit, and determining the identification information corresponding to the operation request according to the corresponding relation between the operation request and the identification information stored by executing step 12;
wherein, the third unit is also a part of the functional unit which forms the application software. Still taking the application software as an example of a hybrid application, the third unit may be a web application part, or the third unit may also be a native application part, and when the second unit is a native application part, the third unit is a web application part, or when the second unit is a web application part, the third unit is a native application part.
It should be noted that the received operation request sent by the third unit not only includes the identification information of the plug-in that the third unit expects to call, but also carries the input parameters that the third unit expects to call the plug-in, for example, a successful callback function, an incorrect callback function, an event type, and the like, so that the first unit sends the received input parameter one to the second unit, and the second unit can determine the plug-in to be called and input the input parameter into the plug-in.
Taking the third unit as the web application part in the hybrid application, and by executing step 12, the first unit stores the corresponding relationship between the identification information "keyboard" and the operation request for calling the "keyboard", for example, when the third unit needs to call the "keyboard" function in the native application of the hybrid application, the third unit will send the operation request for calling the "keyboard" to the first unit, and the first unit may determine, according to the corresponding relationship between the identification information and the operation request stored in advance, that the identification information corresponding to the operation request for calling the "keyboard" is "keyboard".
And step 14, sending a calling request containing the determined identification information to the second unit according to the identification information determined by executing the step 13 so as to call the plug-in contained in the second unit and corresponding to the determined identification information.
After the first unit determines the identification information corresponding to the operation request sent by the third unit by executing step 13, the first unit sends a call request with the determined identification information to the second unit containing the plug-in, so that the second unit can determine the plug-in corresponding to the identification information according to the identification information contained in the call request, and then call the plug-in.
It should be noted that, in order to synchronize the processing result of the request by the second unit to the third unit, so that the third unit can query the processing condition of the request by the second unit, and further avoid the third unit from repeatedly sending the operation request, in an embodiment, a message queue may be created for the second unit and the third unit, respectively, and after the second unit calls a specified plug-in according to the call request sent by the first unit and executes the request of the second unit by the plug-in, the plug-in will take out the request processing result in the message queue of the second unit, and return the request processing result to the message queue of the third unit according to a first-in first-out principle, so that the third unit can obtain the processing result of the request by the second unit.
Specifically, the method provided by the embodiment of the present application may include: creating a first message queue for the second unit; sending a calling request containing the determined identification information to a second unit, so that the second unit determines a plug-in corresponding to the identification information according to the identification information; receiving a processing result returned by the second unit through the determined plug-in executing the call request; and storing the processing result in the first message queue.
After sending a call request including the determined identification information to the second unit to call a plug-in included in the second unit and corresponding to the determined identification information, the method provided in the embodiment of the present application may further include: and returning a processing result to the third unit as an operation result corresponding to the operation request sent by the third unit. In an implementation manner, the embodiment of the present application may return a call result to the third unit in the following manner, and specifically may include: creating a second message queue for the third unit; acquiring a processing result returned by the second unit through the determined plug-in executing the operation request; and sending the processing result to the third unit, and storing the processing result in the third message queue.
It should be noted that, in an embodiment, the second unit may query the processing result in the second unit message queue in a polling manner, and call a callback function according to the processing result, so as to show the processing result to the user, so as to finally complete the interaction with the user.
For example, still taking an application as a hybrid application, taking a second unit as a native application part of the hybrid application, taking a third unit as a web application part of the hybrid application, and when a user clicks the web application part of the hybrid application to trigger the web application part to invoke a keyboard of the native application part, the web application part sends an operation request for invoking a "keyboard" to a first unit of the hybrid application, sends a "keyboard" invocation request to the native application part of the hybrid application through the first unit, invokes a "keyboard" plug-in of the native application part to generate a keyboard, and returns a processing result to the web application part, and when the processing result is to generate a keyboard, the web application part may first present the generated keyboard to the user.
With the request sending method provided in embodiment 1 of the present application, because the first unit can obtain in advance the identification information of the plug-in included in the second unit, and after determining the corresponding relationship between the identification information and the specified operation request, store the corresponding relationship between the identification information and the specified operation request, and after the first unit receives the operation request sent by the third unit, the first unit can determine the identification information corresponding to the operation request according to the pre-stored corresponding relationship, and further send a call request including the identification information to the second unit, so as to call the plug-in included in the second unit and corresponding to the identified identification information, with this method, when the operation request needs to be sent between the second unit and the third unit in an application, the sending of the operation request can be completed only by the first unit in the application, so that there is no need to use the same as in the prior art, the operation request is intercepted first and then further processed, so that the problem that the request sending speed is low and further the request response efficiency is low due to the fact that the sent request needs to be intercepted is solved.
Example 2
The inventive concept of the present application is described in detail based on the foregoing embodiment 1, and in order to better understand the technical features, means and effects of the present application, the request transmission method of the present application is further described below, thereby forming a further embodiment of the present application.
In order to enable the native application part and the web application part in the hybrid application to quickly and efficiently request to send, in an embodiment of the present application, a hybrid application a is composed of three parts, namely a web application, a native application, and an HTML Rendering Engine, as shown in fig. 4, an architecture diagram of a hybrid application provided for an embodiment of the present application is provided, where the web application may include: a hypertext markup language (HTML) frame, Javascript codes (JS codes), Cascading Style Sheets (CSS), and the like; the Native application part may include, for example, Native plug-in manager (Native plugs) of the Native application, which may include local plug-ins thereon, such as: camera (Camera) plug-in, multimedia (Media) plug-in, and Keyboard (Keyboard) plug-in, etc.; the web application can communicate with the HTML Rendering Engine through the interface "Bridge API"; the native application may also communicate with the HTMLRendering Engine via the interface "Bridge API".
Based on the hybrid application shown in fig. 4, an embodiment of the present application provides a method for sending a keyboard invocation request, so as to solve the problem that, in the hybrid application in the prior art, the request sending speed between the raw application part and the web application part is slow, and thus the request response efficiency of the prior hybrid application is low. The specific flow diagram of the method is shown in fig. 5, and mainly comprises the following steps:
step 21, a user starts the hybrid application A, and the Native application part registers the plug-ins in the Native plug-ins according to the configuration information in the Native plug-ins, so that the names of the plug-ins contained in the Native plug-ins of the Native application are exposed in the process context of the operation of the hybrid application A;
meanwhile, the HTML Rendering Engine part in the hybrid application A acquires the names of the plug-ins contained in the native plug-ins part, and determines the corresponding relation between the acquired names of the plug-ins and the specified operation request according to the functions of the plug-ins.
Step 22, the user triggers the web application to send a 'native keyboard' call request to the HTMLRendering Engine by clicking an input box of the web application part in the hybrid application a;
as shown in fig. 6, what is currently displayed is an operation interface of a web application part in the hybrid application a, and a user clicks an input box in the operation interface to expect the hybrid application to call up a keyboard for input, at this time, the web application will send a call request including a name of "keyboard" to the HTML Rendering Engine.
Step 23, determining a plug-in corresponding to the received call request by the HTML Rendering Engine in the hybrid application A;
the HTML Rendering Engine in the hybrid application a may determine a name corresponding to the received call request according to the association relationship between the identifier information of the plug-in stored in advance and the operation request, and further determine the plug-in corresponding to the name as the plug-in corresponding to the received call request.
Step 24, the HTML Rendering Engine in the hybrid application A sends a calling request to Native Plugins of the Native application;
the HTML Rendering Engine in hybrid application a sends a call request containing the name determined by performing step 23 to Native plugs of the Native application.
Step 25, Native Plugins in the Native application determine the plug-in to be called by the calling request according to the name of the plug-in contained in the received calling request, and then call the plug-in to execute the calling request;
taking the name of the plug-in included in the call request as "keyboard", Native plugs in the Native application call the keyboard plug-in "Keyboardplugin", and generate the keyboard according to the input parameters included in the call request.
Step 25, Native Plugins of the Native application returns a processing result of the 'calling keyboard request' to a message list of the Native application;
step 26, the native application takes out the processing result of the 'calling keyboard request' from the message list, and returns the processing result of the 'calling keyboard request' to the web application through the HTMLRendering Engine;
step 27, the web application saves the received processing result into a message list of the web application;
in step 28, the web application queries the request processing result stored in the message list of the web application, and displays the keyboard generated by calling the "keyboard" plug-in on the operation interface of the web application, and the display effect is as shown in fig. 7.
With the request sending method provided in embodiment 2 of the present application, because the first unit can obtain the identification information of the plug-in included in the second unit in advance, and after determining the corresponding relationship between the identification information and the specified operation request, store the corresponding relationship between the identification information and the specified operation request, and after the first unit receives the operation request sent by the third unit, the first unit can determine the identification information corresponding to the operation request according to the pre-stored corresponding relationship, and further send the call request including the identification information to the second unit, so as to call the plug-in included in the second unit and corresponding to the identified identification information, with this method, when the operation request needs to be sent between the second unit and the third unit in the application, the sending of the operation request can be completed only by the first unit in the application, so that there is no need to use the same as in the prior art, the operation request is intercepted first and then further processed, so that the problem that the request sending speed is low and further the request response efficiency is low due to the fact that the sent request needs to be intercepted is solved.
Example 3
The embodiment of the application further provides a request sending device, which is used for solving the problem that in the prior art, the request sending speed between the raw application part and the web application part in the hybrid application is low, so that the request response efficiency of the conventional hybrid application is low. The specific structural diagram of the device is shown in fig. 8, and the device comprises: an identification information obtaining unit 31, a correspondence determining unit 32, an operation request receiving unit 33, and a call request transmitting unit 34.
Wherein, the identification information obtaining unit 31 is configured to obtain identification information of at least one plug-in included in the second unit;
a correspondence determining unit 32, configured to determine a correspondence between the identification information and a specified operation request, and store the correspondence between the identification information and the specified operation request;
an operation request receiving unit 33, configured to receive the operation request sent by the third unit, and determine, according to the stored correspondence, identification information corresponding to the operation request;
a calling request sending unit 34, configured to send a calling request including the determined identification information to the second unit according to the determined identification information, so as to call a plug-in included in the second unit and corresponding to the determined identification information.
In an embodiment, the correspondence determining unit 32 is specifically configured to: determining the function of the plug-in corresponding to the identification information; determining an operation request corresponding to the function; and determining the corresponding relation between the operation request and the identification information.
In an embodiment, the call request sending unit 34 is specifically configured to: creating a first message queue for the second unit; sending a calling request containing the determined identification information to a second unit, so that the second unit determines a plug-in corresponding to the identification information according to the identification information; receiving a processing result returned by the second unit through the determined plug-in executing the call request; and storing the processing result in the first message queue.
In one embodiment, the call request sending unit 34 is further configured to: and returning a processing result to the third unit as an operation result corresponding to the operation request sent by the third unit.
In one embodiment, the call request sending unit 34 is further configured to: creating a second message queue for the third unit; acquiring a processing result returned by the second unit through the determined plug-in executing the operation request; and sending the processing result to the third unit, and storing the processing result in the third message queue.
With the request sending apparatus provided in embodiment 3 of the present application, because the first unit can obtain in advance the identification information of the plug-in included in the second unit, and after determining the corresponding relationship between the identification information and the specified operation request, store the corresponding relationship between the identification information and the specified operation request, and after the first unit receives the operation request sent by the third unit, the first unit can determine the identification information corresponding to the operation request according to the pre-stored corresponding relationship, and further send the call request including the identification information to the second unit, so as to call the plug-in included in the second unit and corresponding to the identified identification information, with this method, when the operation request needs to be sent between the second unit and the third unit in an application, the sending of the operation request can be completed only by the first unit in the application, so that there is no need to use the same as in the prior art, the operation request is intercepted first and then further processed, so that the problem that the request sending speed is low and further the request response efficiency is low due to the fact that the sent request needs to be intercepted is solved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that 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 like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A method for sending a request, comprising:
the first unit obtains the identification information of at least one plug-in unit contained in the second unit in advance; the first unit and the second unit are all part of functional units forming application software; the second unit comprises a plurality of functional plug-ins, the application software executes specified operation by calling at least one plug-in the second unit to realize some specified functions of the application software, after the application software is started, the second unit registers the plug-ins in the second unit according to pre-stored configuration information, so that the identification information of the plug-ins contained in the second unit is exposed in the process context of the application operation, and states the functions corresponding to the plug-ins, and then the first unit obtains the identification information of the plug-ins contained in the second unit by calling a uniform interface method; the unified interface method is to apply a method rule which is defined for the first unit in advance and is used for communicating with other units;
determining a corresponding relation between the identification information and a specified operation request, and storing the corresponding relation between the identification information and the specified operation request, wherein the first unit determines a function which can be realized by running the plug-in through plug-in information registered in a process when the second unit runs an application, and further establishes an associated relation between the plug-in and the operation request for calling the function, and stores the associated relation between the identification information of the plug-in and the operation request, so that when the first unit receives the operation request for calling the specified function, the plug-in to be called by the operation request can be determined according to the pre-stored associated relation between the identification information of the plug-in and the operation request;
receiving an operation request sent by a third unit, and determining identification information corresponding to the operation request according to the corresponding relation stored in advance; the third unit is also a part of functional units forming the application software, and the received operation request sent by the third unit not only contains the identification information of the plug-in which the third unit expects to call, but also carries the input parameters of the plug-in which the third unit expects to call;
according to the determined identification information, sending a calling request containing the determined identification information to a second unit so as to call a plug-in corresponding to the determined identification information contained in the second unit; after the first unit determines the identification information corresponding to the operation request sent by the third unit, the first unit sends a calling request with the determined identification information to the second unit containing the plug-in, so that the second unit determines the plug-in corresponding to the identification information according to the identification information contained in the calling request and then calls the plug-in; and respectively establishing a message queue for the second unit and a message queue for the third unit, wherein when the second unit calls the specified plug-in according to the call request sent by the first unit and the plug-in executes the request of the second unit, the plug-in will take out the request processing result in the message queue of the second unit, and return the request processing result to the message queue of the third unit according to a first-in first-out principle, so that the third unit can obtain the processing result of the second unit on the request.
2. The method according to claim 1, wherein determining the correspondence between the identification information and the specified operation request specifically includes:
determining the function of the plug-in corresponding to the identification information;
determining an operation request corresponding to the function;
and determining the corresponding relation between the operation request and the identification information.
3. The method of claim 1, wherein sending a call request containing the determined identification information to a second unit specifically comprises:
creating a first message queue for the second unit;
sending a calling request containing the determined identification information to a second unit, so that the second unit determines a plug-in corresponding to the identification information according to the identification information;
receiving a processing result returned by the second unit through the determined plug-in executing the call request;
and storing the processing result in the first message queue.
4. The method according to claim 3, wherein after sending a call request including the determined identification information to the second unit to call a plug-in included in the second unit corresponding to the determined identification information, the method further comprises:
and returning a processing result to the third unit as an operation result corresponding to the operation request sent by the third unit.
5. The method according to claim 4, wherein returning the processing result to the third unit specifically comprises:
creating a second message queue for the third unit;
acquiring a processing result returned by the second unit through the determined plug-in executing the operation request;
and sending the processing result to the third unit, and storing the processing result in a third message queue.
6. A request transmission apparatus, comprising:
an identification information obtaining unit configured to obtain in advance identification information of at least one plug-in included in the second unit; the first unit and the second unit are all part of functional units forming application software; the second unit comprises a plurality of functional plug-ins, the application software executes specified operation by calling at least one plug-in the second unit to realize some specified functions of the application software, after the application software is started, the second unit registers the plug-ins in the second unit according to pre-stored configuration information, so that the identification information of the plug-ins contained in the second unit is exposed in the process context of the application operation, and states the functions corresponding to the plug-ins, and then the first unit obtains the identification information of the plug-ins contained in the second unit by calling a uniform interface method; the unified interface method is to apply a method rule which is defined for the first unit in advance and is used for communicating with other units;
the corresponding relation determining unit is used for determining the corresponding relation between the identification information and the specified operation request and storing the corresponding relation between the identification information and the specified operation request, wherein the functions which can be realized by running the plug-in are determined through the plug-in information registered in the process when the second unit runs the application, the associated relation between the plug-in and the operation request for calling the functions is further established, and the associated relation between the identification information of the plug-in and the operation request is stored, so that when the operation request for calling the specified function is received, the plug-in to be called by the operation request can be determined according to the pre-stored associated relation between the identification information of the plug-in and the operation request;
an operation request receiving unit, configured to receive the operation request sent by the third unit, and determine, according to the correspondence stored in advance, identification information corresponding to the operation request; the third unit is also a part of functional units forming the application software, and the received operation request sent by the third unit not only contains the identification information of the plug-in which the third unit expects to call, but also carries the input parameters of the plug-in which the third unit expects to call;
the calling request sending unit is used for sending a calling request containing the determined identification information to the second unit according to the determined identification information so as to call the plug-in corresponding to the determined identification information contained in the second unit; after the first unit determines the identification information corresponding to the operation request sent by the third unit, the first unit sends a calling request with the determined identification information to the second unit containing the plug-in, so that the second unit determines the plug-in corresponding to the identification information according to the identification information contained in the calling request and then calls the plug-in; and respectively establishing a message queue for the second unit and a message queue for the third unit, wherein when the second unit calls the specified plug-in according to the call request sent by the first unit and the plug-in executes the request of the second unit, the plug-in will take out the request processing result in the message queue of the second unit, and return the request processing result to the message queue of the third unit according to a first-in first-out principle, so that the third unit can obtain the processing result of the second unit on the request.
7. The apparatus according to claim 6, wherein the correspondence determining unit is specifically configured to:
determining the function of the plug-in corresponding to the identification information;
determining an operation request corresponding to the function;
and determining the corresponding relation between the operation request and the identification information.
8. The apparatus of claim 6, wherein the call request sending unit is specifically configured to:
creating a first message queue for the second unit;
sending a calling request containing the determined identification information to a second unit, so that the second unit determines a plug-in corresponding to the identification information according to the identification information;
receiving a processing result returned by the second unit through the determined plug-in executing the call request;
and storing the processing result in the first message queue.
9. The apparatus of claim 8, wherein the call request sending unit is further configured to:
and returning a processing result to the third unit as an operation result corresponding to the operation request sent by the third unit.
10. The apparatus of claim 9, wherein the call request sending unit is specifically configured to:
creating a second message queue for the third unit;
acquiring a processing result returned by the second unit through the determined plug-in executing the operation request;
and sending the processing result to the third unit, and storing the processing result in a third message queue.
CN201610985894.3A 2016-11-09 2016-11-09 Request sending method and device Active CN106599045B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610985894.3A CN106599045B (en) 2016-11-09 2016-11-09 Request sending method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610985894.3A CN106599045B (en) 2016-11-09 2016-11-09 Request sending method and device

Publications (2)

Publication Number Publication Date
CN106599045A CN106599045A (en) 2017-04-26
CN106599045B true CN106599045B (en) 2020-09-29

Family

ID=58590776

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610985894.3A Active CN106599045B (en) 2016-11-09 2016-11-09 Request sending method and device

Country Status (1)

Country Link
CN (1) CN106599045B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109067818B (en) * 2018-06-04 2019-08-20 杭州数梦工场科技有限公司 A kind of business access method and device
CN109656634A (en) * 2018-11-29 2019-04-19 西安四叶草信息技术有限公司 Plug-in unit call method and equipment
CN111768666B (en) * 2019-04-01 2022-04-08 小船出海教育科技(北京)有限公司 Method and terminal for interacting online classroom

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8595752B1 (en) * 2011-06-13 2013-11-26 Google Inc. Hybrid application message passing
CN104077179A (en) * 2014-06-16 2014-10-01 武汉理工大学 Local application program interface (API) calling method for web browser
CN105450731A (en) * 2015-11-05 2016-03-30 珠海多玩信息技术有限公司 Method and apparatus for realizing communication between web layer and native layer

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103942225B (en) * 2013-01-23 2018-06-08 阿里巴巴集团控股有限公司 A kind of resource transfer method, client and the system of mixed type applications client
CN104834555A (en) * 2015-03-30 2015-08-12 百度在线网络技术(北京)有限公司 Method for invoking functional module, related device and device repairing method
CN105718313A (en) * 2016-01-22 2016-06-29 北京京东尚科信息技术有限公司 Application operation method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8595752B1 (en) * 2011-06-13 2013-11-26 Google Inc. Hybrid application message passing
CN104077179A (en) * 2014-06-16 2014-10-01 武汉理工大学 Local application program interface (API) calling method for web browser
CN105450731A (en) * 2015-11-05 2016-03-30 珠海多玩信息技术有限公司 Method and apparatus for realizing communication between web layer and native layer

Also Published As

Publication number Publication date
CN106599045A (en) 2017-04-26

Similar Documents

Publication Publication Date Title
CN109976667B (en) Mirror image management method, device and system
CN106874174B (en) Method and device for realizing interface test and function test
CN111158818A (en) Page rendering method and device
CN107168960B (en) Service execution method and device
US8966508B2 (en) Method for executing hybrid web application and apparatus therefor
CN103942225A (en) Method and system for invoking resources of Hybrid App client and client
TWI661368B (en) Method and device for information display
CN108647032B (en) Application loading method and device, computer device and computer readable storage medium
CN104821954A (en) Cross-platform remote procedure call method
CN106599045B (en) Request sending method and device
CN111639278A (en) Webpage loading method and device
CN108170430B (en) Interface display method and system
CN112612982A (en) Webpage preloading method and device and computer equipment
CN113076294A (en) Information sharing method and device
CN114168460A (en) Remote debugging method, device and storage medium for front-end code in hybrid development
AU2016101498B4 (en) Data Interchange System
CN109343970B (en) Application program-based operation method and device, electronic equipment and computer medium
CN108287737B (en) Service Worker starting method and device and electronic equipment
CN115809056B (en) Component multiplexing implementation method and device, terminal equipment and readable storage medium
CN112114804A (en) Application program generation method, device and system
CN112583879A (en) Request processing method, device and system, storage medium and electronic equipment
CN113779122B (en) Method and device for exporting data
CN106775790B (en) Control calling method and device
CN109600403B (en) Method and device for sending information
CN106570143B (en) Method and device for sending response object

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
GR01 Patent grant
GR01 Patent grant