An interactive method, device, electronic device and storage medium based on JSBridge

By introducing circular message queues and inter-process communication technology into JSBridge's interactive method, the problem of insufficient data matching in the communication between the Web and Native side is solved, and the efficient operation and accuracy of the system are achieved.

CN116319615BActive Publication Date: 2025-08-29LERONG SMART HOME (BEIJING) TECHNOLOGY DEVELOPMENT CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310236992.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-03-13
Publication Date
2025-08-29
Estimated Expiration
2043-03-13

AI Technical Summary

Technical Problem

In the prior art, when using JSBridge to realize bidirectional communication between the Web and Native ends, there is a lack of consistency judgment between the message data and the return data, resulting in low communication accuracy and low system operation efficiency.

Method used

By introducing the first loop message queue and the second loop message queue in the interactive method of JSBridge, the message data and return data are compared with an independent thread processor, including inter-process communication technology calling the daemon, and ensuring data accuracy by judging the degree of consistency between the return ID and the call ID.

Benefits of technology

It improves the accuracy and operation efficiency of system call results, and enhances the stability and compatibility of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116319615B_ABST
    Figure CN116319615B_ABST
Patent Text Reader

Abstract

The embodiments of the present disclosure provide an interactive method, device, electronic device and storage medium based on JSBridge. Applied to the field of data interaction technology, the method includes the following steps: the first layer sends message data from the first system end to the first circular message queue; the second layer takes out the message data from the first circular message queue and processes the second system end according to the message data to obtain return message data; the second layer sends the return message data to the second circular message queue; the first layer takes out the return message data from the second circular message queue and sends the return message data to the first circular message queue; the second layer takes out the return message data from the first circular message queue and deletes the message data and the return message data from the first circular queue. In this way, the return data and the message data can be compared to improve the accuracy of the system call results, thereby improving the operating efficiency of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of data interaction technology, and in particular to an interaction method, device, electronic device and storage medium based on JSBridge. Background Art

[0002] JSBridge is a "bridge" that enables bidirectional communication between the web and native sides. Existing technologies using JSBridge to achieve bidirectional communication between the web and native sides primarily rely on directly obtaining message data and response data. However, there is a lack of consistency between the obtained message data and the response data, resulting in discrepancies in the consistency between the obtained message data and the response data. This reduces the accuracy of bidirectional communication between the web and native sides, leading to lower system efficiency. Summary of the Invention

[0003] The present disclosure provides an interaction method, device, electronic device and storage medium based on JSBridge.

[0004] According to a first aspect of the present disclosure, a JSBridge-based interaction method is provided. The method comprises:

[0005] The first layer sends the message data from the first system end to the first circular message queue through the first interface;

[0006] The second layer retrieves the message data from the first cyclic message queue through the first interface and processes the second system end according to the message data to obtain return message data;

[0007] The second layer sends the return message data to the second circular message queue through the second interface;

[0008] The first layer takes the return message data from the second cyclic message queue through the second interface and sends the return message data to the first cyclic message queue through the first data interface;

[0009] The second layer takes out the return message data from the first circular message queue through the first interface and deletes the message data and the return message data from the first circular queue.

[0010] According to the above aspects and any possible implementation, an implementation is further provided, wherein the first layer is the H5 layer, the second layer is the Native layer, the first system end is the UI system, and the second system end is the smart home device system.

[0011] Alternatively, the first layer is the Native layer, the second layer is the H5 layer, the first system end is the smart home device system, and the second system end is the UI system.

[0012] According to the above aspect and any possible implementation, an implementation is further provided, wherein the second layer retrieves the message data from the first cyclic message queue through the first interface and processes the second system end according to the message data, including:

[0013] The second layer calls the daemon process through inter-process communication technology according to the message data;

[0014] The daemon process calls the second system end interface according to the message data to control the second system end.

[0015] According to the above aspects and any possible implementation, an implementation is further provided, wherein the structure of the message data includes a scheme, a queue head, a call ID, call data, a return ID, and return data, all of which are string data types.

[0016] According to the above aspect and any possible implementation, further provided is an implementation, wherein deleting the message data and the return message data from the first circular queue includes:

[0017] After taking out the return message data from the first cyclic message queue through the first interface, the second layer determines whether there is a return ID in the return message data.

[0018] If there is a return ID, determining whether the return ID matches the call ID in the message data; if so, deleting the message data and the return message data from the first circular queue; if not, displaying a return error or return exception on the first system end;

[0019] If there is no return ID, the first system end displays a return error or a return exception.

[0020] According to the above aspects and any possible implementation, an implementation is further provided, wherein the data types of the first interface and the second interface are both string types and the corresponding names of the first interface and the second interface are the same.

[0021] According to the above aspects and any possible implementation, an implementation is further provided, wherein the first cyclic message queue and the second cyclic message queue both have processors with independent threads.

[0022] According to a second aspect of the present disclosure, a JSBridge-based interactive device is provided. The device includes:

[0023] A first sending module, configured to send the message data from the first system end to the first cyclic message queue via the first interface at the first layer and / or to send the return message data from the second cyclic message queue to the first cyclic message queue at the first layer;

[0024] A first acquisition module, configured for the second layer to retrieve the message data from the first cyclic message queue via the second interface and / or for the second layer to retrieve the return message data from the first cyclic message queue via the second interface;

[0025] A processing module, configured to process the second system end according to the message data and obtain return message data at the second layer;

[0026] A second sending module, configured to send the return message data to a second circular message queue via a second interface at the second layer;

[0027] A second acquiring unit, configured to retrieve the return message data from the second cyclic message queue via the first interface at the first layer;

[0028] A deletion module is used to delete the message data and the return message data from the first circular queue.

[0029] According to a third aspect of the present disclosure, an electronic device is provided, including:

[0030] at least one processor; and

[0031] a memory communicatively connected to the at least one processor; wherein,

[0032] The memory stores instructions that can be executed by the at least one processor. The instructions are executed by the at least one processor to enable the at least one processor to perform the method described above.

[0033] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method according to the first aspect and / or the second aspect of the present disclosure is implemented.

[0034] The beneficial effect of the present disclosure is that the return data and message data are compared through the first circular queue and the second circular queue, thereby improving the accuracy of the system call result and further improving the operating efficiency of the system.

[0035] It should be understood that the contents described in the Summary of the Invention section are not intended to limit the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. The accompanying drawings are provided for a better understanding of the present disclosure and do not constitute a limitation of the present disclosure. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, among which:

[0037] Figure 1 A flowchart of a JSBridge-based interaction method according to an embodiment of the present disclosure is shown;

[0038] Figure 2 A block diagram of an interactive device based on JSBridge according to an embodiment of the present disclosure is shown;

[0039] Figure 3 A block diagram of an exemplary electronic device capable of implementing embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0040] To make the purpose, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of the present disclosure.

[0041] In this document, the term "and / or" simply describes a relationship between related objects, indicating that three possible relationships exist. For example, "A and / or B" can represent: A exists alone, A and B exist simultaneously, or B exists alone. Furthermore, the character " / " in this document generally indicates that the related objects are in an "or" relationship.

[0042] See also Figure 1 As shown, the present disclosure provides an interactive method based on JSBridge, the method comprising:

[0043] In step S101 , the first layer sends message data from the first system end to the first circular message queue through the first interface.

[0044] In some embodiments, the structure of the message data includes a message scheme, a queue head, a call ID, call data, a return ID and return data, all of which are string data types, and the message scheme and the queue head are separated by ": / / ", wherein the message scheme can be WV_JB_SCHEME, the queue head can be QUEUE_MESSAGE, and the queue head can also be BRIDGE_LOADED.

[0045] In some embodiments, the first layer is the H5 layer, the first system end is the UI system, the name of the first interface can be "DispatchMessageFromJS", and the name of the first interface can also be "SendMessageFromJS", indicating that the data flow is from the first layer to the second layer, and the parameter of the first interface is a string type.

[0046] In some embodiments, the first layer is a Native layer, the first system end is a smart home device system, the name of the first interface may be "DispatchMessageFromNative", and the name of the first interface may also be "SendMessageFromNative".

[0047] In some embodiments, the first cyclic message queue has a first processor with an independent thread to process the first cyclic message queue.

[0048] According to an embodiment of the present disclosure, by processing a cyclic message queue using a processor with an independent thread, the processing speed of the processor is improved, thereby improving the operating efficiency of the system.

[0049] In step S102 , the second layer retrieves the message data from the first cyclic message queue through the first interface and processes the second system end according to the message data to obtain return message data.

[0050] In some embodiments, the second layer is a Native layer, the second system end is a smart home device system, the name of the first interface may be "DispatchMessageFromJS", and the name of the first interface may also be "SendMessageFromJS".

[0051] In some other embodiments, when the Native layer retrieves the message data from the first cyclic message queue through the first interface and processes the smart home device system according to the message data, it includes:

[0052] The Native layer calls the first daemon process through the inter-process communication technology according to the message data;

[0053] The first daemon process calls the smart home device system interface according to the message data to control the smart home device system, for example, controlling parameters of the smart home device system including temperature parameters, humidity parameters, and light intensity parameters.

[0054] According to the embodiments of the present disclosure, the daemon process is called through the inter-process communication technology to achieve rapid information interaction and improve the operating efficiency of the system.

[0055] In some embodiments, the second layer is an H5 layer, the second system end is a UI system, the name of the first interface may be "DispatchMessageFromNative", and the name of the first interface may also be "SendMessageFromNative".

[0056] In some other embodiments, when the H5 layer retrieves the message data from the first cyclic message queue through the first interface and processes the UI system according to the message data, it includes:

[0057] The H5 layer calls the second daemon process through inter-process communication technology according to the message data;

[0058] The second daemon process controls the UI system according to the message data, for example, controls display interface parameters of the UI system including temperature parameters, humidity parameters, and light intensity parameters.

[0059] Step S103: The second layer sends the return message data to the second circular message queue through the second interface.

[0060] In some embodiments, the second cyclic message queue has a second processor with an independent thread to process the second cyclic message queue.

[0061] In some embodiments, the second layer is a Native layer, and the name of the second interface may be “DispatchMessageFromNative”, and the name of the second interface may also be “SendMessageFromNative”.

[0062] According to an embodiment of the present disclosure, by defining the names of the second interface and the first interface to be the same as the corresponding names, subsequent functions can be continuously expanded on this basis, thereby improving the compatibility of the system.

[0063] In some embodiments, the second layer is an H5 layer, the name of the second interface may be “DispatchMessageFromJS”, and the name of the second interface may also be “SendMessageFromJS”.

[0064] Step S104: The first layer retrieves the return message data from the second cyclic message queue through the second interface and sends the return message data to the first cyclic message queue through the first data interface.

[0065] Step S105: The second layer retrieves the return message data from the first circular message queue through the first interface and deletes the message data and the return message data from the first circular queue.

[0066] In some embodiments, the second layer is a Native layer, the name of the first interface may be "DispatchMessageFromJS", and the name of the first interface may also be "DispatchMessageFromJS". The deleting the message data and the return message data from the first circular queue includes:

[0067] After the Native layer retrieves the return message data from the first cyclic message queue through the first interface, it determines whether there is a return ID in the return message data.

[0068] If there is a return ID, determining whether the return ID matches the call ID in the message data; if so, deleting the message data and the return message data from the first circular queue; if not, displaying a return error or return exception on the UI system;

[0069] If there is no return ID, the UI system displays a return error or a return exception.

[0070] According to the embodiments of the present disclosure, the return message data is processed by checking whether there is a return ID in the return message data, and the consistency between the return message data with the return ID and the call ID in the message data is judged to determine whether the call is successful, thereby improving the operating stability of the system.

[0071] In some embodiments, the second layer is an H5 layer, the name of the first interface may be "DispatchMessageFromNative", and the name of the first interface may also be "DispatchMessageFromNative". The deleting the message data and the return message data from the first circular queue includes:

[0072] After the H5 layer retrieves the return message data from the first cyclic message queue through the first interface, it determines whether there is a return ID in the return message data.

[0073] If there is a return ID, determining whether the return ID matches the call ID in the message data; if so, deleting the message data and the return message data from the first circular queue; if not, displaying a return error or return exception on the UI system;

[0074] If there is no return ID, the UI system displays a return error or a return exception.

[0075] According to the embodiments of the present disclosure, the following technical effects are achieved: through the first circular queue and the second circular queue, the return ID of the return data and the call ID in the message data are compared for consistency, thereby improving the accuracy of the system call results and thereby improving the operating efficiency of the system.

[0076] It should be noted that for the aforementioned method embodiments, for simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present disclosure is not limited by the order of the actions described, because according to the present disclosure, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present disclosure.

[0077] The above is an introduction to the method embodiment. The following is a further explanation of the solution disclosed in the present disclosure through an apparatus embodiment.

[0078] See also Figure 2 As shown, Figure 2 FIG. 2 shows a block diagram of an interactive device 200 based on JSBridge according to an embodiment of the present disclosure. Figure 2 As shown, the apparatus 200 includes:

[0079] A first sending module 201 is used for sending the message data from the first system end to the first cyclic message queue through the first interface at the first layer and / or for sending the return message data from the second cyclic message queue to the first cyclic message queue through the first interface at the first layer;

[0080] A first acquisition module 202 is used for the second layer to retrieve the message data from the first cyclic message queue through the first interface and / or for the second layer to retrieve the return message data from the first cyclic message queue through the first interface;

[0081] Processing module 203, configured to process the second system end according to the message data at the second layer and obtain return message data;

[0082] The second sending module 204 is used for sending the return message data to the second circular message queue through the second interface at the second layer;

[0083] A second acquiring unit 205 is configured to retrieve the return message data from the second cyclic message queue via the second interface at the first layer;

[0084] The deleting module 206 is configured to delete the message data and the return message data from the first circular queue.

[0085] In some embodiments, when the processing module 203 processes the second system end according to the message data at the second layer, the second layer is the Native layer, and the second system end is the smart home device system. The specific processing process includes:

[0086] The Native layer calls the daemon process through inter-process communication technology according to the message data;

[0087] The daemon process calls the smart home device system interface according to the message data to control the smart home device system, for example, the parameters of the smart home device system include temperature parameters, humidity parameters and light intensity parameters.

[0088] In some embodiments, the JSBridge-based interaction device 200 also includes a first judgment module and a second judgment module. The first judgment module is used for the second layer to judge whether there is a return ID in the return message data after taking out the return message data from the first circular message queue through the first interface. Specifically: if there is a return ID, then judge whether the return ID and the call ID in the message data are consistent; if there is no return ID, then the first system end displays a return error or a return exception.

[0089] The second judgment module is used to judge whether the return ID and the call ID in the message data match after the first judgment module determines that there is a return ID. Specifically: if they match, the message data and the return message data are deleted from the first circular queue; if they do not match, the first system end displays a return error or a return exception.

[0090] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described module can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.

[0091] In the technical solutions disclosed herein, the acquisition, storage, and application of user personal information involved comply with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0092] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.

[0093] See also Figure 3 As shown, Figure 3 A schematic block diagram of an electronic device 300 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital assistants, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0094] The electronic device 300 includes a computing unit 301, which can perform various appropriate actions and processes according to a computer program stored in a ROM 302 or a computer program loaded from a storage unit 308 into a RAM 303. The RAM 303 may also store various programs and data required for the operation of the electronic device 300. The computing unit 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An I / O interface 305 is also connected to the bus 304.

[0095] Multiple components in the electronic device 300 are connected to the I / O interface 305, including an input unit 306, such as a keyboard, a mouse, etc.; an output unit 307, such as various types of displays, speakers, etc.; a storage unit 308, such as a magnetic disk, an optical disk, etc.; and a communication unit 309, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 309 allows the electronic device 300 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0096] The computing unit 301 can be various general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 301 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units for running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 301 performs the various methods and processes described above, such as the interactive method based on JSBridge. For example, in some embodiments, the interactive method based on JSBridge can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 308. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 300 via ROM 302 and / or communication unit 309. When the computer program is loaded into RAM 303 and executed by the computing unit 301, one or more steps of the interactive method based on JSBridge described above can be executed. Alternatively, in other embodiments, the computing unit 301 may be configured to execute the JSBridge-based interaction method in any other appropriate manner (eg, by means of firmware).

[0097] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0098] The program code for implementing the method of the present disclosure can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the program code is executed by the processor or controller, the functions / operations specified in the flowchart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0099] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0100] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0101] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network (LAN), a wide area network (WAN), and the Internet.

[0102] A computer system may include a client and a server. The client and server are generally remote from each other and typically interact through a communication network. The client-server relationship arises through computer programs running on the respective computers and having a client-server relationship with each other. The server may be a cloud server, a server in a distributed system, or a server integrated with a blockchain.

[0103] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved. This is not limited herein.

[0104] The above specific embodiments do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure shall be included within the scope of protection of this disclosure.

Claims

1. An interactive method based on JSBridge, comprising: The first layer sends the message data from the first system end to the first circular message queue through the first interface; The second layer takes out the message data from the first cyclic message queue through the first interface and processes the second system end according to the message data to obtain return message data; wherein, The first layer is the H5 layer, the second layer is the Native layer, the first system end is the UI system, and the second system end is the smart home device system. Alternatively, the first layer is the Native layer, the second layer is the H5 layer, the first system end is the smart home device system, and the second system end is the UI system; The second layer sends the return message data to the second circular message queue through the second interface; The first layer takes the return message data from the second cyclic message queue through the second interface and sends the return message data to the first cyclic message queue through the first interface; The second layer takes out the return message data from the first cyclic message queue through the first interface and deletes the message data and the return message data from the first cyclic message queue; wherein, After taking out the return message data from the first cyclic message queue through the first interface, the second layer determines whether there is a return ID in the return message data. If there is a return ID, determining whether the return ID matches the call ID in the message data; if so, deleting the message data and the return message data from the first circular queue; if not, displaying a return error or return exception on the first system end; If there is no return ID, the first system end displays a return error or a return exception.

2. The method according to claim 1, wherein When the second layer takes out the message data from the first cyclic message queue through the first interface and processes the second system end according to the message data, it includes: The second layer calls the daemon process through inter-process communication technology according to the message data; The daemon process calls the second system end interface according to the message data to control the second system end.

3. The method according to claim 1, wherein The structure of the message data includes a scheme, a queue head, a call ID, call data, a return ID, and return data, all of which are character string types.

4. The method according to claim 1, wherein The data types of the first interface and the second interface are both string types, and the corresponding names of the first interface and the second interface are the same.

5. The method according to claim 1, wherein The first cyclic message queue and the second cyclic message queue both have processors with independent threads.

6. A JSBridge-based interactive device, comprising: A first sending module, configured to send the message data from the first system end to the first cyclic message queue via the first interface at the first layer and / or to send the return message data from the second cyclic message queue to the first cyclic message queue via the first interface at the first layer; The first acquisition module is used for the second layer to retrieve the message data from the first cyclic message queue through the first interface and / or for the second layer to retrieve the return message data from the first cyclic message queue through the first interface; wherein, The first layer is the H5 layer, the second layer is the Native layer, the first system end is the UI system, and the second system end is the smart home device system. Alternatively, the first layer is the Native layer, the second layer is the H5 layer, the first system end is the smart home device system, and the second system end is the UI system; the processing module is used for the second layer to process the second system end according to the message data and obtain return message data; A second sending module, configured to send the return message data to a second circular message queue via a second interface at the second layer; A second acquiring unit, configured to retrieve the return message data from the second cyclic message queue via the second interface at the first layer; A deletion module is used to delete the message data and the return message data from the first circular message queue; wherein, After taking out the return message data from the first cyclic message queue through the first interface, the second layer determines whether there is a return ID in the return message data. If there is a return ID, determining whether the return ID matches the call ID in the message data; if so, deleting the message data and the return message data from the first circular queue; if not, displaying a return error or return exception on the first system end; If there is no return ID, the first system end displays a return error or a return exception.

7. An electronic device comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.

8. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Information processing method and electronic device

    CN105930467A

  • H5 page and native APP interaction method and device and storage medium

    CN111767052A