CN112988408A - Multi-terminal interaction method and device - Google Patents

Multi-terminal interaction method and device Download PDF

Info

Publication number
CN112988408A
CN112988408A CN201911301912.1A CN201911301912A CN112988408A CN 112988408 A CN112988408 A CN 112988408A CN 201911301912 A CN201911301912 A CN 201911301912A CN 112988408 A CN112988408 A CN 112988408A
Authority
CN
China
Prior art keywords
message
processed
application
terminal
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911301912.1A
Other languages
Chinese (zh)
Inventor
黄珊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Wodong Tianjun Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Wodong Tianjun Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201911301912.1A priority Critical patent/CN112988408A/en
Publication of CN112988408A publication Critical patent/CN112988408A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues

Abstract

The invention discloses a multi-terminal interaction method and device, and relates to the field of computer technology. One embodiment of the method comprises: receiving a message processing request sent by a first end, wherein the message processing request indicates a message to be processed and a second end for receiving the message to be processed; judging whether the message to be processed meets a preset rule or not; and under the condition that the message to be processed accords with the preset rule, sending the message to be processed to the second end. The implementation mode reduces the code redundancy of the communication module and improves the safety and reliability of multi-terminal communication interaction.

Description

Multi-terminal interaction method and device
Technical Field
The invention relates to the technical field of computers, in particular to a multi-terminal interaction method and device.
Background
In order to improve the development efficiency of the application, more and more applications adopt a cross-end development scheme, for example, development of front-end application is performed through development frameworks such as Flutter and Weex, so that the development efficiency of the application is greatly improved, and the configuration is more flexible. In the process of using the development framework to develop the application, the communication interaction between the development framework end and the application end is involved, and a commonly adopted method is to use a dual-end protocol communication module and then register the communication module to the application end so as to realize the communication interaction between the development framework end and the application end.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art: the application end is often configured with a plurality of service modules according to functional requirements, and each service module needs to register a corresponding communication module in the communication interaction process, so that communication module code redundancy is caused; meanwhile, the communication modes corresponding to different service modules are changed due to different service logics, the coupling degree with the service modules is high, the maintenance is inconvenient, the unified management cannot be performed, and the stability is poor.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for multi-port interaction, which can avoid a large amount of redundancy of communication module codes in the prior art, improve the stability of communication interaction, and simultaneously perform unified management and maintenance on communication modules.
To achieve the above object, according to a first aspect of the present invention, there is provided a multi-end interaction method, including:
receiving a message processing request sent by a first end, wherein the message processing request indicates a message to be processed and a second end for receiving the message to be processed;
judging whether the message to be processed meets a preset rule or not;
and under the condition that the message to be processed accords with the preset rule, sending the message to be processed to the second end.
Alternatively,
the first end is an application end, and the second end is an application development end;
or the first end is an application development end, and the second end is an application end.
Optionally, the method further comprises:
under the condition that the message to be processed does not accord with the preset rule, performing one or more of the following processes on the message to be processed: and deleting the message to be processed and sending the exception prompt of the message to be processed to the second end.
Alternatively,
the first end and the second end are configured with one or more corresponding service modules, and the service modules are used for processing the received message to be processed.
Alternatively,
the preset rules include one or more of the following: the size of the message to be processed, whether the message to be processed indicates the corresponding service module, whether the message to be processed indicates a method for calling the service module, and whether the message to be processed indicates the parameter of the method.
Alternatively,
when the first end is an application development end and the second end is an application end, the preset rule further includes: and whether the message to be processed indicates that the application terminal calls back the method of the application development terminal according to the message to be processed.
Alternatively,
and under the condition that the first end is an application development end and the second end is an application end, the application end dynamically calls the service module to process the message to be processed according to the received message to be processed.
Alternatively,
the application terminal is an APP terminal, and the application development terminal is a React Native terminal.
To achieve the above object, according to a second aspect of the present invention, there is provided a multi-end interaction device, comprising: the system comprises a message processing request receiving module, a to-be-processed message verifying module and a to-be-processed message sending module; wherein the content of the first and second substances,
the message processing request receiving module is used for receiving a message processing request sent by a first end, wherein the message processing request indicates a message to be processed and a second end for receiving the message to be processed;
the to-be-processed message verification module is used for judging whether the to-be-processed message meets a preset rule or not;
and the message to be processed sending module is used for sending the message to be processed to the second end under the condition that the message to be processed accords with a preset rule.
Alternatively,
the first end is an application end, and the second end is an application development end;
or the first end is an application development end, and the second end is an application end.
Alternatively,
the message sending module to be processed is also used for,
under the condition that the message to be processed does not accord with the preset rule, performing one or more of the following processes on the message to be processed: and deleting the message to be processed and sending the exception prompt of the message to be processed to the second end.
Alternatively,
the first end and the second end are configured with one or more corresponding service modules, and the service modules are used for processing the received message to be processed.
Alternatively,
the preset rules include one or more of the following: the size of the message to be processed, whether the message to be processed indicates the corresponding service module, whether the message to be processed indicates a method for calling the service module, and whether the message to be processed indicates the parameter of the method.
Alternatively,
when the first end is an application development end and the second end is an application end, the preset rule further includes: and whether the message to be processed indicates that the application terminal calls back the method of the application development terminal according to the message to be processed.
Alternatively,
and under the condition that the first end is an application development end and the second end is an application end, the application end dynamically calls the service module to process the message to be processed according to the received message to be processed.
Alternatively,
the application terminal is an APP terminal, and the application development terminal is a React Native terminal.
To achieve the above object, according to a third aspect of the present invention, there is provided an electronic device for multi-terminal interaction, comprising: one or more processors; storage means for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a method as described in any of the multi-terminal interaction methods described above.
To achieve the above object, according to a fourth aspect of the present invention, there is provided a computer readable medium having stored thereon a computer program which, when executed by a processor, implements any one of the methods of multi-terminal interaction as described above.
The invention has the following advantages or beneficial effects: by providing a uniform multi-terminal interaction device, the communication interaction between the application terminal and the application development terminal is realized, the operation is simple, and a large amount of redundant communication module codes which need to be registered and compiled due to different service modules are avoided; meanwhile, the to-be-processed message of the communication interaction can be verified and processed, the legality of the to-be-processed message of the communication interaction is guaranteed, some abnormal conditions are avoided, and the safety and the reliability of the communication interaction are improved.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a main flow of a multi-terminal interaction method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of the main modules of a multi-port interaction device according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of an application method of a multi-terminal interaction device according to an embodiment of the invention;
FIG. 4 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 5 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a multi-port interaction method according to an embodiment of the present invention, and as shown in fig. 1, the multi-port interaction method may specifically include the following steps:
step S101, receiving a message processing request sent by a first end, wherein the message processing request indicates a message to be processed and a second end for receiving the message to be processed.
The first end or the second end includes, but is not limited to: an application development end and an application end. The application end comprises a native application end and a web application end. In a preferred embodiment, the first end is an application end, and the second end is an application development end; or the first end is an application development end, and the second end is an application end. That is, the first end and the second end do not directly perform communication interaction, but perform communication interaction by using a preset multi-end interaction device as an intermediate device. More specifically, the multi-port interactive device may provide APIs (i.e., application programming interfaces) to the first port and the second port, respectively, so that the first port and the second port may transfer messages by calling the APIs, and then send the messages transferred by the first port and the second port to the corresponding second port and first port.
In an optional implementation manner, the application end is an APP end, and the application development end is a read Native end. It can be understood that, in the case that the application end is an APP end, the application development end may also be an application development framework such as Flutter, Weex, and the like. The fact Native is a Facebook open-source cross-platform mobile application development framework and supports the development of iOS and Android applications. Flutter refers to google's mobile UI framework and can quickly build a high-quality native user interface on iOS and Android. Weex refers to a cross-platform mobile development tool in Ali, and supports the development of various applications such as iOS, android, YunOS, Web and the like.
In an optional implementation manner, the first end and the second end are configured with one or more corresponding service modules, and the service modules are configured to process the received message to be processed. The number of the business modules and the number of the business modules can be set according to the functional requirements of the application, such as a commodity list display module, a commodity detail page module, a commodity settlement module and the like.
Step S102, judging whether the message to be processed accords with a preset rule.
It can be understood that, since the message to be processed may originate from one or more service modules at the first end, the message to be processed needs to be correspondingly sent to one or more service modules at the second end to process the message to be processed. Therefore, in order to ensure that the message to be processed is normally transmitted between the first end and the second end, the message processing at least needs to indicate a service module for processing the message to be processed, a method for calling the service module, parameters required to be transmitted by the method, and the like. In addition, the size of the message to be processed can be verified, if the size exceeds 1M or 1GB, and the like, so that malicious occupation and waste of resources caused by malicious transmission of large-size messages can be prevented.
It is understood that the preset rule can be any rule set according to actual requirements, and in a preferred embodiment, the preset rule includes one or more of the following: the size of the message to be processed, whether the message to be processed indicates the corresponding service module, whether the message to be processed indicates a method for calling the service module, and whether the message to be processed indicates the parameter of the method.
In an optional implementation manner, in a case that the message to be processed does not comply with the preset rule, the message to be processed is subjected to one or more of the following processes: and deleting the message to be processed and sending the exception prompt of the message to be processed to the second end. In the actual execution process, the processing mode of the message to be processed which does not conform to the preset rule can be selected according to the influence degree of the message to be processed on the normal operation of the second-end service. For example, taking the example that the to-be-processed message indicates the to-be-updated commodity list, when the current to-be-processed message is abnormal, the to-be-processed message may be continuously sent to the service module corresponding to the second end to update and display the commodity list, and at the same time, the to-be-processed message is prompted to be abnormal to the second end, or the to-be-processed message may be only prompted to be abnormal to the second end, so as to avoid an error in the updated commodity list, or an error in the display of the commodity list page due to failure to complete the update of the commodity list. In addition, under the condition that the message to be processed does not accord with the preset rule, the exception of the message to be processed can be only prompted to the second end of the received message according to the actual requirement so that the second end can process the abnormal message to be processed carefully or selectively; or only prompting the exception of the message to be processed to the first end sending the message so that the first end resends the normal message to be processed, or simultaneously sending the prompt exception of the message to be processed to the first end and the second end.
In an optional implementation manner, in a case that the first end is an application development end, and the second end is an application end, the preset rule further includes: and whether the message to be processed indicates that the application terminal calls back the method of the application development terminal according to the message to be processed. Specifically, the first end is a read Native end, the second end is a Native APP end, for example, when the message to be processed sent from the read Native end to the Native APP end indicates a network request or the like that requires the Native APP to send back data corresponding to the message to be processed again, the Native APP end needs to send the obtained data to the read Native end when receiving the network request and obtain corresponding data according to the network request, and therefore, when the message to be processed is sent from the read Native end to the Native APP end, the message to be processed also needs to indicate that corresponding data is sent back, that is, a method required when the corresponding read Native end is called back, and parameters and the like that need to be sent in by the method, so that the read Native end can receive data corresponding to the network request in time.
In an optional implementation manner, when the first end is an application development end and the second end is an application end, the application end dynamically calls the service module to process the message to be processed according to the received message to be processed. It can be understood that, because the first end and the second end both have one or more different service modules, and the service modules corresponding to the message to be processed each time may be different, the second end needs to dynamically invoke the corresponding service module to process the message to be processed when receiving the message to be processed. Specifically, the first end is a read Native end, and the second end is a Native APP end in the IOS, for example, when the Native APP end receives a corresponding to-be-processed message, an object may be dynamically created according to the to-be-processed message through a dynamic forwarding function in the IOS, and then a corresponding service module is called according to the created object to implement processing of the to-be-processed message.
More further, under the condition that the message to be processed and the dynamically created object are correspondingly stored in the multi-end interaction device by using a hash table and the like, when the message to be processed is received by the primary APP end and the like, whether the object corresponding to the message to be processed exists in the hash table is judged firstly, if yes, the created object is not required to directly use the existing object to call the corresponding service module, and if not, the corresponding object still needs to be created for the message to be processed, and the corresponding service module is called according to the created object to realize the processing of the message to be processed.
Step S103, under the condition that the message to be processed accords with the preset rule, the message to be processed is sent to the second end. Specifically, taking the first end as the APP end and the second end as the fact Native end as an example for explanation, for a message that needs to be sent to the fact Native end, the fact Native end may use a Listener to listen to a to-be-processed message sent from the APP end.
Based on the embodiment, the communication interaction between the application terminal and the application development terminal is realized by providing a uniform multi-terminal interaction device, the operation is simple, and a large amount of redundant communication module codes which need to be registered and compiled due to different service modules are avoided; meanwhile, the to-be-processed message of the communication interaction can be verified and processed, the legality of the to-be-processed message of the communication interaction is guaranteed, some abnormal conditions are avoided, and the safety and the reliability of the communication interaction are improved.
Referring to fig. 2, on the basis of the above embodiment, an embodiment of the present invention provides a multi-port interaction apparatus 200, including: a message processing request receiving module 201, a to-be-processed message verifying module 202 and a to-be-processed message sending module 203; wherein the content of the first and second substances,
the message processing request receiving module 201 is configured to receive a message processing request sent by a first end, where the message processing request indicates a message to be processed and a second end that receives the message to be processed;
the to-be-processed message verification module 202 is configured to determine whether the to-be-processed message meets a preset rule;
the to-be-processed message sending module 203 is configured to send the to-be-processed message to the second end when the to-be-processed message meets a preset rule.
In an alternative embodiment, the first end is an application end, and the second end is an application development end; or the first end is an application development end, and the second end is an application end.
In an alternative embodiment, the pending message sending module 203 is further configured to,
under the condition that the message to be processed does not accord with the preset rule, performing one or more of the following processes on the message to be processed: and deleting the message to be processed and sending the exception prompt of the message to be processed to the second end.
In an optional implementation manner, the first end and the second end are configured with one or more corresponding service modules, and the service modules are configured to process the received message to be processed.
In an alternative embodiment, the preset rules include one or more of the following: the size of the message to be processed, whether the message to be processed indicates the corresponding service module, whether the message to be processed indicates a method for calling the service module, and whether the message to be processed indicates the parameter of the method.
In an optional implementation manner, in a case that the first end is an application development end, and the second end is an application end, the preset rule further includes: and whether the message to be processed indicates that the application terminal calls back the method of the application development terminal according to the message to be processed.
In an optional implementation manner, when the first end is an application development end and the second end is an application end, the application end dynamically calls the service module to process the message to be processed according to the received message to be processed. It can be understood that, in the case that the to-be-processed message and the dynamically created object are correspondingly stored in the multi-port interaction device 200 by using a hash table, the native APP side and the like firstly determine whether an object corresponding to the to-be-processed message exists in the hash table when receiving the to-be-processed message, if so, the created object is not required to directly use the existing object to call the corresponding service module, and if not, the corresponding object still needs to be created for the to-be-processed message, and the corresponding service module is called according to the created object to implement processing of the to-be-processed message.
In an optional implementation manner, the application end is an APP end, and the application development end is a read Native end.
Referring to fig. 3, on the basis of the above embodiment, the embodiment of the present invention provides a schematic diagram of an application method of a multi-end interaction device, and specifically, an example is still described in which two interactive ends are an APP end and a read Native end, respectively, where the APP end and the read Native end are configured with a service module 1, a service module 2, a service module 3, and the like, respectively, and the multi-end interaction device 200 is disposed at the APP end:
under the condition that the APP end needs to send a message to be processed to the React Native end, the APP end sends a message request to be processed to the multi-end interaction device 200 through an API provided by the multi-end interaction device 200, wherein the message request to be processed refers to the message to be processed and the React Native end for receiving the message to be processed; after receiving the message request to be processed, the multi-end interaction device 200 determines whether the corresponding message to be processed indicates the name of a service module, such as a service module 1, a service module 2 and the like, in the read Native end for processing the message to be processed, and whether the message to be processed indicates a method for calling the service module in the read Native end and parameters which need to be introduced by the method; under the condition that the messages to be processed indicate the information, the messages to be processed are sent to the fact Native end, so that the fact Native end calls a corresponding service module to process the messages to be processed according to the indication method and the parameters of the messages to be processed; and under the condition that the message to be processed does not indicate all the information, deleting the message to be processed, and simultaneously prompting the abnormality of the message to be processed to the read Native end and the APP end.
Under the condition that the React Native terminal needs to send a message to be processed to the APP terminal, the React Native terminal sends a message request to be processed to the multi-terminal interaction device 200 through an API provided by the multi-terminal interaction device 200, wherein the message request to be processed refers to the message to be processed and the APP terminal receiving the message to be processed; after receiving the message to be processed request, the multi-end interaction device 200 determines whether the corresponding message to be processed indicates the name of a service module, such as the service module 1, the service module 2, etc., in the APP end, which processes the message to be processed, and whether the message to be processed indicates a method for calling the service module in the APP end and a parameter that needs to be introduced by the method; under the condition that the messages to be processed indicate the information, the messages to be processed are sent to the APP end, so that the APP end calls a corresponding service module to process the messages to be processed according to the indication method and the parameters of the messages to be processed; and under the condition that the message to be processed does not indicate all the information, deleting the message to be processed, and simultaneously prompting the abnormality of the message to be processed to the read Native end and the APP end.
On this basis, under the condition that the React Native terminal needs to send a message to be processed to the APP terminal and needs to receive data returned by the APP terminal according to the message to be processed (such as a network request), the React Native terminal sends a message request to be processed to the multi-terminal interaction device 200 through the API provided by the multi-terminal interaction device 200, wherein the message request to be processed refers to the message to be processed and the APP terminal receiving the message to be processed; after receiving the message to be processed request, the multi-end interaction device 200 determines whether the corresponding message to be processed indicates the name of a service module, such as the service module 1 and the service module 2, in the APP end, which processes the message to be processed, and whether the message to be processed indicates a method for calling the service module in the APP end and parameters which need to be transmitted by the method, and also determines whether the message to be processed indicates a method for calling the read Native end and parameters which need to be transmitted by the method when the APP end transmits data corresponding to the message to be processed to the read Native end; under the condition that the messages to be processed indicate the information, the messages to be processed are sent to the APP end, so that the APP end calls a corresponding service module to process the messages to be processed according to the indication method and the parameters of the messages to be processed, and calls a corresponding returning method to return data corresponding to the messages to be processed to the fact Native end after the processing is finished; and under the condition that the message to be processed does not indicate all the information, deleting the message to be processed, and simultaneously prompting the abnormality of the message to be processed to the read Native end and the APP end.
Fig. 4 shows an exemplary system architecture 400 to which the multi-terminal interaction method or multi-terminal interaction device of an embodiment of the invention may be applied.
As shown in fig. 4, the system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405. The network 404 serves as a medium for providing communication links between the terminal devices 401, 402, 403 and the server 405. Network 404 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 401, 402, 403 to interact with a server 405 over a network 404 to receive or send messages or the like. The terminal devices 401, 402, 403 may have various communication client applications installed thereon, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, and the like.
The terminal devices 401, 402, 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 405 may be a server that provides various services, such as a background management server that supports shopping websites browsed by users using the terminal devices 401, 402, and 403. The background management server can analyze and process the received data such as the product information inquiry request and feed back the processing result to the terminal equipment.
It should be noted that the multi-port interaction method provided by the embodiment of the present invention is generally executed by the server 405, and accordingly, the multi-port interaction apparatus is generally disposed in the server 405.
It should be understood that the number of terminal devices, networks, and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 5, shown is a block diagram of a computer system 500 suitable for use with a terminal device implementing an embodiment of the present invention. The terminal device shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may be provided in a processor, and may be described as: a processor comprises a message processing request receiving module, a to-be-processed message verifying module and a to-be-processed message sending module. The names of these modules do not form a limitation on the module itself in some cases, for example, the pending message verification module may also be described as a "module for determining whether the pending message conforms to a preset rule".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: receiving a message processing request sent by a first end, wherein the message processing request indicates a message to be processed and a second end for receiving the message to be processed; judging whether the message to be processed meets a preset rule or not; and under the condition that the message to be processed accords with the preset rule, sending the message to be processed to the second end.
According to the technical scheme of the embodiment of the invention, a unified multi-terminal interaction device is provided, so that the communication interaction between the application terminal and the application development terminal is realized, the operation is simple, and a large amount of redundant communication module codes which need to be registered and compiled due to different service modules are avoided; meanwhile, the to-be-processed message of the communication interaction can be verified and processed, the legality of the to-be-processed message of the communication interaction is guaranteed, some abnormal conditions are avoided, and the safety and the reliability of the communication interaction are improved.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (18)

1. A multi-end interaction method, comprising:
receiving a message processing request sent by a first end, wherein the message processing request indicates a message to be processed and a second end for receiving the message to be processed;
judging whether the message to be processed meets a preset rule or not;
and under the condition that the message to be processed accords with the preset rule, sending the message to be processed to the second end.
2. The multi-end interaction method according to claim 1,
the first end is an application end, and the second end is an application development end;
or the first end is an application development end, and the second end is an application end.
3. The multi-end interactive method according to claim 2, further comprising:
under the condition that the message to be processed does not accord with the preset rule, performing one or more of the following processes on the message to be processed: and deleting the message to be processed and sending the exception prompt of the message to be processed to the second end.
4. The multi-end interaction method according to claim 3,
the first end and the second end are configured with one or more corresponding service modules, and the service modules are used for processing the received message to be processed.
5. The multi-end interaction method according to claim 4,
the preset rules include one or more of the following: the size of the message to be processed, whether the message to be processed indicates the corresponding service module, whether the message to be processed indicates a method for calling the service module, and whether the message to be processed indicates the parameter of the method.
6. The multi-end interaction method according to claim 5,
when the first end is an application development end and the second end is an application end, the preset rule further includes: and whether the message to be processed indicates that the application terminal calls back the method of the application development terminal according to the message to be processed.
7. The multi-end interaction method according to claim 6,
and under the condition that the first end is an application development end and the second end is an application end, the application end dynamically calls the service module to process the message to be processed according to the received message to be processed.
8. The multi-end interaction method according to claim 2,
the application terminal is an APP terminal, and the application development terminal is a React Native terminal.
9. A multi-terminal interaction device, comprising: the system comprises a message processing request receiving module, a to-be-processed message verifying module and a to-be-processed message sending module; wherein the content of the first and second substances,
the message processing request receiving module is used for receiving a message processing request sent by a first end, wherein the message processing request indicates a message to be processed and a second end for receiving the message to be processed;
the to-be-processed message verification module is used for judging whether the to-be-processed message meets a preset rule or not;
and the message to be processed sending module is used for sending the message to be processed to the second end under the condition that the message to be processed accords with a preset rule.
10. The multi-end interaction device of claim 9,
the first end is an application end, and the second end is an application development end;
or the first end is an application development end, and the second end is an application end.
11. The multi-end interaction device of claim 10, wherein the pending message sending module is further configured to,
under the condition that the message to be processed does not accord with the preset rule, performing one or more of the following processes on the message to be processed: and deleting the message to be processed and sending the exception prompt of the message to be processed to the second end.
12. The multi-end interaction device of claim 11,
the first end and the second end are configured with one or more corresponding service modules, and the service modules are used for processing the received message to be processed.
13. The multi-end interaction device of claim 12,
the preset rules include one or more of the following: the size of the message to be processed, whether the message to be processed indicates the corresponding service module, whether the message to be processed indicates a method for calling the service module, and whether the message to be processed indicates the parameter of the method.
14. The multi-end interaction device of claim 13,
when the first end is an application development end and the second end is an application end, the preset rule further includes: and whether the message to be processed indicates that the application terminal calls back the method of the application development terminal according to the message to be processed.
15. The multi-end interaction device of claim 14,
and under the condition that the first end is an application development end and the second end is an application end, the application end dynamically calls the service module to process the message to be processed according to the received message to be processed.
16. The multi-end interaction device of claim 10,
the application terminal is an APP terminal, and the application development terminal is a React Native terminal.
17. An electronic device for multi-terminal interaction, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8.
18. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-8.
CN201911301912.1A 2019-12-17 2019-12-17 Multi-terminal interaction method and device Pending CN112988408A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911301912.1A CN112988408A (en) 2019-12-17 2019-12-17 Multi-terminal interaction method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911301912.1A CN112988408A (en) 2019-12-17 2019-12-17 Multi-terminal interaction method and device

Publications (1)

Publication Number Publication Date
CN112988408A true CN112988408A (en) 2021-06-18

Family

ID=76342178

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911301912.1A Pending CN112988408A (en) 2019-12-17 2019-12-17 Multi-terminal interaction method and device

Country Status (1)

Country Link
CN (1) CN112988408A (en)

Similar Documents

Publication Publication Date Title
US8533734B2 (en) Application programming interface for managing time sharing option address space
CN110753020A (en) Network request processing method and device
CN114049122A (en) Service processing method and system
CN113037787A (en) Data processing method and device
CN113438256A (en) Data transmission method, system and proxy server based on double-layer SSL
CN111800223B (en) Method, device and system for generating sending message and processing receiving message
CN113760561A (en) Data processing method and device
CN112948138A (en) Method and device for processing message
CN111030900A (en) Authentication-free login method and device and electronic equipment
CN114979295A (en) Gateway management method and device
CN114417318A (en) Third-party page jumping method and device and electronic equipment
CN113760487B (en) Service processing method and device
CN112988408A (en) Multi-terminal interaction method and device
CN113590243A (en) Energy enterprise project creation method and device, computer equipment and medium
CN112532734A (en) Message sensitive information detection method and device
CN111210349A (en) Virtual asset transfer hosting method and device, electronic equipment and storage medium
CN113766437B (en) Short message sending method and device
CN113452771B (en) Interface calling method, device and system
US8738049B1 (en) Converged dialog in hybrid mobile applications
CN111125676B (en) Joint authorization method and device
CN113821248B (en) Service method of vehicle-end software, vehicle-end software and related equipment thereof
CN110262756B (en) Method and device for caching data
CN109388536B (en) Data collection method and device
CN110011767B (en) Method and apparatus for TCP connection backup
CN112272211A (en) Service request processing method, device and system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination