Cross-engine calling method and device, storage medium and electronic equipment

By configuring the engine interface and injecting cross-engine call functions in the JS engine, the communication problem between different JS engine instances is solved, cross-engine data sharing and integration are realized, data processing efficiency is improved and costs are reduced.

CN121743069APending Publication Date: 2026-03-27HANGZHOU NETEASE CLOUD MUSIC TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-26
Publication Date
2026-03-27

Smart Images

  • Figure CN121743069A_ABST
    Figure CN121743069A_ABST
Patent Text Reader

Abstract

The invention relates to the field of data processing, in particular to a cross-engine calling method and device, a storage medium and electronic equipment. The cross-engine calling method comprises the following steps: receiving cross-engine calling data; the cross-engine calling data comprises to-be-called data, a first identifier corresponding to a first engine instance in a calling party engine and a second identifier corresponding to a second engine instance in a processing party engine; calling a cross-engine calling function through an engine interface, and querying a second engine instance matched with the second identifier from a pre-created engine instance map; a cross-engine calling request is sent to the second engine, so that the second engine instance calls a cross-engine processing function through the engine interface to obtain the cross-engine calling data, and data calling and result returning are carried out based on the cross-engine calling data; and receiving a calling result returned by the second engine instance. According to the cross-engine calling method provided by the invention, cross-engine communication can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of data processing, specifically a cross-engine invocation method, a cross-engine invocation device, a storage medium, and an electronic device. Background Technology

[0002] A JS (JavaScript) engine is a virtual machine that processes JavaScript code. It is responsible for parsing, compiling, and executing JavaScript code. Common JS engines include Hermes, JavaScriptCore, and V8.

[0003] The common existing method for calling a JS engine is that the Turbo Native Module system in React Native (RN) provides C++ functions through JSI for the JS code running in the JS engine to call. Then, the C++ code calls the code of the RN application host platform (Android or iOS), thereby realizing communication between the JS code and the host platform code (Java or Objective-C).

[0004] However, in this approach, Turbo Native Module only provides the ability for JS code to call host platform code, but does not enable JS code running in two separate JS engine instances to communicate with each other.

[0005] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention

[0006] The purpose of this disclosure is to provide a cross-engine calling method, cross-engine calling device, storage medium, and electronic device, which aims to solve the problem that JS code running in different JS engine instances cannot communicate with each other.

[0007] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.

[0008] According to one aspect of the embodiments of this disclosure, a cross-engine invocation method is provided, applied to a first engine instance in a calling engine, the method comprising:

[0009] Receive cross-engine call data; the cross-engine call data includes data to be called, a first identifier corresponding to the first engine instance in the calling engine, and a second identifier corresponding to the second engine instance in the processing engine;

[0010] By calling the cross-engine call function through the engine interface, a second engine instance matching the second identifier is queried from the pre-created engine instance map;

[0011] Send a cross-engine call request to the second engine so that the second engine instance can call the cross-engine processing function through the engine interface to obtain the cross-engine call data, and perform data calls and return results based on the cross-engine call data;

[0012] Receive the call result returned by the second engine instance.

[0013] According to some embodiments of this disclosure, based on the foregoing scheme, before receiving cross-engine call data, the method further includes: pre-configuring the engine interface so that the cross-engine call function and the cross-engine processing function can communicate through the engine interface.

[0014] According to some embodiments of this disclosure, based on the foregoing scheme, after configuring the engine interface, the method further includes: after the calling engine has created the engine instance, injecting the cross-engine call function into the engine instance through the engine interface.

[0015] According to some embodiments of this disclosure, based on the foregoing scheme, the method further includes pre-creating the engine instance map, wherein pre-creating the engine instance map includes: after creating the engine instance in the calling engine or the processing engine, configuring an identifier for the engine instance; and saving the mapping relationship between the engine instance and the identifier to obtain the engine instance map.

[0016] According to some embodiments of this disclosure, based on the foregoing scheme, after receiving cross-engine call data, the method further includes: calling a cross-engine call function through an engine interface to query a first identifier matching the first engine instance from the engine instance map; verifying the queried first identifier with the first identifier in the cross-engine call data; and replacing the first identifier in the cross-engine call data with the queried first identifier when the verification results are inconsistent.

[0017] According to a second aspect of the present disclosure, a cross-engine invocation method is provided, applied to a second engine instance in a processing engine, the method comprising:

[0018] In response to a cross-engine call request sent by the calling engine, the cross-engine processing function is invoked through the engine interface to obtain cross-engine call data; the cross-engine call data includes data to be called, a first identifier corresponding to the first engine instance in the calling engine, and a second identifier corresponding to the second engine instance in the processing engine;

[0019] Based on the data to be invoked, a data invocation is performed to obtain the invocation result; and

[0020] By calling cross-engine processing functions through the engine interface, the first engine instance matching the first identifier is queried from the pre-created engine instance map;

[0021] The result of the call is returned to the first engine instance.

[0022] According to a third aspect of the present disclosure, a cross-engine invocation apparatus is provided, applied to a first engine instance in a calling engine, the apparatus comprising:

[0023] The data receiving module is used to receive cross-engine call data; the cross-engine call data includes data to be called, a first identifier corresponding to the first engine instance in the calling engine, and a second identifier corresponding to the second engine instance in the processing engine;

[0024] The first query module is used to call a cross-engine call function through the engine interface to query a second engine instance that matches the second identifier from a pre-created engine instance map;

[0025] The sending module is invoked to send a cross-engine call request to the second engine, so that the second engine instance can call the cross-engine processing function through the engine interface to obtain the cross-engine call data, and perform data calls and return results based on the cross-engine call data;

[0026] The result receiving module is used to receive the call result returned by the second engine instance.

[0027] According to a fourth aspect of the present disclosure, a cross-engine invocation apparatus is provided, applied to a second engine instance in a processing engine, the apparatus comprising:

[0028] The request-response module is used to respond to cross-engine call requests sent by the calling engine and obtain cross-engine call data by calling the cross-engine processing function through the engine interface. The cross-engine call data includes data to be called, a first identifier corresponding to the first engine instance in the calling engine, and a second identifier corresponding to the second engine instance in the processing engine.

[0029] The data retrieval module is used to retrieve data based on the data to be retrieved and obtain the retrieval result; and

[0030] The second query module is used to call cross-engine processing functions through the engine interface to query the first engine instance that matches the first identifier from the pre-created engine instance map;

[0031] The result return module is used to return the call result to the first engine instance.

[0032] According to a fifth aspect of the present disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the cross-engine invocation method as described in the above embodiments.

[0033] According to a sixth aspect of the present disclosure, an electronic device is provided, characterized in that it includes: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the cross-engine invocation method as described in the above embodiments.

[0034] The exemplary embodiments disclosed herein may have some or all of the following beneficial effects:

[0035] In the technical solutions provided by some embodiments of this disclosure, by pre-configuring engine interfaces and pre-injecting cross-engine calling functions and cross-engine processing functions, the calling engine and the processing engine can establish a channel through functions and engine interfaces, thereby realizing cross-engine communication. On the one hand, cross-engine communication allows for real-time data sharing and integration between different systems or applications, improving the efficiency and accuracy of data processing. On the other hand, cross-engine communication allows enterprises to avoid redundant investment in different systems and reduce costs.

[0036] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description

[0037] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:

[0038] Figure 1 The illustration schematically shows a flowchart of a cross-engine invocation method in an exemplary embodiment of this disclosure;

[0039] Figure 2 This schematically illustrates a flowchart of another cross-engine invocation method in an exemplary embodiment of this disclosure;

[0040] Figure 3 This illustration schematically shows a data flow diagram of a cross-engine invocation method in an exemplary embodiment of this disclosure;

[0041] Figure 4This schematic diagram illustrates the composition of a cross-engine invocation device according to an exemplary embodiment of the present disclosure;

[0042] Figure 5 This schematic diagram illustrates the composition of another cross-engine invocation device in an exemplary embodiment of the present disclosure;

[0043] Figure 6 This schematic diagram illustrates a computer-readable storage medium according to an exemplary embodiment of the present disclosure;

[0044] Figure 7 The schematic diagram illustrates the structure of a computer system of an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation

[0045] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more thorough and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art.

[0046] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this disclosure. However, those skilled in the art will recognize that the technical solutions of this disclosure can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this disclosure.

[0047] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0048] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.

[0049] A JS (JavaScript) engine is a virtual machine that processes JavaScript code. It is responsible for parsing, compiling, and executing JavaScript code. Common JS engines include Hermes, JavaScriptCore, and V8.

[0050] In existing technologies, the Turbo Native Module system in React Native (RN) provides C++ functions through JSI for JS code running in the JS engine to call. Then, the RN application host platform (Android or iOS) code is called in the C++ code, thereby realizing communication between the JS code and the host platform code (Java or Objective-C).

[0051] However, Turbo Native Module only provides the ability for JS code to call host platform code, but does not implement the ability for JS code running in two separate JS engine instances to communicate with each other.

[0052] Therefore, in view of the shortcomings of existing technologies where JS code running in different JS engine instances cannot communicate with each other, this application provides a cross-engine calling method. It realizes the location of target engine and function through calling function, processing function and custom communication protocol, and connects them with JSI to establish a channel, thereby realizing cross-JS engine communication.

[0053] The implementation details of the technical solutions of the embodiments of this disclosure are described in detail below.

[0054] Figure 1 This illustration schematically depicts a flowchart of a cross-engine invocation method according to an exemplary embodiment of this disclosure. The cross-engine invocation method is applied to a first engine instance in the calling engine, such as... Figure 1 As shown, the cross-engine invocation method includes steps S101 to S104:

[0055] Step S101: Receive cross-engine call data; the cross-engine call data includes data to be called, a first identifier corresponding to the first engine instance in the calling engine, and a second identifier corresponding to the second engine instance in the processing engine;

[0056] Step S102: Call the cross-engine call function through the engine interface to query the second engine instance that matches the second identifier from the pre-created engine instance map;

[0057] Step S103: Send a cross-engine call request to the second engine so that the second engine instance can call the cross-engine processing function through the engine interface to obtain the cross-engine call data, and perform data call and return the result based on the cross-engine call data;

[0058] Step S104: Receive the call result returned by the second engine instance.

[0059] In the technical solutions provided by some embodiments of this disclosure, by pre-configuring engine interfaces and pre-injecting cross-engine calling functions and cross-engine processing functions, the calling engine and the processing engine can establish a channel through functions and engine interfaces, thereby realizing cross-engine communication. On the one hand, cross-engine communication allows for real-time data sharing and integration between different systems or applications, improving the efficiency and accuracy of data processing. On the other hand, cross-engine communication allows enterprises to avoid redundant investment in different systems and reduce costs.

[0060] The following will describe in more detail each step of the cross-engine invocation method in this example embodiment, with reference to the accompanying drawings and embodiments.

[0061] In step S101, cross-engine call data is received; the cross-engine call data includes data to be called, a first identifier corresponding to the first engine instance in the calling engine, and a second identifier corresponding to the second engine instance in the processing engine.

[0062] Specifically, the method provided in this disclosure is applied to cross-engine calls for data requests, involving two engines: the calling engine and the processing engine. This solves the problem of code running in engine instances on different engines being unable to communicate with each other. The engine can be a JS (JavaScript) engine, a virtual machine used to process JavaScript code, responsible for parsing, compiling, and executing JavaScript code. Common JS engines include Hermes, JavaScriptCore, and V8.

[0063] First, the calling engine receives cross-engine call data. This cross-engine call data includes the data to be called, a first identifier corresponding to the first engine instance in the calling engine, and a second identifier corresponding to the second engine instance in the processing engine. The data to be called is the data in the data request that the processing engine needs to process. Each engine instance in the engine is pre-assigned an identifier after creation for locating and identifying that engine instance. The first identifier is denoted as "source," which is the ID of the engine instance where the calling engine resides, and the second identifier is denoted as "target," which is the ID of the engine instance where the processing engine resides.

[0064] It should be noted that the cross-engine call data is defined by the parameters of the communication protocol. Cross-engine calls are only initiated when cross-engine call data that meets the conditions is received.

[0065] In step S102, a cross-engine call function is invoked through the engine interface to query a second engine instance that matches the second identifier from a pre-created engine instance map.

[0066] Specifically, to enable cross-engine calls between different engines, engine interfaces need to be pre-configured for mutual calls between the calling engine and the processing engine. Additionally, corresponding functions need to be injected into both the calling and processing engines to implement the calling functionality.

[0067] In one embodiment of this disclosure, before receiving cross-engine call data, the method further includes: pre-configuring the engine interface so that the cross-engine call function and the cross-engine processing function can communicate through the engine interface.

[0068] In cross-engine calls in JavaScript, the engine interface is the JavaScript Interface, which is the interface between different JavaScript engines, such as JavaScript and C++, to enable communication and interaction between different JavaScript engines.

[0069] In one embodiment of this disclosure, after configuring the engine interface, the method further includes: after the calling engine has created the engine instance, injecting the cross-engine call function into the engine instance through the engine interface.

[0070] Specifically, for example, a cross-engine call function implemented in C++ can be injected into the engine via JSI as the entry function for cross-engine calls.

[0071] In one embodiment of this disclosure, the method further includes pre-creating the engine instance map, which includes: configuring an identifier for the engine instance after the engine instance is created in the calling engine or the processing engine; and saving the mapping relationship between the engine instance and the identifier to obtain the engine instance map.

[0072] Specifically, regardless of whether it is the calling engine or the processing engine, after the engine instance is created, an ID is assigned to it, and the mapping between the ID and the engine instance is saved in a Map object to obtain the engine instance map.

[0073] Therefore, in JS, after initiating a cross-engine call by calling the cross-engine call function through the engine interface using the cross-engine call data specified by the communication protocol, the implementation of the cross-engine call function uses the target parameter of the passed-in processing engine to find the second engine instance from the Map.

[0074] In step S103, a cross-engine call request is sent to the second engine so that the second engine instance can call the cross-engine processing function through the engine interface to obtain the cross-engine call data, and perform data call and return the result based on the cross-engine call data.

[0075] Specifically, after identifying the second engine instance of the processing engine, a cross-engine call request is sent to the second engine to switch to the processing engine. This allows the second engine instance to call the cross-engine processing function through the engine interface to perform the relevant cross-engine call operations. The cross-engine processing function, similar to the aforementioned cross-engine call function, is pre-configured after the engine interface is created.

[0076] In step S104, the call result returned by the second engine instance is received.

[0077] Specifically, the second engine instance obtains cross-engine call data through the engine interface using cross-engine processing functions, including data to be called. After calling the data based on the data to be called, the data call result is obtained and then returned to the first engine instance corresponding to the first identifier.

[0078] In one embodiment of this disclosure, after receiving cross-engine call data, the method further includes: calling a cross-engine call function through an engine interface to query a first identifier matching the first engine instance from the engine instance map; verifying the queried first identifier with the first identifier in the cross-engine call data; and replacing the first identifier in the cross-engine call data with the queried first identifier when the verification results are inconsistent.

[0079] Because in cross-engine calls, the second engine instance needs to return the data call result to the first engine instance that made the call, the accuracy of the first engine instance in the cross-engine data call is also very important. Sometimes, because the caller may not know the ID of the current engine and pass in a default source value, it is necessary to validate the source value.

[0080] Specifically, iterate through the Map to find the ID corresponding to the current engine instance and use it to verify the source value in the cross-engine call data. If they are inconsistent, update the source parameter.

[0081] Figure 2 This schematically illustrates a flowchart of another cross-engine invocation method in an exemplary embodiment of this disclosure. This cross-engine invocation method is applied to a second engine instance within the processing engine, such as... Figure 2 As shown, the cross-engine invocation method includes steps S201 to S204:

[0082] Step S201: In response to the cross-engine call request sent by the calling engine, the cross-engine processing function is called through the engine interface to obtain the cross-engine call data; the cross-engine call data includes the data to be called, the first identifier corresponding to the first engine instance in the calling engine, and the second identifier corresponding to the second engine instance in the processing engine.

[0083] Step S202: Perform a data retrieval based on the data to be retrieved to obtain the retrieval result; and

[0084] Step S203: Call the cross-engine processing function through the engine interface to query the first engine instance that matches the first identifier from the pre-created engine instance map;

[0085] Step S204: Return the call result to the first engine instance.

[0086] Next, steps S201 to S204 will be explained in detail.

[0087] In step S201, in response to the cross-engine call request sent by the calling engine, the cross-engine processing function is called through the engine interface to obtain the cross-engine call data.

[0088] Specifically, the engine interface is pre-configured for communication between the calling engine and the processing engine. Cross-engine processing functions are injected through the engine interface after the engine instance is created. Therefore, upon responding to a cross-engine call request sent by the calling engine, cross-engine call data can be obtained. The content of the cross-engine call data has been described in detail above and will not be repeated here.

[0089] In step S202, a data call is performed based on the data to be called to obtain the call result.

[0090] Specifically, the cross-engine call data includes the data to be called, which includes the target module name, the target method name, and the actual call parameters (args). Therefore, the engine instance of the calling engine will use the received module and method to find the target function, and use the received args as parameters to call the target function to complete the cross-engine call and obtain the final call result.

[0091] In step S203, a cross-engine processing function is invoked through the engine interface to query a first engine instance that matches the first identifier from a pre-created engine instance map. Specifically, the cross-engine processing function can query the corresponding first engine instance from the Map based on the first identifier in the cross-engine call request passed through the engine interface.

[0092] It should be noted that the execution order of steps S202 and S203 is not limited in this disclosure. They can be executed sequentially or simultaneously. Those skilled in the art should understand that the execution order should not limit this disclosure.

[0093] In step S204, the call result is returned to the first engine instance.

[0094] Once the first engine instance has been determined in step S203, the call result obtained in step S202 can be returned, thus completing the full cross-engine call process.

[0095] Figure 3 This illustration schematically depicts a data flow diagram of a cross-engine invocation method according to an exemplary embodiment of this disclosure. (Reference) Figure 3 As shown, taking the implementation of cross-JS engine communication in C++ and JS respectively as an example, firstly, an engine instance Runtime is created. After the Runtime is created, an engine interface createChannel is created, a Runtime id is assigned to it, and the mapping between the id and the engine instance is saved in a Map object to obtain the Runtime Map. At the same time, the cross-engine call function crossEngineChannelnvoke_ implemented in C++ is injected into the engine instance using the engine interface as the entry function for cross-engine calls.

[0096] In JavaScript, using the parameters (module, method, args, source, target) defined by the communication protocol, the function `crossEngineChannelHandle_` is called across engines. The runtime map searches for the second engine instance using the `target` parameter. Since the caller may not know the current engine's ID and passes a default `source` value, the map is iterated to find the ID corresponding to the current engine instance and the `source` parameter is updated accordingly. Then, a thread switch occurs, switching to the processing engine. The engine interface calls the cross-engine processing function `crossEngineChannelHandle_` from the second engine instance of the JavaScript processing engine. The cross-engine processing function provided in JavaScript as a JSSDK uses the received `module` and `method` to find the target function and calls the target function with the received `args` as parameters, thus completing the cross-engine call.

[0097] Based on the above method, by utilizing the JSI engine interface, a custom communication protocol is used to call the second engine instance and target function location functions implemented in C++ and JS respectively, thereby realizing cross-JS engine communication and providing more options for the application's technical architecture.

[0098] Figure 4 This schematic diagram illustrates the composition of a cross-engine invocation device in an exemplary embodiment of the present disclosure, such as... Figure 4 As shown, the cross-engine invocation device 400 may include a data receiving module 401, a first query module 402, an invocation sending module 403, and a result receiving module 403. Wherein:

[0099] The data receiving module 401 is used to receive cross-engine call data; the cross-engine call data includes data to be called, a first identifier corresponding to the first engine instance in the calling engine, and a second identifier corresponding to the second engine instance in the processing engine.

[0100] The first query module 402 is used to call a cross-engine call function through the engine interface to query a second engine instance that matches the second identifier from a pre-created engine instance map;

[0101] The sending module 403 is invoked to send a cross-engine call request to the second engine, so that the second engine instance can call the cross-engine processing function through the engine interface to obtain the cross-engine call data, and perform data call and return the result based on the cross-engine call data;

[0102] Result receiving module 404 is used to receive the call result returned by the second engine instance.

[0103] According to an exemplary embodiment of this disclosure, the cross-engine invocation device 400 further includes a configuration module for pre-configuring the engine interface before receiving cross-engine invocation data, so that the cross-engine invocation function and the cross-engine processing function can communicate through the engine interface.

[0104] According to an exemplary embodiment of this disclosure, the configuration module is further configured to, after configuring the engine interface, inject the cross-engine call function into the engine instance through the engine interface after the calling engine has created the engine instance.

[0105] According to an exemplary embodiment of this disclosure, the configuration module is further configured to pre-create the engine instance map, including: after creating the engine instance in the caller engine or the processor engine, configuring an identifier for the engine instance; and saving the mapping relationship between the engine instance and the identifier to obtain the engine instance map.

[0106] According to an exemplary embodiment of this disclosure, the first query module is further configured to, after receiving cross-engine call data, call a cross-engine call function through an engine interface to query a first identifier that matches the first engine instance from the engine instance map; verify the queried first identifier with the first identifier in the cross-engine call data; and replace the first identifier in the cross-engine call data with the queried first identifier when the verification result is inconsistent.

[0107] The specific details of each module in the cross-engine invocation device 400 have been described in detail in the corresponding cross-engine invocation method, so they will not be repeated here.

[0108] Figure 5This schematic diagram illustrates the composition of a cross-engine invocation device in an exemplary embodiment of the present disclosure, such as... Figure 5 As shown, the cross-engine invocation device 500 may include a request-response module 501, a data retrieval module 502, a second query 503, and a result return module 503. Wherein:

[0109] The request-response module is used to respond to cross-engine call requests sent by the calling engine and obtain cross-engine call data by calling the cross-engine processing function through the engine interface. The cross-engine call data includes data to be called, a first identifier corresponding to the first engine instance in the calling engine, and a second identifier corresponding to the second engine instance in the processing engine.

[0110] The data retrieval module is used to retrieve data based on the data to be retrieved and obtain the retrieval result; and

[0111] The second query module is used to call cross-engine processing functions through the engine interface to query the first engine instance that matches the first identifier from the pre-created engine instance map;

[0112] The result return module is used to return the call result to the first engine instance.

[0113] The specific details of each module in the cross-engine invocation device 500 have been described in detail in the corresponding cross-engine invocation method, so they will not be repeated here.

[0114] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0115] In an exemplary embodiment of this disclosure, a storage medium capable of implementing the above-described method is also provided. Figure 6 This schematic diagram illustrates a computer-readable storage medium according to an exemplary embodiment of the present disclosure, such as... Figure 6 As shown, a program product 600 for implementing the above-described method according to an embodiment of the present disclosure is described. This product may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a mobile phone. However, the program product of the present disclosure is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.

[0116] In an exemplary embodiment of this disclosure, an electronic device capable of implementing the above-described method is also provided. Figure 7 The schematic diagram illustrates the structure of a computer system of an electronic device according to an exemplary embodiment of the present disclosure.

[0117] It should be noted that, Figure 7 The computer system 700 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.

[0118] like Figure 7 As shown, the computer system 700 includes a Central Processing Unit (CPU) 701, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 702 or programs loaded from storage section 708 into Random Access Memory (RAM) 703. The RAM 703 also stores various programs and data required for system operation. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An Input / Output (I / O) interface 705 is also connected to the bus 704.

[0119] The following components are connected to I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on drive 710 as needed so that computer programs read from it can be installed into storage section 708 as needed.

[0120] In particular, according to embodiments of this disclosure, the processes described below with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by central processing unit (CPU) 701, it performs various functions defined in the system of this disclosure.

[0121] It should be noted that the computer-readable medium shown in the embodiments of this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.

[0122] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0123] The units described in the embodiments of this disclosure can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the unit itself.

[0124] In another aspect, this disclosure also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to perform the methods described in the above embodiments.

[0125] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0126] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the method according to the embodiments of this disclosure.

[0127] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein.

[0128] It should be understood that this disclosure is not limited to the precise structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this disclosure is limited only by the appended claims.

Claims

1. A cross-engine invocation method, characterized in that, The method, applied to the first engine instance in the calling engine, includes: Receive cross-engine call data; the cross-engine call data includes data to be called, a first identifier corresponding to the first engine instance in the calling engine, and a second identifier corresponding to the second engine instance in the processing engine; By calling the cross-engine call function through the engine interface, a second engine instance matching the second identifier is queried from the pre-created engine instance map; Send a cross-engine call request to the second engine so that the second engine instance can call the cross-engine processing function through the engine interface to obtain the cross-engine call data, and perform data calls and return results based on the cross-engine call data; Receive the call result returned by the second engine instance.

2. The cross-engine invocation method according to claim 1, characterized in that, Before receiving cross-engine call data, the method further includes: The engine interface is pre-configured so that the cross-engine call function and the cross-engine processing function can communicate through the engine interface.

3. The cross-engine invocation method according to claim 2, characterized in that, After configuring the engine interface, the method further includes: After the calling engine has created the engine instance, the cross-engine call function is injected into the engine instance through the engine interface.

4. The cross-engine invocation method according to claim 1, characterized in that, The method further includes pre-creating the engine instance map, wherein pre-creating the engine instance map includes: After the engine instance is created in the calling engine or the processing engine, an identifier is configured for the engine instance; The mapping relationship between the engine instance and the identifier is saved to obtain the engine instance map.

5. The cross-engine invocation method according to claim 1, characterized in that, After receiving cross-engine call data, the method further includes: By calling a cross-engine call function through the engine interface, a first identifier matching the first engine instance is queried from the engine instance map; Verify the first identifier in the query with the first identifier in the cross-engine call data; If the test results are inconsistent, the first identifier in the cross-engine call data will be replaced by the first identifier in the query.

6. A cross-engine invocation method, characterized in that, The method, applied to a second engine instance in the processing engine, includes: In response to a cross-engine call request sent by the calling engine, the cross-engine processing function is invoked through the engine interface to obtain cross-engine call data; the cross-engine call data includes data to be called, a first identifier corresponding to the first engine instance in the calling engine, and a second identifier corresponding to the second engine instance in the processing engine; Based on the data to be invoked, a data invocation is performed to obtain the invocation result; and By calling cross-engine processing functions through the engine interface, the first engine instance matching the first identifier is queried from the pre-created engine instance map; The result of the call is returned to the first engine instance.

7. A cross-engine invocation device, characterized in that, The apparatus is applied to a first engine instance in the calling engine, and includes: The data receiving module is used to receive cross-engine call data; the cross-engine call data includes data to be called, a first identifier corresponding to the first engine instance in the calling engine, and a second identifier corresponding to the second engine instance in the processing engine; The first query module is used to call a cross-engine call function through the engine interface to query a second engine instance that matches the second identifier from a pre-created engine instance map; The sending module is invoked to send a cross-engine call request to the second engine, so that the second engine instance can call the cross-engine processing function through the engine interface to obtain the cross-engine call data, and perform data calls and return results based on the cross-engine call data; The result receiving module is used to receive the call result returned by the second engine instance.

8. A cross-engine invocation device, characterized in that, The apparatus, applied to a second engine instance in a processing engine, comprises: The request-response module is used to respond to cross-engine call requests sent by the calling engine and obtain cross-engine call data by calling the cross-engine processing function through the engine interface. The cross-engine call data includes data to be called, a first identifier corresponding to the first engine instance in the calling engine, and a second identifier corresponding to the second engine instance in the processing engine. The data retrieval module is used to retrieve data based on the data to be retrieved and obtain the retrieval result; and The second query module is used to call cross-engine processing functions through the engine interface to query the first engine instance that matches the first identifier from the pre-created engine instance map; The result return module is used to return the call result to the first engine instance.

9. A computer-readable storage medium having a computer program stored thereon, the program, when executed by a processor, implementing the cross-engine invocation method as described in any one of claims 1 to 6.

10. An electronic device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the cross-engine invocation method as described in any one of claims 1 to 6.