Communication method, electronic device, storage medium and program product
By configuring communication middleware, analyzing and processing call requests from the H5 interface, and determining and calling the target processing module, the performance degradation caused by frequent call to multiple Bridges in the H5 interface is solved, and efficient function support and scalability are achieved.
Patent Information
- Application Number
- CN202510024718.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-07
- Publication Date
- 2025-05-09
AI Technical Summary
In the H5 interface, multiple Bridges are frequently called to support different scenarios or functions, resulting in performance degradation, slowing down loading speed, and causing serious coupling of Bridge code, affecting scalability.
By configuring the communication middleware, analyzing the call request of the first application layer, determining the target processing module according to the module mapping table, and controlling it to call the target functional module, obtaining feedback results, and achieving support for multiple scenarios or functions.
It avoids dependence on multiple middleware, avoids frequent calls to container components, ensures the performance and loading speed of the H5 interface, and provides a convenient way for the application layer to extend new application functions.
Smart Images

Figure CN119961534A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to technical fields such as data processing, and more particularly to a communication method, electronic equipment, storage medium, and program product. Background Art
[0002] The H5 (HTML5, Hypertext Markup Language 5th Edition) interface usually interacts with the user through JavaScript. In order to ensure system security, JavaScript runs in a sandbox environment with restricted permissions and has no access to some system functions, such as the inability to access the file system and the inability to use Bluetooth. For functions that the H5 interface cannot use directly, it is necessary to call the system's native program to implement them. Bridge provides a way for the H5 interface to communicate with the system. However, under different calling scenarios or functional requirements, multiple Bridges need to be registered, which will result in frequent calls to container components, affecting the performance and loading speed of the H5 interface. If a single Bridge is used to support multiple scenarios or functions, not only will the Bridge code be severely coupled and the file be too large, affecting the loading speed of the H5 page, but it will also reduce the convenience of expanding other scenarios or functions. Summary of the invention
[0003] The present disclosure provides a communication method, an electronic device, a storage medium and a program product.
[0004] According to one aspect of the present disclosure, a communication method is provided, including: parsing a call request of a first application layer to obtain a target identifier and requirement data, wherein the first application layer is used to receive a trigger signal for a target function, the call request is used to call a target function module having the target function, the target identifier is used to mark the target function, and the requirement data is used to indicate the implementation condition of the target function by the target function module; determining a target processing module associated with the target identifier according to a module mapping table, wherein the module mapping table represents an association relationship between an application function and a processing module; and controlling the target processing module to call a target function module to obtain a feedback result that meets the requirement data, wherein the feedback result is provided by the target function module.
[0005] In some embodiments, before parsing the call request of the first application layer and obtaining the target identifier and requirement data, it includes: configuring a communication middleware, the communication middleware is used to call the target functional module according to the call request, the communication middleware includes a data distributor, the module mapping table and multiple processing modules, and the data distributor is used to parse the call request.
[0006] In some implementations, configuring the communication middleware includes: generating, according to the application function of the first application layer, a processing module capable of calling a functional module having the application function.
[0007] In some embodiments, generating a processing module capable of calling a functional module having the application function includes: writing a basic calling rule and a result return rule into a new module, the basic calling rule being a general calling logic of the processing module to the functional module, and the result return rule being a general return logic of the processing module returning the feedback result to the first application layer; and adjusting the basic calling rule and the result return rule in the new module according to the functional characteristics of the application function to obtain a processing module capable of calling the functional module, and the functional module being capable of realizing the application function after being called.
[0008] In some implementations, configuring the communication middleware includes: establishing an association between the function identifier of the application function and the module identifier of the processing module to form the module mapping table, in which the function identifier and the module identifier correspond one-to-one.
[0009] In some embodiments, before parsing the call request of the first application layer and obtaining the target identifier and requirement data, it includes: in response to the trigger signal, controlling the first application layer to generate a call request containing the requirement data, wherein the trigger signal is used to indicate the triggered target function and contains the requirement data.
[0010] In some implementations, after obtaining the feedback result that satisfies the demand data, the method includes: controlling the target processing module to transmit the feedback result back to the first application layer.
[0011] According to another aspect of the present disclosure, an electronic device is provided, comprising: a memory storing execution instructions; and a processor executing the execution instructions stored in the memory, so that the processor executes the communication method of any one of the above-mentioned embodiments.
[0012] According to another aspect of the present disclosure, a readable storage medium is provided, wherein the readable storage medium stores execution instructions, and when the execution instructions are executed by a processor, the communication method of any of the above embodiments is implemented.
[0013] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the communication method of any one of the above embodiments is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0014] The accompanying drawings illustrate exemplary embodiments of the present disclosure and together with the description serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.
[0015] Figure 1 It is a communication diagram between the first application layer and the second application layer of the related technology.
[0016] Figure 2 It is a schematic diagram of an application scenario of the communication method according to an embodiment of the present disclosure.
[0017] Figure 3 It is an interactive flow chart of a communication method according to an embodiment of the present disclosure.
[0018] Figure 4 It is a flowchart of a call request processing process according to an embodiment of the present disclosure.
[0019] Figure 5 It is a schematic diagram of communication between the first application layer and the second application layer according to an embodiment of the present disclosure.
[0020] Figure 6 It is a flow chart of a communication method according to an embodiment of the present disclosure.
[0021] Figure 7 It is a schematic block diagram of the structure of a communication device according to an embodiment of the present disclosure.
[0022] Figure 8 It is a schematic block diagram of the structure of an electronic device equipped with a communication device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0023] The present disclosure is further described in detail below in conjunction with the accompanying drawings and examples. It is understood that the specific examples described herein are only used to explain the relevant content, rather than to limit the present disclosure. It should also be noted that, for ease of description, only the parts related to the present disclosure are shown in the accompanying drawings.
[0024] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure can be combined with each other. The technical solution of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0025] H5 (HTML5, Hypertext Markup Language 5th Edition) interface usually realizes dynamic interaction with users through the programming language JavaScript. In order to ensure system security, JavaScript runs in a sandbox environment with limited permissions and has no access to some functions of the application system running the H5 interface. Functions that cannot be used directly by the H5 interface need to call the native function layer of the system to implement. The middleware Bridge provides a way for the communication between the H5 interface and the system.
[0026] Figure 1 This is a schematic diagram of the communication between the first application layer and the second application layer in the related technology. Figure 1 , multiple middlewares are registered, such as middleware 1, middleware 2, middleware 3, etc. Each middleware is responsible for calling one or more functional modules of the native functional layer. After the first application layer (such as the H5 interface) triggers the corresponding middleware according to the application function, the called functional module in the second application layer (such as the native functional layer) will perform the corresponding task according to the demand information given by the middleware, obtain the feedback result that meets the demand information, and pass it back to the first application layer. For example, when a map is displayed on the H5 interface, the user clicks the "Current Location" button. JavaScript captures the user operation and calls the GPS (Global Positioning System) module in the native functional layer through the middleware to obtain the user's location information. Then, JavaScript marks on the map according to the obtained location information. In addition to GPS positioning, there are many functions in the application system that JavaScript cannot directly access. In order to meet the calling requirements of these functions, multiple middlewares need to be registered. However, registering multiple middlewares will lead to frequent calls to container components, affecting the performance and loading speed of the H5 interface. If a single middleware is used to support multiple scenarios or functions, the middleware code will be severely coupled and the file will be too large, which will also affect the loading speed of the H5 page and reduce the convenience of expanding other scenarios or functions.
[0027] To this end, the present disclosure proposes a communication method.
[0028] For the convenience of description and to make the technical solutions of the specific implementation methods of the present disclosure easier to understand, before describing the communication method of the implementation methods of the present disclosure, the technical terms involved in the specific design method of the present disclosure are defined as follows:
[0029] The application system includes a first application layer and a second application layer, and has multiple application functions.
[0030] The first application layer is the part of the application system that interacts with the outside world, and usually uses JavaScript to achieve dynamic interaction. The first application layer supports the display of various application functions in the application system, but because it uses JavaScript, in order to ensure the security of the application system, JavaScript cannot call the execution program of the native application function in the application system, and needs to use the function modules of the second application layer to complete the response to these application functions.
[0031] The second application layer is the part generated by the native language of the application system, which can call the execution programs of native application functions (such as GPS positioning, taking pictures, file reading, etc.).
[0032] The communication middleware includes a distributor, multiple processing modules and a module mapping table, which can parse the call request of the first application layer, determine the specific target processing module, and control the target processing module to call the target function module in the second application layer to execute the target function.
[0033] The module mapping table records the correspondence between function identifiers and module identifiers, and represents the association between application functions and processing modules.
[0034] Figure 2 Schematic diagram of an application scenario of a communication method according to an embodiment of the present disclosure. The communication method of the present disclosure can be applied to Figure 2 In the scenario shown, a server 100 and a terminal device 200 may be included in the scenario, and the server 100 and the terminal device 200 interact via a network or the like. The server 100 may be a cloud server or a physical server, and the terminal device 200 may be a computer, a mobile phone or other device, which are not limited here.
[0035] The application functions supported by the first application layer can be displayed on the display screen of the terminal device 200, and can accept the user's first operation (such as click) on any application function. Then, the application function selected by the user and the corresponding demand data are synchronized to the server 100 through the network or other means. The server 100 must first determine whether the first application layer can implement the application function selected by the user. If it can, the first application layer executes the application function and obtains the feedback result. Otherwise, the first application layer is controlled to package the demand data and other contents into a call request, and the communication middleware is controlled to process the call request, that is, the function module in the second application layer is called to implement the application function according to the demand data to obtain the feedback result. The distributor in the communication middleware determines the processing module according to the function identifier in the call request, and the processing module is responsible for calling the corresponding function module to perform the task according to the demand data. Finally, the feedback result is transmitted back on the display screen of the terminal device 200 through the network or other means to complete the implementation of the application function selected by the user.
[0036] The communication method proposed in the present invention avoids the dependence on multiple middlewares, and instead adjusts the architecture of the middleware (i.e., establishing processing modules serving various application functions within the existing middleware, and forming a module mapping table that records the correspondence between processing modules and application functions). This avoids the process of frequently calling container components to generate new middlewares, and also avoids the problem of serious code coupling caused by the integration of multiple application functions in the same middleware. This ensures the page loading speed and provides a convenient way for the application layer to expand new application functions.
[0037] In addition, the processing modules in the communication middleware do not run independently, so creating a new processing module will not affect the work of other processing modules, and there is no need to call container components, which ensures the stability of the first application layer and even the application system and the response efficiency of interaction with users.
[0038] Figure 3 FIG. 1 is an interactive flow chart of a communication method according to an embodiment of the present disclosure. Figure 3 As shown in the figure, the data flow during the implementation of the communication method is shown, which mainly involves the data flow process between the first application layer, the communication middleware and the second application layer. It should be noted that the communication middleware is configured by the server, and the communication middleware's processing logic for the call request and the feedback logic for the feedback result are the server's operation results of the communication method. The server can be Figure 2 The server 100 in FIG.
[0039] In step S301 , the first application layer receives a trigger signal regarding a target function.
[0040] The first application layer is the part of the application system that interacts with the outside world, such as the H5 interface. When the first application layer interacts with the outside world, it is usually implemented in JavaScript. However, when the first application layer displays the application functions that the application system can support to the outside world, it includes application functions that JavaScript can implement or has call permissions, and also includes some native functions of the native system that JavaScript cannot call. For these native functions that JavaScript has no right to call, it is necessary to generate a call request according to step S302. In short, the first application layer is used to receive external trigger signals about any application function, and can display the feedback results of the application function.
[0041] The target function is the application function selected by the user and indicated by the trigger signal. For example, in the H5 interface, there are multiple functions such as the photo function and the GPS positioning function. The user performs the first operation (such as clicking) on the "shoot" button, then the photo function is the user's target function. Any application function can be used as a target function after being selected.
[0042] The trigger signal is generated according to the user's selection of the target function, and includes the selected target function and the requirement data for the result provided by the target function.
[0043] In step S302, the first application layer generates a call request for a target function.
[0044] The target function is an application function selected by the user and which the first application layer has no right to directly implement.
[0045] The call request is generated based on the trigger signal and is used to call the target function module with the target function. The call request shall contain the function identifier and the requirement data. The function identifier is the identifier of the application function, which is used to distinguish different application functions. Each application function has a unique function identifier. The function identifier can be in various forms such as a code and a function name, which are not limited here. The requirement data is used to indicate the implementation conditions of the target function module when executing the target function, such as the requirement for the expected feedback result.
[0046] In step S303, the communication middleware parses the call request to obtain the target identifier and requirement data.
[0047] The communication middleware is an interactive channel between the first application layer and the second application layer, which is used to parse the call request proposed by the first application layer, and call the corresponding functional module in the second application layer according to the content of the call request to achieve the target function. At the same time, the communication middleware also has the ability to transmit the feedback results of the second application layer back to the first application layer. The communication middleware includes a data distributor, multiple processing modules and a module mapping table. The data distributor can determine the processing module corresponding to the function identifier in the call request according to the module mapping table, and then distribute the call request to the corresponding processing module. The processing module calls the functional module of the second application layer, and synchronizes the demand data in the call request to the functional module, so that the functional module executes the application function according to the demand data. The module mapping table represents the association between the application function and the processing module.
[0048] In step S304, the communication middleware determines the target processing module corresponding to the target identifier in the module mapping table. Then, step S305 is executed, and the target processing module in the communication middleware calls the target function module.
[0049] In the aforementioned calling mechanism for the target processing module, it can be seen that the various processing modules in the communication middleware do not run independently. Therefore, creating a new processing module will not affect the work of other processing modules, and there is no need to call the container component, which ensures the stability of the first application layer and even the application system and the response efficiency of interaction with users.
[0050] Further, the second application layer executes step S306, and the called target processing module in the second application layer responds to the target function according to the demand data and obtains a feedback result. For example, if the demand data is to take two photos with a size of 640×480, then the target processing module can be the native function module "camera module" of the application system, and then the camera module takes photos according to the demand data and obtains a feedback result: two photos with a size of 640×480.
[0051] Further, the second application layer executes step S307 to send the feedback result to the communication middleware. Then, the communication middleware executes step S308 to return the feedback result to the first application layer.
[0052] The first application layer executes step S309 and uses the feedback result, for example, synchronizing the taken photos to the user.
[0053] The technical solution disclosed in the present invention, through the configuration of the communication middleware, can determine the corresponding target processing module according to the target identifier of different target functions, and then trigger the target processing module to call the target function module, thereby realizing feedback on the call request. Obviously, compared with the traditional middleware architecture, the communication middleware disclosed in the present invention provides a unique processing module for each application function, avoiding the performance loss and coupling problem of using code stacking to make one module execute multiple call functions; and, since no new middleware is added, the problem of frequent calls to container components is overcome, ensuring the performance of the first application layer such as the H5 interface and the interactive response speed with the user.
[0054] Figure 4 Schematic diagram of the process of processing a call request according to an embodiment of the present disclosure. Figure 4 , describes the specific way in which the server executes the communication method. The server can be Figure 2 The server 100 in FIG.
[0055] Before the application system is put into use, the communication middleware needs to be configured according to the application functions of the first application layer. The application functions mentioned here mainly refer to the application functions that exist in the second application layer but the first application layer has no permission to call. The communication middleware includes a data distributor, multiple processing modules and a module mapping table.
[0056] Specifically, the process of determining the processing module is: first, write the basic call rules and result return rules into the basic processing module Base action. Then, according to the number of application functions in the first application layer, create the same number of new modules, and write the basic call rules and result return rules in the basic processing module into the new modules. The basic call rules are the general call logic of the processing module to the functional module, and the result return rules are the general return logic of the processing module to return the feedback results to the first application layer. Then, according to the functional characteristics of the application function, adjust the basic call rules and result return rules in the new module to obtain a processing module that can call the functional module, and the functional module can realize the application function after being called.
[0057] Obviously, when adding new functions to the first application layer, it is sufficient to generate only one processing module in the existing communication middleware. When generating a processing module, the existing basic calling rules and result return rules can be directly inherited from the basic processing module, which ensures the logical consistency of the calls and returns of each processing module, and improves the efficiency of creating processing modules. In addition, the processing modules in the communication middleware do not run independently, so creating a new processing module will not affect the work of other processing modules, and there is no need to call the container component, which ensures the stability of the first application layer and even the application system and the response efficiency of interacting with users.
[0058] Regarding the module mapping table, each time a processing module is created, the module identifier of the processing module and the function identifier of the corresponding application function will be written into the module mapping table, and the two correspond one to one in the table.
[0059] Furthermore, the first application layer obtains the external trigger signal for the target function and generates a call request. When the first application layer sends a call request, it is usually transmitted in the form of url (Uniform Resource Locator) to reduce the loss of transmission. The call request can be: scheme: / / host / path? query. Scheme represents the system identifier in the application system, host / path is the function identifier, and query represents the required data. For example, XXX: / / camera / takePhoto? width=640&height=480. Among them, the system identifier is XXX. The function identifier is camera / takePhoto (camera / photo), which indicates the application function identified as "camera / takePhoto". The function identifier can also be in the form of digital coding, etc., without limitation. "width=640&height=480" means a photo with a width and height of 640×480, which is the required data and is obtained through the user's trigger signal.
[0060] Further, the first application layer sends the call request to the communication middleware. Then, the data distributor of the communication middleware parses the call request to obtain the target identifier and the required data. Moreover, the data distributor can find the module identifier corresponding to the target identifier in the module mapping table, and then locate the target processing module according to the module identifier. If the module identifier corresponding to the target identifier is not found in the module mapping table, the default is an empty implementation, that is, no processing is performed. For example, if the call request is "XXX: / / camera / takePhoto?width=640&height=480", then the target identifier is "camera / takePhoto", and the module identifier corresponding to "camera / takePhoto" can be queried in the module mapping table, such as "cameraProcrssing". Then, the processing module with the "camera Procrssing" identifier is located as the target processing module.
[0061] Furthermore, the target processing module calls the target function module of the second application layer according to the calling rule, and synchronously responds to the target function requirement data to the target function module. Then, the target function module triggers the target function according to the instruction of the requirement data, and generates a feedback result.
[0062] For example, if the trigger signal is a user clicking on the positioning function, then the target identifier in the call request is the positioning function identifier, and the required data can be to determine the current location of the terminal device running the application system. The target processing module is the processing module in the communication middleware that can call the positioning module to implement the positioning function, and the target function module is a module with a positioning function, such as a GPS module. Then, the GPS module executes the positioning function to obtain the current location of the terminal device running the application system, which can be "52° north latitude, 120° east longitude".
[0063] Furthermore, the target processing module executes the feedback rule and synchronizes the feedback result to the first application layer. After obtaining the result, the first application layer processes it according to the functional characteristics of the application function and displays it. For example, when the trigger signal is a click on the positioning function, the location is marked on the map according to the obtained location data "52° north latitude, 120° east longitude" for the user to view. If the trigger signal is a click on the photo function, the photo in the feedback result is directly displayed on the interface.
[0064] The technical solution disclosed in the present invention, through the configuration of the communication middleware, can determine the corresponding target processing module according to the target identifier of different target functions, and then trigger the target processing module to call the target function module, thereby realizing feedback on the call request. Obviously, compared with the traditional middleware architecture, the communication middleware disclosed in the present invention provides a unique processing module for each application function, avoiding the performance loss and coupling problem of using code stacking to make one module execute multiple call functions; and, since no new middleware is added, the problem of frequent calls to container components is overcome, ensuring the performance of the first application layer such as the H5 interface and the interactive response speed with the user.
[0065] Moreover, it can be seen from the aforementioned calling mechanism for the target processing module that the various processing modules in the communication middleware do not run independently. Therefore, creating a new processing module will not affect the work of other processing modules, and there is no need to call the container component, which ensures the stability of the first application layer and even the application system and the response efficiency of interaction with users.
[0066] Figure 5 Schematic diagram of communication between the first application layer and the second application layer according to an embodiment of the present disclosure. Figure 5 , we can intuitively see the interaction process and mechanism between the first application layer and the second application layer. Obviously, there are only a few (such as 1 in the figure) middlewares between the first application layer and the second application layer, which overcomes the Figure 1 Each function corresponds to a middleware, which causes the disadvantage of frequent calls to container components. Figure 5 The communication middleware includes a distributor, multiple processing modules (such as processing module 1, processing module 2 and processing module 3, etc.), and a module mapping table. If the target processing module associated with the function identifier in the call request is determined to be processing module 2 by searching the module mapping table, the distributor will synchronize the call request to processing module 2. Then, processing module 2 calls the target function module in the second application layer according to the demand data to execute the target function. Finally, processing module 2 returns the feedback result of the target function module to the first application layer according to the return rule.
[0067] Obviously, compared with the traditional middleware architecture (such as Figure 1 ), the communication middleware disclosed in the present invention provides a unique processing module for each application function, avoiding the performance loss and coupling problem of using code stacking to make one module execute multiple calling functions; and because no new middleware is added, the problem of frequent calling of container components is overcome, ensuring the performance of the first application layer such as the H5 interface and the interactive response speed with the user.
[0068] Figure 6 is a flow chart of a communication method according to an embodiment of the present disclosure. Figure 6As shown, in order to implement the aforementioned technical solution, the present disclosure proposes a communication method M600, including: step S610, parsing the call request of the first application layer to obtain a target identifier and requirement data, the first application layer is used to receive a trigger signal for a target function, the call request is used to call a target function module having the target function, the target identifier is used to mark the target function, and the requirement data is used to indicate the implementation condition of the target function by the target function module; step S620, determining the target processing module associated with the target identifier according to a module mapping table, the module mapping table characterizing the association relationship between the application function and the processing module; and step S630, controlling the target processing module to call the target function module to obtain a feedback result that meets the requirement data, and the feedback result is provided by the target function module.
[0069] In some embodiments, the present disclosure further includes: configuring a communication middleware, the communication middleware is used to call a target functional module according to a call request, the communication middleware includes a data distributor, a module mapping table and multiple processing modules, and the data distributor is used to parse the call request.
[0070] Specifically, configuring the communication middleware includes: generating a processing module capable of calling a functional module having the application function according to the application function of the first application layer.
[0071] More specifically, the basic calling rules and result return rules are written into the new module, the basic calling rules are the general calling logic of the processing module to the functional module, and the result return rules are the general return logic of the processing module to return the feedback results to the first application layer; and according to the functional characteristics of the application function, the basic calling rules and result return rules in the new module are adjusted to obtain a processing module that can call the functional module, and the functional module can realize the application function after being called.
[0072] In some implementations, configuring the communication middleware further includes: establishing an association relationship between a function identifier of an application function and a module identifier of a processing module to form a module mapping table, in which the function identifier and the module identifier correspond one to one.
[0073] In some embodiments, the present disclosure further includes: in response to a trigger signal, controlling the first application layer to generate a call request including demand data, wherein the trigger signal is used to indicate a triggered target function and includes the demand data.
[0074] In some implementations, after obtaining the feedback result that meets the demand data, the target processing module is controlled to transmit the feedback result back to the first application layer.
[0075] For more specific implementation methods and implementation principles of each step in the communication method M600 proposed in the present disclosure, please refer to the previous text and will not be repeated here.
[0076] In the aforementioned calling mechanism for the target processing module, it can be seen that the various processing modules in the communication middleware do not run independently. Therefore, creating a new processing module will not affect the work of other processing modules, and there is no need to call the container component, which ensures the stability of the first application layer and even the application system and the response efficiency of interaction with users.
[0077] Compared with the traditional middleware architecture, the communication middleware disclosed in the present invention provides a unique processing module for each application function, avoiding the performance loss and coupling problems of using code stacking to make one module execute multiple calling functions; and because no new middleware is added, the problem of frequent calls to container components is overcome, ensuring the performance of the first application layer such as the H5 interface and the interactive response speed with the user.
[0078] Figure 7 FIG. 1 is a schematic block diagram of a communication device according to an embodiment of the present disclosure. Figure 7 The communication device shown is a virtual device for implementing the communication method M600, including a parsing module 701, a mapping module 702, a calling module 703, etc. The parsing module 701 executes step S610, which is used to parse the call request of the first application layer to obtain the target identifier and the demand data, the first application layer is used to receive the trigger signal for the target function, the call request is used to call the target function module having the target function, the target identifier is used to mark the target function, and the demand data is used to indicate the implementation condition of the target function by the target function module; the mapping module 702 executes step S620, which is used to determine the target processing module associated with the target identifier according to the module mapping table, the module mapping table represents the association relationship between the application function and the processing module; and the calling module 703 executes step S630, which is used to control the target processing module to call the target function module to obtain the feedback result that meets the demand data, and the feedback result is provided by the target function module.
[0079] In some embodiments, the communication device also includes a configuration module (not shown) for configuring the communication middleware, the communication middleware is used to call the target functional module according to the call request, the communication middleware includes a data distributor, a module mapping table and multiple processing modules, and the data distributor is used to parse the call request.
[0080] Specifically, the execution process of the configuration module may be: generating a processing module capable of calling a functional module having the application function according to the application function of the first application layer.
[0081] More specifically, the basic calling rules and result return rules are written into the new module, the basic calling rules are the general calling logic of the processing module to the functional module, and the result return rules are the general return logic of the processing module to return the feedback results to the first application layer; and according to the functional characteristics of the application function, the basic calling rules and result return rules in the new module are adjusted to obtain a processing module that can call the functional module, and the functional module can realize the application function after being called.
[0082] In some implementations, the execution process of the configuration module may also be: establishing an association relationship between the function identifier of the application function and the module identifier of the processing module to form a module mapping table, in which the function identifier and the module identifier correspond one to one.
[0083] In some embodiments, the communication device further includes a request generation module (not shown) for controlling the first application layer to generate a call request including demand data in response to a trigger signal, wherein the trigger signal is used to indicate a triggered target function and includes demand data.
[0084] In some embodiments, the communication device further includes a feedback module (not shown) configured to control the target processing module to feedback the feedback result to the first application layer.
[0085] The modules of the communication device are proposed to implement the steps of the communication method M600. The implementation methods and principles of the modules for the steps can be found in the previous text and will not be described in detail.
[0086] Compared with the traditional middleware architecture, the communication middleware disclosed in the present invention provides a unique processing module for each application function, avoiding the performance loss and coupling problem of using code stacking to make one module execute multiple calling functions; and, since no new middleware is added, the problem of frequent calls to container components is overcome, ensuring the performance of the first application layer such as the H5 interface and the interactive response speed with the user. In addition, in the aforementioned calling mechanism for the target processing module, it can be seen that the various processing modules in the communication middleware do not run independently, so creating a new processing module will not affect the work of other processing modules, and there is no need to call the container component, which ensures the stability of the first application layer and even the application system and the response efficiency of interaction with the user.
[0087] Figure 8 FIG. 1 is a schematic block diagram of an electronic device equipped with a communication device according to an embodiment of the present disclosure. Figure 8 As shown, in the electronic device 1000 equipped with the communication device, the Figure 7 The system also includes a parsing module 701, a mapping module 702 and a calling module 703, and further includes a bus 1100, other circuits 1400, a processor 1500 and a memory 1600, etc.
[0088] The bus 1100 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Component (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the figure only uses one connecting line, but does not mean that there is only one bus or one type of bus.
[0089] The present disclosure also provides a readable storage medium, in which a computer program is stored, and the computer program is used to implement the above method when executed by a processor. "Readable storage medium" can be any device that can contain, store, communicate, propagate or transmit a program for use in an instruction execution system, device or equipment or in combination with these instruction execution systems, devices or equipment. More specific examples of readable storage media include the following: an electrical connection portion (electronic device) with one or more wirings, a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and editable read-only memory (EPROM or flash memory), an optical fiber device, and a portable read-only memory (CDROM), etc.
[0090] The present disclosure also provides a computer program product. The method of the present disclosure can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented by software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed, the process or function of the present disclosure is executed in whole or in part.
[0091] The computer program or instructions may be stored in a readable storage medium or transmitted from one readable storage medium to another readable storage medium, for example, the computer program or instructions may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The readable storage medium may be any available medium that can be accessed or a data storage device such as a server, data center, etc. that integrates one or more available media. The available medium may be a magnetic medium, such as a floppy disk, a hard disk, or a magnetic tape; it may also be an optical medium, such as a digital video disk; it may also be a semiconductor medium, such as a solid state drive. The computer readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.
[0092] Based on the foregoing, the communication method, communication device, storage medium and computer program product disclosed in the present invention all have the following effects: through the configuration of the communication middleware, the corresponding target processing module can be determined according to the target identifier of different target functions, and then the target processing module is triggered to call the target function module, thereby realizing feedback on the call request. Obviously, compared with the traditional middleware architecture, the communication middleware disclosed in the present invention provides a unique processing module for each application function, avoiding the performance loss and coupling problem of using code stacking to make one module execute multiple call functions; and, since no new middleware is added, the problem of frequent calls to container components is overcome, and the performance of the first application layer such as the H5 interface and the interactive response speed with the user are guaranteed.
[0093] Those skilled in the art will appreciate that the embodiments of the present disclosure may be provided as methods, systems, or computer program products. Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0094] The present disclosure is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to the present disclosure. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0095] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0096] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0097] In the description of this specification, the description with reference to the terms "one embodiment / method", "some embodiments / methods", "example", "specific example", or "some examples" etc. means that the specific features, structures, or characteristics described in conjunction with the embodiment / method or example are included in at least one embodiment / method or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment / method or example. Moreover, the specific features, structures, or characteristics described may be combined in any one or more embodiments / methods or examples in a suitable manner. In addition, those skilled in the art may combine and combine different embodiments / methods or examples described in this specification and features of different embodiments / methods or examples, unless they are contradictory.
[0098] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of the present disclosure, "plurality" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0099] Those skilled in the art should understand that the above embodiments are only for the purpose of clearly illustrating the present disclosure, and are not intended to limit the scope of the present disclosure. For those skilled in the art, other changes or modifications may be made based on the above disclosure, and these changes or modifications are still within the scope of the present disclosure.
[0100] It is understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the type, scope of use, and usage scenarios of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations. For example, in response to receiving the user's active request, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require the acquisition and use of the user's personal information. The user can autonomously choose whether to provide personal information to the software or hardware such as the terminal 200, application, server or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message. As an optional but non-limiting implementation method, in response to receiving the user's active request, the method of sending the prompt message to the user can be, for example, a pop-up window, and the prompt information can be presented in the form of text in the pop-up window. In addition, the pop-up window can also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the terminal 200. The above notification and the process of obtaining user authorization are only illustrative and do not constitute a limitation on the implementation method of the present disclosure. Other methods that meet relevant laws and regulations can also be applied to the implementation method of the present disclosure. It is also understandable that the data involved in the technical solution of the present disclosure (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
Claims
1. A communication method, characterized in that: include: Parsing a call request of the first application layer to obtain a target identifier and requirement data, wherein the first application layer is used to receive a trigger signal for a target function, the call request is used to call a target function module having the target function, the target identifier is used to mark the target function, and the requirement data is used to indicate a condition for the target function module to implement the target function; Determining a target processing module associated with the target identifier according to a module mapping table, wherein the module mapping table represents an association relationship between application functions and processing modules; as well as The target processing module is controlled to call the target function module to obtain a feedback result that meets the demand data, and the feedback result is provided by the target function module.
2. The communication method according to claim 1, characterized in that: Before parsing the call request of the first application layer and obtaining the target identifier and required data, it includes: A communication middleware is configured, wherein the communication middleware is used to call the target functional module according to the calling request, the communication middleware comprises a data distributor, the module mapping table and a plurality of processing modules, and the data distributor is used to parse the calling request.
3. The communication method according to claim 2, characterized in that: Configure the communication middleware, including: According to the application function of the first application layer, a processing module capable of calling a functional module having the application function is generated.
4. The communication method according to claim 3, characterized in that: Generating a processing module capable of calling a functional module having the application function, comprising: Writing basic call rules and result return rules into a new module, wherein the basic call rules are the general call logic of the processing module to the function module, and the result return rules are the general return logic of the processing module returning the feedback result to the first application layer; and According to the functional characteristics of the application function, the basic calling rules and result return rules in the new module are adjusted to obtain a processing module capable of calling the functional module, and the functional module can realize the application function after being called.
5. The communication method according to claim 2, characterized in that: Configure the communication middleware, including: An association relationship is established between the function identifier of the application function and the module identifier of the processing module to form the module mapping table. In the module mapping table, the function identifier and the module identifier correspond one to one.
6. The communication method according to claim 1, characterized in that: Before parsing the call request of the first application layer and obtaining the target identifier and required data, it includes: In response to the trigger signal, the first application layer is controlled to generate a call request including the requirement data, wherein the trigger signal is used to indicate a triggered target function and includes the requirement data.
7. The communication method according to claim 1, characterized in that: After obtaining the feedback results that meet the required data, including: Control the target processing module to return the feedback result to the first application layer.
8. An electronic device, characterized in that: include: A memory storing execution instructions; as well as A processor, wherein the processor executes the execution instruction stored in the memory so that the processor executes the communication method according to any one of claims 1 to 7.
9. A readable storage medium, characterized in that: The readable storage medium stores execution instructions, which are used to implement the communication method according to any one of claims 1 to 7 when executed by a processor.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the communication method according to any one of claims 1 to 7 is implemented.