CN115297162B - Message sending method and device, storage medium and electronic device - Google Patents

Message sending method and device, storage medium and electronic device Download PDF

Info

Publication number
CN115297162B
CN115297162B CN202210737145.4A CN202210737145A CN115297162B CN 115297162 B CN115297162 B CN 115297162B CN 202210737145 A CN202210737145 A CN 202210737145A CN 115297162 B CN115297162 B CN 115297162B
Authority
CN
China
Prior art keywords
message
client
pushed
sender
sending
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210737145.4A
Other languages
Chinese (zh)
Other versions
CN115297162A (en
Inventor
孙云健
邓邱伟
尹德帅
张丽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Haier Technology Co Ltd
Qingdao Haier Intelligent Home Appliance Technology Co Ltd
Haier Smart Home Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Qingdao Haier Intelligent Home Appliance Technology Co Ltd
Haier Smart Home 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 Qingdao Haier Technology Co Ltd, Qingdao Haier Intelligent Home Appliance Technology Co Ltd, Haier Smart Home Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202210737145.4A priority Critical patent/CN115297162B/en
Publication of CN115297162A publication Critical patent/CN115297162A/en
Application granted granted Critical
Publication of CN115297162B publication Critical patent/CN115297162B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Computer And Data Communications (AREA)

Abstract

The application discloses a message sending method and device, a storage medium and an electronic device, and relates to the technical field of smart families, wherein the message sending method comprises the following steps: receiving a message pushing request sent by a cloud server, wherein the message pushing request comprises: the method comprises the steps of waiting for a message to be pushed and receiving identification information of a client of the message to be pushed, wherein the identification information is used for uniquely identifying the client; determining whether an inter-process communication connection exists between a sender and a client corresponding to the identification information; under the condition that the sender and the client are in inter-process communication connection, an application program interface function of the client is called through the inter-process communication, and a message to be pushed included in a push request of the message is sent to the client through the application program interface function.

Description

Message sending method and device, storage medium and electronic device
Technical Field
The present invention relates to the field of communications, and in particular, to a method and apparatus for sending a message, a storage medium, and an electronic device.
Background
Smart home (smart home), colloquially refers to remote control through a specific interaction device. The devices accessed to the home network are generally controlled in various modes such as sound control, a panel, a magic mirror, a television and a mobile phone, and various intelligent scenes derived from the devices need dynamic issuing of messages, so that the data state and the user intention are timely processed and displayed to the user. While the large screen end message pushing and management mainly has several modes:
1) Each app uses a push channel independently, and one large screen end may have a plurality of message push channels;
2) The multi-app shares a push channel and forwards the message in a global static broadcasting mode;
3) The multiple apps share the push channel and establish client and server connections to forward messages using socket means.
The deficiencies of existing implementations in certain situations can manifest themselves in several points:
1. the app uses the message channel independently: a large screen end is provided with a plurality of message issuing channels, so that the problem of resource waste exists;
2. the message forwarding modes such as broadcasting and socket have large resource cost, wherein the global broadcasting has certain privacy security problem;
3. the information distributed through the C and S local information forwarding channels is transmitted through the interfaces of C and S and then data is distributed, if the data is preprocessed, object types need to be serialized and all the object types need to be transmitted in a bundle, the cost of the serialization process is high, the time is slow, and the forwarding process is relatively complicated;
4. the lack of message preprocessing and message interception can not uniformly process and flexibly filter and intercept certain types of messages.
Aiming at the problems of a plurality of message issuing channels, resource waste and the like of the terminal equipment in the related technology, an effective solution is not proposed yet.
Disclosure of Invention
The embodiment of the application provides a message sending method and device, a storage medium and an electronic device, which are used for at least solving the problems that a plurality of message issuing channels exist in terminal equipment, resource waste exists and the like in the related technology.
According to an embodiment of the present application, there is provided a method for sending a message, including: receiving a message pushing request sent by a cloud server, wherein the message pushing request comprises: the method comprises the steps of waiting for a message to be pushed and receiving identification information of a client of the message to be pushed, wherein the identification information is used for uniquely identifying the client; determining whether an inter-process communication connection exists between a sender and a client corresponding to the identification information; and calling an application program interface function of the client through the inter-process communication under the condition that the sender and the client are in inter-process communication connection, and sending a message to be pushed, which is included in a push request of the message, to the client through the application program interface function.
In an exemplary embodiment, sending the message to be pushed to the client through the application program interface function includes: analyzing the message to be pushed to acquire the message attribute of the message to be pushed, wherein the message attribute is used for indicating whether the message to be pushed is normal information or not and the message type of the message to be pushed; determining a pushing strategy of the message to be pushed according to the message attribute; and sending the message to be pushed to the client through the application program interface function according to the pushing strategy.
In an exemplary embodiment, sending the message to be pushed to the client through the application program interface function according to the push policy includes: determining whether the message to be pushed is normal information or not according to the message attribute; under the condition that the message to be pushed is determined to be normal information, determining a pushing template of the message to be pushed according to the message type; and sending the message to be pushed to the client through the application program interface function according to the pushing template.
In one exemplary embodiment, after determining whether an inter-process communication connection exists between the sender and the client, the method further comprises: transmitting broadcast information to the client under the condition that the sender and the client are not connected in an inter-process communication mode, wherein the broadcast information is used for indicating that the sender needs to transmit a message to the client; receiving a connection request sent by the client under the condition that the client checks the broadcast information; and establishing inter-process communication connection between the sender and the client according to the connection request.
In an exemplary embodiment, after establishing an interprocess communication connection between the sender and the client according to the connection request, the method further comprises: receiving a disconnection request sent by the client under the condition that the current state of the client accords with a preset state, wherein the preset state at least comprises one of the following steps: the preset duration of the communication connection between the sender and the process of the client is set; the preset active duration of the client; and disconnecting the inter-process communication connection between the sender and the client according to the disconnection request.
In an exemplary embodiment, receiving a message push request sent by a cloud, includes: initializing push capability of the sender and registering a push listener under the condition that the system of the sender is restarted; transmitting request information for connecting the cloud to the cloud; and under the condition that the cloud responds to the request information and establishes connection between the cloud and the sender, receiving a message pushing request sent by the cloud through the pushing monitor.
In an exemplary embodiment, after the message to be pushed is sent to the client by the application program interface function, the method further includes: receiving feedback information sent by the client, wherein the feedback information is used for indicating whether the client successfully receives the message to be pushed; and sending the message to be pushed to the client again under the condition that the feedback information indicates that the client does not successfully receive the message to be pushed.
According to another embodiment of the embodiments of the present application, there is also provided a device for sending a message, including: the receiving module is used for receiving a message pushing request sent by the cloud server, wherein the message pushing request comprises: the method comprises the steps of waiting for a message to be pushed and receiving identification information of a client of the message to be pushed, wherein the identification information is used for uniquely identifying the client; the determining module is used for determining whether the client corresponding to the identification information exists inter-process communication connection between the sender and the client; and the sending module is used for calling an application program interface function of the client through the inter-process communication and sending a message to be pushed, which is included in a push request of the message, to the client through the application program interface function under the condition that the sender and the client are in inter-process communication connection.
According to yet another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium having stored therein a computer program, wherein the computer program is configured to perform the above-described message transmission method when run.
According to still another aspect of the embodiments of the present application, there is further provided an electronic device including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the method for sending a message described above through the computer program.
In an embodiment of the present application, a message push request sent by a cloud server is received, where the message push request includes: the method comprises the steps of waiting for a message to be pushed and receiving identification information of a client of the message to be pushed, wherein the identification information is used for uniquely identifying the client; determining whether an inter-process communication connection exists between a sender and a client corresponding to the identification information; calling an application program interface function of the client through the inter-process communication under the condition that the sender and the client are in inter-process communication connection, and sending a message to be pushed, which is included in a push request of the message, to the client through the application program interface function; by adopting the technical scheme, the problems that a plurality of message issuing channels exist in the terminal equipment, resource waste exists and the like are solved, and further, the embodiment of the application directly issues the message to the local channel through an inter-process communication IPC cross-process calling interface mode, informs subscribers to process the message, and achieves consistency of issuing and management of the screen-end message.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
Fig. 1 is a schematic diagram of a hardware environment of a method for sending a message according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of sending a message according to an embodiment of the present application;
fig. 3 is a timing diagram of a method of sending a message according to an embodiment of the present application;
fig. 4 is a block diagram (a) of a message transmission apparatus according to an embodiment of the present application;
fig. 5 is a block diagram (a) of a message transmission apparatus according to an embodiment of the present application.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to one aspect of the embodiments of the present application, a method for sending a message is provided. The message sending method is widely applied to full-house intelligent digital control application scenes such as intelligent Home (Smart Home), intelligent Home equipment ecology, intelligent Home (Intelligence House) ecology and the like. Alternatively, in the present embodiment, the above-described message transmission method may be applied to a hardware environment constituted by the terminal device 102 and the server 104 as shown in fig. 1. As shown in fig. 1, the server 104 is connected to the terminal device 102 through a network, and may be used to provide services (such as application services and the like) for a terminal or a client installed on the terminal, a database may be set on the server or independent of the server, for providing data storage services for the server 104, and cloud computing and/or edge computing services may be configured on the server or independent of the server, for providing data computing services for the server 104.
The network may include, but is not limited to, at least one of: wired network, wireless network. The wired network may include, but is not limited to, at least one of: a wide area network, a metropolitan area network, a local area network, and the wireless network may include, but is not limited to, at least one of: WIFI (Wireless Fidelity ), bluetooth. The terminal device 102 may not be limited to a PC, a mobile phone, a tablet computer, an intelligent air conditioner, an intelligent smoke machine, an intelligent refrigerator, an intelligent oven, an intelligent cooking range, an intelligent washing machine, an intelligent water heater, an intelligent washing device, an intelligent dish washer, an intelligent projection device, an intelligent television, an intelligent clothes hanger, an intelligent curtain, an intelligent video, an intelligent socket, an intelligent sound box, an intelligent fresh air device, an intelligent kitchen and toilet device, an intelligent bathroom device, an intelligent sweeping robot, an intelligent window cleaning robot, an intelligent mopping robot, an intelligent air purifying device, an intelligent steam box, an intelligent microwave oven, an intelligent kitchen appliance, an intelligent purifier, an intelligent water dispenser, an intelligent door lock, and the like.
In this embodiment, a method for sending a message is provided and applied to a sender, and fig. 2 is a flowchart of a method for sending a message according to an embodiment of the present application, where the flowchart includes the following steps:
step S202, receiving a message push request sent by a cloud server, where the message push request includes: the method comprises the steps of waiting for a message to be pushed and receiving identification information of a client of the message to be pushed, wherein the identification information is used for uniquely identifying the client;
step S204, determining whether the client corresponding to the identification information exists inter-process communication connection between the sender and the client;
step S206, calling an application program interface function of the client through the inter-process communication and sending a message to be pushed included in a push request of the message to the client through the application program interface function under the condition that the sender and the client are in inter-process communication connection.
Through the steps, a message pushing request sent by a cloud server is received, wherein the message pushing request comprises: the method comprises the steps of waiting for a message to be pushed and receiving identification information of a client of the message to be pushed, wherein the identification information is used for uniquely identifying the client; determining whether an inter-process communication connection exists between a sender and a client corresponding to the identification information; under the condition that the sender and the client are in inter-process communication connection, an application program interface function of the client is called through inter-process communication, and a message to be pushed included in a push request of the message is sent to the client through the application program interface function, so that the problems that in the related art, a plurality of message issuing channels exist in terminal equipment, resource waste exists and the like are solved, and further, the message is directly issued to a local channel through inter-process communication IPC in a cross-process calling interface mode, subscribers are notified to process the message, and consistency of issuing and management of the screen-end message is achieved.
In an exemplary embodiment, sending the message to be pushed to the client through the application program interface function includes: analyzing the message to be pushed to acquire the message attribute of the message to be pushed, wherein the message attribute is used for indicating whether the message to be pushed is normal information or not and the message type of the message to be pushed; determining a pushing strategy of the message to be pushed according to the message attribute; and sending the message to be pushed to the client through the application program interface function according to the pushing strategy.
In this embodiment, in order to perform message preprocessing on a message to be pushed, specifically, a cloud server issues the message to a client, and a message module of a sender parses the message to be pushed into a corresponding message template object, where the message template object is used to indicate that the message is abstracted into an individual and an object; determining message state and attribute; and sending the message to be pushed to a message interceptor for processing. The message interceptor is a processing job before message forwarding for message policies, message reprocessing, etc., where the message policies are flexibly configurable, support local and remote configuration policies,
in an exemplary embodiment, sending the message to be pushed to the client through the application program interface function according to the push policy includes: determining whether the message to be pushed is normal information or not according to the message attribute; under the condition that the message to be pushed is determined to be normal information, determining a pushing template of the message to be pushed according to the message type; and sending the message to be pushed to the client through the application program interface function according to the pushing template.
That is, in the case that the message to be pushed is a normal message, determining a pushing strategy with the message to be pushed according to the message type, determining a corresponding pushing template according to the pushing strategy, and sending the message to be pushed to the client through the application program interface function according to the pushing template.
For example, for a simple prompting message that does not require user confirmation but is to be reminded, interception can be performed here, and the user is prompted by a direct popup; the client may also configure different interceptor policies. And after the message processing is finished, the message is released to a local message channel.
In an exemplary embodiment, after determining whether the sender and the client have an inter-process communication connection, the method further includes: transmitting broadcast information to the client under the condition that the sender and the client are not connected in an inter-process communication mode, wherein the broadcast information is used for indicating that the sender needs to transmit a message to the client; receiving a connection request sent by the client under the condition that the client checks the broadcast information; and establishing inter-process communication connection between the sender and the client according to the connection request.
When the sender message module prepares to send the message to be pushed to the client, the sender message module firstly judges the active state of the client, and the client determines whether to keep connection with the sender, if the verification fails, the client needs to be pulled to be active. The specific implementation can be that the message is sent to the client by a static broadcast mode with the weight verification, and the client is started to execute the initialization of the SDK and send the message to the client.
In an exemplary embodiment, after establishing an interprocess communication connection between the sender and the client according to the connection request, the method further includes: receiving a disconnection request sent by the client under the condition that the current state of the client accords with a preset state, wherein the preset state at least comprises one of the following steps: the preset duration of the communication connection between the sender and the process of the client is set; the preset active duration of the client; and disconnecting the inter-process communication connection between the sender and the client according to the disconnection request.
Optionally, receiving a disconnection request sent by the client under the condition that a preset time length of an inter-process communication connection between the sender and the client is longer than a first time length; and disconnecting the interprocess communication connection between the sender and the client according to the disconnection request.
Optionally, receiving a disconnection request sent by the client under the condition that the preset active time length of the client is longer than the second time length; and disconnecting the interprocess communication connection between the sender and the client according to the disconnection request.
In an exemplary embodiment, receiving a message push request sent by a cloud, includes: initializing push capability of the sender and registering a push listener under the condition that the system of the sender is restarted; transmitting request information for connecting the cloud to the cloud; and under the condition that the cloud responds to the request information and establishes connection between the cloud and the sender, receiving a message pushing request sent by the cloud through the pushing monitor.
According to the embodiment of the invention, the cloud message platform is initialized and connected under the condition that the sender is started or under the condition that the sender and the client are not connected in an inter-process communication manner. The sender initiates or registers information changes (such as account switching, etc.), and should initialize the push capability and register the push monitor; and then, a request for registering and connecting a cloud message center is initiated to the cloud, so that a sender of a message service in the client can receive real-time messages of the cloud.
In an exemplary embodiment, after the message to be pushed is sent to the client by the application program interface function, the method further includes: receiving feedback information sent by the client, wherein the feedback information is used for indicating whether the client successfully receives the message to be pushed; and sending the message to be pushed to the client again under the condition that the feedback information indicates that the client does not successfully receive the message to be pushed.
For example, according to feedback information sent by a client, determining whether the message to be pushed needs to be sent again to the client, and specifically, sending the message to be pushed again to the client when the feedback information indicates that the client does not successfully receive the message to be pushed; and under the condition that the feedback information indicates that the client side successfully receives the message to be pushed, the message to be pushed does not need to be sent to the client side again.
Optionally, the confirmation type message needs to return the receiving and processing state of the user to the cloud message center to continue the service flow, or the processing result of the message is used as the count of user scene execution to generate a corresponding service model, so that some strategies or decision systems can be intelligently generated.
In order to better understand the process of the method for sending the message, the following description is provided with reference to an alternative embodiment to describe the flow of the method for sending the message, but is not limited to the technical solution of the embodiment of the present application.
In this embodiment, a method for sending a message is provided, and fig. 3 is a schematic diagram of a method for sending a message according to an embodiment of the present application, as shown in fig. 3, specifically including the following steps:
step 1.1: the main system (corresponding to the sender in the above embodiment) should initialize the push capability when the startup or registration information is changed (such as account switching, etc.);
step 1.2: registering a push listener clientID;
step 1.3: a request for registering and connecting a cloud message center is initiated to the cloud, so that a main system where a message service is located in a subsystem (equivalent to a client in the embodiment) can receive real-time messages of the cloud;
step 1.4: synchronously connecting cloud states;
and establishing IPC connection (inter-process communication connection) between the screen-side main system and the subsystem, wherein the main system can directly issue messages to the subsystem.
Step 2.1: initializing a message SDk when a subsystem is started, wherein the message SDk acts as a bridge for distributing messages and is mainly responsible for connecting a message channel between a main system and the subsystem in a screen end;
step 2.2: registering the app id, sending a request to connect to a remote service to the message SDk;
step 2.3: the message SDk is registered and connected with the main system;
step 2.4: the main system establishes IPC connection;
step 2.5: the main system returns a connection state to the message SDk;
step 2.6: the message SDk returns a connection status to the subsystem.
Implemented using IPC mechanisms. The main purpose is to realize the capability of directly calling the api interface functions of other systems across processes and simplify the message forwarding process. The specific service processing department that can directly forward according to the message type does not need to forward through the connecting channel of server and client each time like socket communication, then carries out secondary distribution of message event, and the message can be analyzed to the process of encapsulating Bundle by the panel, thus being an upgrade to the c/s message forwarding architecture. At the same time, this mode is also easily compatible with c/s message flow capability.
Step 3.1: the subsystem sends request information of registering equipment and user information to the cloud to the message SDk;
step 3.2: the message SDk sends request information of registering equipment and user information to the cloud to the main system;
step 3.3: the main system sends the request information of the registration equipment and the user information to the cloud to a cloud message center (which is equivalent to the cloud server in the embodiment);
step 3.4: the cloud message center returns a registration result;
step 3.5: the main system returns a registration result;
step 3.6: the message SDk returns a registration result;
step 3.7: the subsystem sends a message subscription to the host system.
The registration equipment and the user information wait until the message center, when the data of the message center changes, the data is matched with the corresponding user equipment according to the registration information, and the message is issued to the user side through the message channel and the registered monitor.
Step 4.1: the cloud message transmits the message to a main system;
step 4.2: the message module of the main system can analyze the message into a corresponding message template object;
step 4.3: sending the message template object to a message interceptor;
step 4.4: a message is published.
Step 5.1: determining whether the subsystem is connected with the main system;
step 5.2: pulling the active subsystem under the condition that the subsystem is not connected with the main system;
step 5.3: reestablishing the IPC connection;
step 5.4: distributing the message;
step 5.5: the subsystem establishes IPC connection with the main system;
step 5.6: and distributing the message.
Step 6.1: the subsystem reports the message state to the main system;
step 6.2: and the main system reports the message state to the cloud message center.
Step 7.1: the subsystem is disconnected from the main system IPC.
The embodiment of the application is a message service engine for large-screen message pushing channel aggregation, message flow in a screen end and message management consistency, and is called a main system for short, and the main system is responsible for issuing received cloud messages and forwarding the messages to other message receiving ends. Other message receiving terminals are called subsystems for short. After receiving the message issued by the cloud, the service engine analyzes and converts the message into a matched message object according to the type of the message body, and then the message is directly distributed to a subsystem after being preprocessed by a strategy of a message interceptor, wherein the subsystem comprises message receiving ends such as message subscription in the same process, message subscription in different processes in the same app, service or application of different processes of different apps and the like. And after receiving the message event issued by the message channel of the local machine, the subsystem executes specific service processing.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk), comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the embodiments of the present application.
Fig. 4 is a block diagram of a message transmission apparatus according to an embodiment of the present application; as shown in fig. 4, includes:
the receiving module 42 is configured to receive a message push request sent by the cloud server, where the message push request includes: the method comprises the steps of waiting for a message to be pushed and receiving identification information of a client of the message to be pushed, wherein the identification information is used for uniquely identifying the client;
a determining module 44, configured to determine whether an inter-process communication connection exists between the sender and the client corresponding to the identification information;
and the sending module 46 is configured to call an application program interface function of the client through the inter-process communication and send a message to be pushed included in a push request of the message to the client through the application program interface function when the sender and the client have an inter-process communication connection.
Through the device, a message pushing request sent by the cloud server is received, wherein the message pushing request comprises: the method comprises the steps of waiting for a message to be pushed and receiving identification information of a client of the message to be pushed, wherein the identification information is used for uniquely identifying the client; determining whether an inter-process communication connection exists between a sender and a client corresponding to the identification information; under the condition that the sender and the client are in inter-process communication connection, an application program interface function of the client is called through inter-process communication, and a message to be pushed included in a push request of the message is sent to the client through the application program interface function, so that the problems that in the related art, a plurality of message issuing channels exist in terminal equipment, resource waste exists and the like are solved, and further, the message is directly issued to a local channel through inter-process communication IPC in a cross-process calling interface mode, subscribers are notified to process the message, and consistency of issuing and management of the screen-end message is achieved.
In an exemplary embodiment, fig. 5 is a block diagram of a message sending apparatus according to an embodiment of the present application; as shown in fig. 5, the apparatus further includes: the parsing module 52 is configured to parse the message to be pushed to obtain a message attribute of the message to be pushed, where the message attribute is used to indicate whether the message to be pushed is normal information, and a message type of the message to be pushed; the sending module is further used for determining a pushing strategy of the message to be pushed according to the message attribute; and sending the message to be pushed to the client through the application program interface function according to the pushing strategy.
In an exemplary embodiment, the sending module is further configured to determine, according to the message attribute, whether the message to be pushed is normal information; under the condition that the message to be pushed is determined to be normal information, determining a pushing template of the message to be pushed according to the message type; and sending the message to be pushed to the client through the application program interface function according to the pushing template.
In an exemplary embodiment, fig. 5 is a block diagram of a message sending apparatus according to an embodiment of the present application; as shown in fig. 5, the apparatus further includes: an establishing module 54, configured to send broadcast information to the client when the sender and the client do not have an interprocess communication connection, where the broadcast information is used to indicate that the sender needs to send a message to the client; receiving a connection request sent by the client under the condition that the client checks the broadcast information; and establishing inter-process communication connection between the sender and the client according to the connection request.
In an exemplary embodiment, fig. 5 is a block diagram of a message sending apparatus according to an embodiment of the present application; as shown in fig. 5, the apparatus further includes: a disconnection module 56, configured to receive a disconnection request sent by the client when the current state of the client accords with a preset state, where the preset state at least includes one of the following: the preset duration of the communication connection between the sender and the process of the client is set; the preset active duration of the client; and disconnecting the inter-process communication connection between the sender and the client according to the disconnection request.
In an exemplary embodiment, the sending module is further configured to initialize a push capability of the sender and register a push listener in a case that a system of the sender is restarted; transmitting request information for connecting the cloud to the cloud; and under the condition that the cloud responds to the request information and establishes connection between the cloud and the sender, receiving a message pushing request sent by the cloud through the pushing monitor.
In an exemplary embodiment, the sending module is further configured to receive feedback information sent by the client, where the feedback information is used to indicate whether the client successfully receives the message to be pushed; and sending the message to be pushed to the client again under the condition that the feedback information indicates that the client does not successfully receive the message to be pushed.
Embodiments of the present application also provide a storage medium including a stored program, wherein the program performs the method of any one of the above when run.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store program code for performing the steps of:
s1, receiving a message pushing request sent by a cloud server, wherein the message pushing request comprises: the method comprises the steps of waiting for a message to be pushed and receiving identification information of a client of the message to be pushed, wherein the identification information is used for uniquely identifying the client;
s2, determining whether an inter-process communication connection exists between the sender and the client corresponding to the identification information;
s3, calling an application program interface function of the client through the inter-process communication under the condition that the sender and the client are in inter-process communication connection, and sending a message to be pushed, which is included in a push request of the message, to the client through the application program interface function.
Embodiments of the present application also provide an electronic device comprising a memory having a computer program stored therein and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, receiving a message pushing request sent by a cloud server, wherein the message pushing request comprises: the method comprises the steps of waiting for a message to be pushed and receiving identification information of a client of the message to be pushed, wherein the identification information is used for uniquely identifying the client;
s2, determining whether an inter-process communication connection exists between the sender and the client corresponding to the identification information;
s3, calling an application program interface function of the client through the inter-process communication under the condition that the sender and the client are in inter-process communication connection, and sending a message to be pushed, which is included in a push request of the message, to the client through the application program interface function.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the application described above may be implemented in a general purpose computing device, they may be centralized on a single computing device, or distributed across a network of computing devices, or they may alternatively be implemented in program code executable by computing devices, such that they may be stored in a memory device for execution by the computing devices and, in some cases, the steps shown or described may be performed in a different order than what is shown or described, or they may be implemented as individual integrated circuit modules, or as individual integrated circuit modules. Thus, the present application is not limited to any specific combination of hardware and software.
The foregoing is merely a preferred embodiment of the present application and it should be noted that modifications and adaptations to those skilled in the art may be made without departing from the principles of the present application and are intended to be comprehended within the scope of the present application.

Claims (9)

1. A method for transmitting a message, comprising:
receiving a message pushing request sent by a cloud server, wherein the message pushing request comprises: the method comprises the steps of waiting for a message to be pushed and receiving identification information of a client of the message to be pushed, wherein the identification information is used for uniquely identifying the client;
determining whether an inter-process communication connection exists between a sender and a client corresponding to the identification information;
calling an application program interface function of the client through the inter-process communication under the condition that the sender and the client are in inter-process communication connection, and sending a message to be pushed, which is included in a push request of the message, to the client through the application program interface function;
wherein sending the message to be pushed to the client through the application program interface function comprises:
analyzing the message to be pushed to acquire the message attribute of the message to be pushed, wherein the message attribute is used for indicating whether the message to be pushed is normal information or not and the message type of the message to be pushed;
determining a pushing strategy of the message to be pushed according to the message attribute;
and sending the message to be pushed to the client through the application program interface function according to the pushing strategy.
2. The method for sending a message according to claim 1, wherein sending the message to be pushed to the client through the application program interface function according to the push policy comprises:
determining whether the message to be pushed is normal information or not according to the message attribute;
under the condition that the message to be pushed is determined to be normal information, determining a pushing template of the message to be pushed according to the message type;
and sending the message to be pushed to the client through the application program interface function according to the pushing template.
3. The method for sending a message according to claim 1, wherein receiving a message push request sent by a cloud terminal includes:
initializing push capability of the sender and registering a push listener under the condition that the system of the sender is restarted;
transmitting request information for connecting the cloud to the cloud;
and under the condition that the cloud responds to the request information and establishes connection between the cloud and the sender, receiving a message pushing request sent by the cloud through the pushing monitor.
4. The method of sending a message according to claim 1, wherein after determining whether an inter-process communication connection exists between a sender and the client, the method further comprises:
transmitting broadcast information to the client under the condition that the sender and the client are not connected in an inter-process communication mode, wherein the broadcast information is used for indicating that the sender needs to transmit a message to the client;
receiving a connection request sent by the client under the condition that the client checks the broadcast information;
and establishing inter-process communication connection between the sender and the client according to the connection request.
5. The method according to claim 4, wherein after establishing an inter-process communication connection between the sender and the client according to the connection request, the method further comprises:
receiving a disconnection request sent by the client under the condition that the current state of the client accords with a preset state, wherein the preset state at least comprises one of the following steps: the preset time length of the communication connection between the sender and the process of the client is longer than a first time length; the preset active time length of the client is longer than the second time length;
and disconnecting the inter-process communication connection between the sender and the client according to the disconnection request.
6. The method for sending a message according to claim 1, wherein after the message to be pushed is sent to the client by the application program interface function, the method further comprises:
receiving feedback information sent by the client, wherein the feedback information is used for indicating whether the client successfully receives the message to be pushed;
and sending the message to be pushed to the client again under the condition that the feedback information indicates that the client does not successfully receive the message to be pushed.
7. A message transmitting apparatus, comprising:
the receiving module is used for receiving a message pushing request sent by the cloud server, wherein the message pushing request comprises: the method comprises the steps of waiting for a message to be pushed and receiving identification information of a client of the message to be pushed, wherein the identification information is used for uniquely identifying the client;
the determining module is used for determining whether the client corresponding to the identification information exists inter-process communication connection between the sender and the client;
the sending module is used for calling an application program interface function of the client through the inter-process communication and sending a message to be pushed, which is included in a push request of the message, to the client through the application program interface function under the condition that the sender and the client are in inter-process communication connection;
wherein the apparatus further comprises: the analysis module is used for analyzing the message to be pushed to acquire the message attribute of the message to be pushed, wherein the message attribute is used for indicating whether the message to be pushed is normal information or not and the message type of the message to be pushed; the sending module is further used for determining a pushing strategy of the message to be pushed according to the message attribute; and sending the message to be pushed to the client through the application program interface function according to the pushing strategy.
8. A computer readable storage medium, characterized in that the computer readable storage medium comprises a stored program, wherein the program when run performs the method of any of the preceding claims 1 to 6.
9. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of the claims 1 to 6 by means of the computer program.
CN202210737145.4A 2022-06-27 2022-06-27 Message sending method and device, storage medium and electronic device Active CN115297162B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210737145.4A CN115297162B (en) 2022-06-27 2022-06-27 Message sending method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210737145.4A CN115297162B (en) 2022-06-27 2022-06-27 Message sending method and device, storage medium and electronic device

Publications (2)

Publication Number Publication Date
CN115297162A CN115297162A (en) 2022-11-04
CN115297162B true CN115297162B (en) 2024-03-22

Family

ID=83821000

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210737145.4A Active CN115297162B (en) 2022-06-27 2022-06-27 Message sending method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN115297162B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115914367B (en) * 2023-02-17 2023-05-30 福建联迪商用科技有限公司 Message pushing method and system of intelligent device

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101572710A (en) * 2009-06-03 2009-11-04 杭州华三通信技术有限公司 Interprocess communication method and system
CN102404632A (en) * 2011-12-08 2012-04-04 四川长虹电器股份有限公司 Information pushing method of intelligent television and application thereof
CN103685528A (en) * 2013-12-18 2014-03-26 北京奇虎科技有限公司 Information displaying method and device
WO2015055073A1 (en) * 2013-10-18 2015-04-23 北京奇虎科技有限公司 Method, apparatus and system for reminding message
CN106686056A (en) * 2016-11-25 2017-05-17 济南中维世纪科技有限公司 Android client communication device and method allowing Android client communication device to connect and communicate with server
CN107341052A (en) * 2017-06-07 2017-11-10 努比亚技术有限公司 A kind of message treatment method and device
CN107800585A (en) * 2016-09-07 2018-03-13 腾讯科技(深圳)有限公司 The method and apparatus of network service, the method and apparatus of PUSH message
CN111970315A (en) * 2019-05-20 2020-11-20 北京车和家信息技术有限公司 Method, device and system for pushing message
CN112650606A (en) * 2020-12-30 2021-04-13 北京奇艺世纪科技有限公司 Message processing method, device and system, electronic equipment and storage medium
CN112866391A (en) * 2021-01-21 2021-05-28 北京百度网讯科技有限公司 Message pushing method and device, electronic equipment and storage medium
CN113890895A (en) * 2021-08-27 2022-01-04 青岛海尔科技有限公司 Message pushing method and device, storage medium and electronic device
WO2022088804A1 (en) * 2020-10-30 2022-05-05 深圳壹账通智能科技有限公司 Message pushing method and apparatus, and electronic device, and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8595345B2 (en) * 2011-05-26 2013-11-26 Mfluent Llc Enhanced push notification services

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101572710A (en) * 2009-06-03 2009-11-04 杭州华三通信技术有限公司 Interprocess communication method and system
CN102404632A (en) * 2011-12-08 2012-04-04 四川长虹电器股份有限公司 Information pushing method of intelligent television and application thereof
WO2015055073A1 (en) * 2013-10-18 2015-04-23 北京奇虎科技有限公司 Method, apparatus and system for reminding message
CN103685528A (en) * 2013-12-18 2014-03-26 北京奇虎科技有限公司 Information displaying method and device
CN107800585A (en) * 2016-09-07 2018-03-13 腾讯科技(深圳)有限公司 The method and apparatus of network service, the method and apparatus of PUSH message
CN106686056A (en) * 2016-11-25 2017-05-17 济南中维世纪科技有限公司 Android client communication device and method allowing Android client communication device to connect and communicate with server
CN107341052A (en) * 2017-06-07 2017-11-10 努比亚技术有限公司 A kind of message treatment method and device
CN111970315A (en) * 2019-05-20 2020-11-20 北京车和家信息技术有限公司 Method, device and system for pushing message
WO2022088804A1 (en) * 2020-10-30 2022-05-05 深圳壹账通智能科技有限公司 Message pushing method and apparatus, and electronic device, and storage medium
CN112650606A (en) * 2020-12-30 2021-04-13 北京奇艺世纪科技有限公司 Message processing method, device and system, electronic equipment and storage medium
CN112866391A (en) * 2021-01-21 2021-05-28 北京百度网讯科技有限公司 Message pushing method and device, electronic equipment and storage medium
CN113890895A (en) * 2021-08-27 2022-01-04 青岛海尔科技有限公司 Message pushing method and device, storage medium and electronic device

Also Published As

Publication number Publication date
CN115297162A (en) 2022-11-04

Similar Documents

Publication Publication Date Title
CN107231606B (en) WiFi network access method, intelligent hardware equipment and electronic terminal
CN110971495B (en) Equipment binding method and device of intelligent household system and storage medium
CN109347934B (en) Message pushing method and system, server, storage medium and electronic device
CN110633442A (en) Pushing method and device and electronic equipment
CN115297162B (en) Message sending method and device, storage medium and electronic device
CN112671904B (en) Method and device for transmitting equipment state information, storage medium and electronic device
CN111327662A (en) Communication method and management device for heterogeneous Internet of things platform
US8019855B2 (en) Method and apparatus interfacing between an application and a library of a master for network managing
CN103401896A (en) Multi-Android-client service sharing method and system
CN104750544A (en) Process management system and process management method applied to distributed system
CN112448987B (en) Fuse degradation triggering method, system and storage medium
CN111124717A (en) Message delivery method, system and computer storage medium
CN109962967A (en) The method of data synchronization subscribed to based on increment
CN101436953A (en) Management method and processing module for on-line announcement message of network appliance
CN110572271B (en) Method and system for managing voice chat room
CN111030925B (en) Multi-gateway communication method and system based on remote procedure call
CN112653769A (en) Message pushing method and system
CN115314549B (en) Offline equipment management method, storage medium and electronic device
CN115296948B (en) Scene information updating method and device, storage medium and electronic device
CN115174643B (en) Control method and device of terminal equipment, storage medium and electronic device
CN114157725B (en) Method, device, server, electronic equipment and storage medium for equipment linkage
CN114760348B (en) Service processing method and device, storage medium and electronic device
CN115174296B (en) Equipment function access method and device, storage medium and electronic device
CN116436991A (en) Data message sending method and device, storage medium and electronic equipment
CN116527738A (en) Service information processing method and device, storage medium and electronic device

Legal Events

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