CN115297162A - 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
CN115297162A
CN115297162A CN202210737145.4A CN202210737145A CN115297162A CN 115297162 A CN115297162 A CN 115297162A CN 202210737145 A CN202210737145 A CN 202210737145A CN 115297162 A CN115297162 A CN 115297162A
Authority
CN
China
Prior art keywords
message
client
pushed
sending
pushing
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.)
Granted
Application number
CN202210737145.4A
Other languages
Chinese (zh)
Other versions
CN115297162B (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

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer And Data Communications (AREA)
  • Information Transfer Between Computers (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 homes, 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 pushing 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 the sending party and the client corresponding to the identification information have interprocess communication connection; under the condition that the sending party and the client have interprocess communication connection, an application program interface function of the client is called through the interprocess communication, and the message to be pushed in the message pushing request 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 application relates to the field of communications, and in particular, to a message sending method and apparatus, a storage medium, and an electronic apparatus.
Background
Smart home (smart home), colloquially, refers to remote control through a specific interactive device. Generally, devices accessed to a home network are controlled in various modes such as a voice control mode, a panel mode, a magic mirror mode, a television mode, a mobile phone mode and the like, so that various derived intelligent scenes need to be dynamically issued with messages, and timely processing and displaying of data states and user intentions to users are guaranteed. There are several main ways for pushing and managing large-screen messages:
1) Each app independently uses a push channel, and one large screen end can have a plurality of message push channels;
2) The multiple apps share a push channel, and forward the message in a global static broadcast mode;
3) The multi-app shares a push channel, and establishes a client and server connection in a socket manner to forward the message.
The deficiencies of existing implementations in certain situations can manifest themselves as several points:
1. apps use the message channel independently: a large screen end has a plurality of message issuing channels, so that the problem of resource waste exists;
2. the resource cost is high due to the message forwarding modes such as broadcasting and socket, and the global broadcasting has certain privacy safety problems;
3. for the message distributed through the C and S local message forwarding channels, the message transmission must pass through the C and S interfaces and then distribute data, if the data is preprocessed, object types need to be serialized and must be put into a bundle for transmission, the serialization process is high in cost and slow in time, and the forwarding process is relatively complex;
4. the method is lack of message preprocessing and message interception, and can not uniformly process and flexibly filter and intercept certain types of messages.
Aiming at the problems of resource waste and the like caused by a plurality of message issuing channels of terminal equipment in the related technology, an effective solution is not provided.
Disclosure of Invention
The embodiment of the application provides a message sending method and device, a storage medium and an electronic device, and aims to at least solve the problems that in the related art, a plurality of message sending channels exist in terminal equipment, and resources are wasted.
According to an embodiment of the present application, a method for sending a message is provided, including: receiving a message pushing request sent by a cloud server, wherein the message pushing request comprises: the method comprises the steps of pushing 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 the sending party and the client corresponding to the identification information have interprocess communication connection; and under the condition that the sending party and the client have interprocess communication connection, calling an application program interface function of the client through the interprocess communication, and sending the message to be pushed included in the message pushing request 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 a 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 indicating 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 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 an exemplary embodiment, after determining whether an interprocess communication connection exists between the sender and the client, the method further comprises: under the condition that the communication connection between the sender and the client does not exist, sending broadcast information to the client, wherein the broadcast information is used for indicating 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 the interprocess communication connection between the sender and the client according to the connection request.
In an exemplary embodiment, after establishing the 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 states: the preset duration of the interprocess communication connection between the sender and the client; presetting an active time length of the client; 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 the push capability of the sender and registering a push listener under the condition that the system of the sender is restarted; sending request information for connecting a cloud end to the cloud end; and under the condition that the cloud end responds to the request information and establishes the connection between the cloud end and the sender, receiving a message pushing request sent by the cloud end through the pushing monitor.
In an exemplary embodiment, after the message to be pushed is sent to the client through 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 under the condition that the feedback information indicates that the client side does not successfully receive the message to be pushed, sending the message to be pushed to the client side again.
According to another embodiment of the present application, there is also provided a message sending apparatus, including: the receiving module is used for receiving a message pushing request sent by a cloud server, wherein the message pushing request comprises: the method comprises the steps of pushing 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 and the sender have interprocess communication connection; and the sending module is used for calling an application program interface function of the client through the interprocess communication under the condition that the sending party and the client have interprocess communication connection, and sending the message to be pushed included in the message pushing request to the client through the application program interface function.
According to still another aspect of the embodiments of the present application, there is also provided a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned message sending method when running.
According to another aspect of the embodiments of the present application, there is also provided an electronic apparatus, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the message sending method through the computer program.
In an embodiment of the present application, a message pushing request sent by a cloud server is received, where the message pushing request includes: the method comprises the steps of pushing 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 the sending party and the client corresponding to the identification information have interprocess communication connection; under the condition that the sending party and the client have interprocess communication connection, calling an application program interface function of the client through the interprocess communication, and sending a message to be pushed included in a pushing 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, further, the embodiment of the application directly issues the message to the local channel in a cross-process calling interface mode through inter-process communication IPC, informs a subscriber of processing the message, and realizes consistency of screen-end message issuing and management.
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 used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive labor.
Fig. 1 is a schematic diagram of a hardware environment of a message sending method according to an embodiment of the present application;
fig. 2 is a flowchart of a method of transmitting a message according to an embodiment of the present application;
fig. 3 is a timing diagram of a method of transmitting a message according to an embodiment of the present application;
fig. 4 is a block diagram (one) of a message sending apparatus according to an embodiment of the present application;
fig. 5 is a block diagram (a) of a message sending apparatus according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or 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 embodiment of the application, a message sending method is provided. The message sending method is widely applied to full-House intelligent digital control application scenes such as intelligent homes (Smart Home), intelligent homes, intelligent Home equipment ecology, intelligent Home (Intelligent House) ecology and the like. Alternatively, in this embodiment, the message sending method may be applied to a hardware environment formed 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 configured to provide a service (e.g., an application service) for the terminal or a client installed on the terminal, set a database on the server or independent of the server, and provide a data storage service for the server 104, and configure a cloud computing and/or edge computing service on the server or independent of the server, and provide a data operation service for the server 104.
The network may include, but is not limited to, at least one of: wired networks, wireless networks. The wired network may include, but is not limited to, at least one of: wide area networks, metropolitan area networks, local area networks, which may include, but are not limited to, at least one of the following: WIFI (Wireless Fidelity), bluetooth. Terminal equipment 102 can be but not limited to be PC, the cell-phone, the panel computer, intelligent air conditioner, intelligent cigarette machine, intelligent refrigerator, intelligent oven, intelligent kitchen range, intelligent washing machine, intelligent water heater, intelligent washing equipment, intelligent dish washer, intelligent projection equipment, intelligent TV, intelligent clothes hanger, intelligent (window) curtain, intelligence audio-visual, smart jack, intelligent stereo set, intelligent audio amplifier, intelligent new trend equipment, intelligent kitchen guarding equipment, intelligent bathroom equipment, intelligence robot of sweeping the floor, intelligence robot of wiping the window, intelligence robot of mopping the ground, intelligent air purification equipment, intelligent steam ager, intelligent microwave oven, intelligent kitchen is precious, intelligent clarifier, intelligent water dispenser, intelligent lock etc..
In this embodiment, a message sending method is provided and applied to a sender, and fig. 2 is a flowchart of a message sending method according to an embodiment of the present application, where the flowchart includes the following steps:
step S202, receiving a message pushing request sent by a cloud server, where the message pushing request includes: the method comprises the steps of pushing 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 communication connection between the processes exists between the sender and the client corresponding to the identification information;
step S206, under the condition that the sending party and the client have the interprocess communication connection, calling an application program interface function of the client through the interprocess communication, and sending the message to be pushed included in the message pushing request to the client through the application program interface function.
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 pushing 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 the sending party and the client corresponding to the identification information have interprocess communication connection; under the condition that the sending party and the client are in interprocess communication connection, an application program interface function of the client is called through the interprocess communication, and a message to be pushed in a message pushing request is sent to the client through the application program interface function, so that the problems that in the related technology, a plurality of message issuing channels exist in terminal equipment, resource waste exists and the like are solved, further, the application embodiment directly issues the message to a local channel through an interprocess communication IPC (inter process communication) interprocess calling interface mode, informs a subscriber to process the message, and the consistency of screen-side message issuing and management is realized.
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 a 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 indicating 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, 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 instruct to abstract the message into an individual and an object; determining the state and the attribute of the message; and sending the message to be pushed to a message interceptor for processing. The message interceptor is used for processing work before message forwarding, such as message strategy, message reprocessing and the like, wherein the message strategy can be flexibly configured and supports local and remote configuration strategies,
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 to say, under the condition that the message to be pushed is a normal message, determining a pushing strategy with the pushed message 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 simple suggestive messages which do not need to be confirmed by the user but need to be reminded, the simple suggestive messages can be intercepted here, and the user is prompted by directly popping up a window; the client may also be configured with different interceptor policies. And after the message processing is finished, the message is issued to the local message channel.
In an exemplary embodiment, after determining whether there is an interprocess communication connection between the sender and the client, the method further includes: under the condition that the communication connection between the sender and the client does not exist, sending broadcast information to the client, wherein the broadcast information is used for indicating 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 interprocess communication connection between the sender and the client according to the connection request.
When the message module of the sending party prepares to send the message to be pushed to the client, the message module of the sending party judges the active state of the client at first, and the client determines whether to keep connection with the sending party, if the check fails, the client needs to be pulled alive. The specific implementation can be that the message is sent to the client side in a static broadcast mode with the permission check oriented, the client side executes the initialization of the SDK after being pulled alive, and the message is sent to the client side.
In an exemplary embodiment, after establishing the 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 states: the preset duration of the interprocess communication connection between the sender and the client; presetting an active time length of the client; 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 a preset duration of the interprocess communication connection between the sender and the client is greater than a first duration; 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 when the preset active duration of the client is greater than a second duration; 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 the push capability of the sender and registering a push listener under the condition that the system of the sender is restarted; sending request information for connecting a cloud end to the cloud end; and under the condition that the cloud responds to the request information and establishes the 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, a cloud message platform is initialized and connected under the condition that a sender is started or under the condition that the communication connection between processes does not exist between the sender and the client. When a sender starts or registration information changes (such as account number switching and the like), initialization of push capacity and registration of a push monitor are required; and then, a request for registering and connecting a cloud message center is sent to the cloud end, so that a sender of the message service in the client end can receive the real-time message of the cloud end.
In an exemplary embodiment, after sending the message to be pushed to the client through 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 under the condition that the feedback information indicates that the client side does not successfully receive the message to be pushed, sending the message to be pushed to the client side again.
For example, according to feedback information sent by a client, it is determined whether the message to be pushed needs to be sent to the client again, and specifically, when the feedback information indicates that the client does not successfully receive the message to be pushed, the message to be pushed is sent to the client again; and under the condition that the feedback information indicates that the client successfully receives the message to be pushed, the message to be pushed does not need to be sent to the client again.
Optionally, the confirmed type of message needs to be transmitted back to the cloud message center to continue the service process, or the processing result of the message is used as the count executed by the user scenario to generate a corresponding service model, so that some policies or decision systems can be generated intelligently.
In order to better understand the process of the sending method of the message, the following describes a flow of the method for sending the message with reference to an optional embodiment, but the flow 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, and as shown in fig. 3, the following steps are specifically provided:
step 1.1: when a host system (corresponding to a sender in the above embodiment) starts or registration information changes (such as account switching), initialization of push capability should be performed;
step 1.2: registering a push listener clientID;
step 1.3: initiating a request for registering and connecting a cloud message center to the cloud end, so that a main system where a message service in a subsystem (equivalent to the client end in the embodiment) is located can receive a real-time message of the cloud end;
step 1.4: synchronously connecting cloud states;
IPC connection (interprocess communication connection) between the screen end main system and the subsystem is established, and 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 is used as a message distribution bridge and mainly responsible for connecting a message channel between a main system and the subsystem in a screen end;
step 2.2: registering appID, and sending a request for connecting remote service to a message SDk;
step 2.3: the message SDk registers and connects 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 the connection status to the subsystem.
Implemented using IPC mechanisms. The method mainly aims to realize the capability of directly calling the api interface functions of other systems in a cross-process manner and simplify the process of message forwarding. The concrete service processing part capable of directly forwarding according to the message type does not need to forward through a connection channel of a server and a client every time like socket communication, then secondary distribution of the message event is carried out, the message can also be subjected to panel analysis to the process of encapsulating Bundle, and the method is an upgrade to a c/s message forwarding framework. And the mode is also easy to be compatible with the c/s message circulation 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 request information of registering equipment and user information to a cloud message center (equivalent to a 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.
And the registration equipment and the user information are transmitted to the message center, and when the data of the message center change, the registration equipment is matched with the corresponding user equipment according to the registration information, and the message is transmitted to the user side through the message channel and the registered monitor.
Step 4.1: the cloud message transmits the message to the 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: and issuing the message.
Step 5.1: determining whether a subsystem is connected with a main system;
step 5.2: under the condition that the subsystem is not connected with the main system, the subsystem is activated;
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: the message is distributed.
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, called a main system for short, for aggregation of large-screen message push channels and consistency of message flow and message management in a screen end, and the main system is responsible for issuing received cloud messages and forwarding the messages to other message receiving ends. And other message receiving ends are called subsystems for short. After receiving the message sent 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 matched message object is preprocessed by a strategy of the message interceptor, and the message is directly distributed to subsystems, wherein the subsystems comprise message receiving ends of message subscription in the same process, message subscription in different processes in the same app, services or applications in different processes of different apps and the like. And after receiving the message event sent by the message channel of the subsystem, executing specific service processing.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method of the embodiments of the present application.
Fig. 4 is a block diagram of a message transmitting apparatus according to an embodiment of the present application; as shown in fig. 4, includes:
a receiving module 42, configured to receive a message pushing request sent by a cloud server, where the message pushing request includes: the method comprises the steps of pushing 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;
a sending module 46, configured to, in a case that there is an interprocess communication connection between the sender and the client, call an application program interface function of the client through the interprocess communication, and send a to-be-pushed message included in a push request of the message to the client through the application program interface function.
Through above-mentioned device, receive the message propelling movement request that the cloud end server sent, wherein, the message propelling movement request includes: the method comprises the steps of pushing 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 the sending party and the client corresponding to the identification information have interprocess communication connection; under the condition that the sending party and the client are in interprocess communication connection, an application program interface function of the client is called through the interprocess communication, and a message to be pushed in a message pushing request is sent to the client through the application program interface function, so that the problems that in the related technology, a plurality of message issuing channels exist in terminal equipment, resource waste exists and the like are solved, further, the application embodiment directly issues the message to a local channel through an interprocess communication IPC (inter process communication) interprocess calling interface mode, informs a subscriber to process the message, and the consistency of screen-side message issuing and management is realized.
In an exemplary embodiment, fig. 5 is a block diagram of a sending apparatus of a message 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 or not 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 whether the message to be pushed is normal information 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 an exemplary embodiment, fig. 5 is a block diagram of a sending apparatus of a message according to an embodiment of the present application; as shown in fig. 5, the above apparatus further includes: an establishing module 54, configured to send broadcast information to the client when there is no interprocess communication connection between the sender and the client, 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 interprocess 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 sending apparatus of a message according to an embodiment of the present application; as shown in fig. 5, the above apparatus further includes: a disconnection module 56, configured to receive a disconnection request sent by the client when a current state of the client meets a preset state, where the preset state at least includes one of: the preset duration of the interprocess communication connection between the sender and the client; presetting an active time length of the client; and disconnecting the interprocess 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 case of a system restart of the sender; sending request information for connecting a cloud end to the cloud end; and under the condition that the cloud end responds to the request information and establishes the connection between the cloud end and the sender, receiving a message pushing request sent by the cloud end 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 under the condition that the feedback information indicates that the client side does not successfully receive the message to be pushed, sending the message to be pushed to the client side again.
Embodiments of the present application also provide a storage medium including a stored program, where the program performs any one of the methods described above when executed.
Alternatively, in the present embodiment, the storage medium may be configured to store program codes for performing the following steps:
s1, receiving a message pushing request sent by a cloud server, wherein the message pushing request comprises: the method comprises the steps of pushing 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 the communication connection between the processes exists between the sender and the client corresponding to the identification information;
and S3, under the condition that the sending party and the client have interprocess communication connection, calling an application program interface function of the client through the interprocess communication, and sending the message to be pushed included in the message pushing request to the client through the application program interface function.
Embodiments of the present application further provide an electronic device, comprising a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
Optionally, in this embodiment, the 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 pushing 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 the communication connection between the processes exists between the sender and the client corresponding to the identification information;
and S3, under the condition that the sending party and the client have interprocess communication connection, calling an application program interface function of the client through the interprocess communication, and sending the message to be pushed included in the message pushing request to the client through the application program interface function.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing program codes, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present application described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a memory device and executed by a computing device, and in some cases, the steps shown or described may be executed out of order, or separately as integrated circuit modules, or multiple modules or steps thereof may be implemented as a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A method for sending 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 pushing 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 the sending party and the client corresponding to the identification information have interprocess communication connection;
and under the condition that the sending party and the client have interprocess communication connection, calling an application program interface function of the client through the interprocess communication, and sending the message to be pushed included in the message pushing request to the client through the application program interface function.
2. The method according to claim 1, wherein the sending the message to be pushed to the client through the application program interface function includes:
analyzing the message to be pushed to acquire a 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 indicating 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.
3. The method for sending the message according to claim 2, wherein sending the message to be pushed to the client through the application program interface function according to the pushing policy comprises:
determining whether the message to be pushed is normal information 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.
4. The method for sending the message according to claim 1, wherein receiving the message pushing request sent by the cloud comprises:
initializing the push capability of the sender and registering a push listener under the condition that the system of the sender is restarted;
sending request information for connecting a cloud end to the cloud end;
and under the condition that the cloud responds to the request information and establishes the connection between the cloud and the sender, receiving a message pushing request sent by the cloud through the pushing monitor.
5. The method of claim 1, wherein after determining whether an interprocess communication connection exists between the sender and the client, the method further comprises:
under the condition that the communication connection between the sender and the client does not exist, sending broadcast information to the client, wherein the broadcast information is used for indicating that the sender needs to send messages to the client;
receiving a connection request sent by the client under the condition that the client checks the broadcast information;
and establishing interprocess communication connection between the sender and the client according to the connection request.
6. The method according to claim 5, wherein after the inter-process communication connection between the sender and the client is established 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 states: the preset duration of the interprocess communication connection between the sender and the client; presetting an active time length of the client;
and disconnecting the interprocess communication connection between the sender and the client according to the disconnection request.
7. The method according to claim 1, wherein after the message to be pushed is sent to the client through 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 under the condition that the feedback information indicates that the client side does not successfully receive the message to be pushed, sending the message to be pushed to the client side again.
8. An apparatus for transmitting a message, comprising:
the receiving module is used for receiving a message pushing request sent by a cloud server, wherein the message pushing request comprises: the method comprises the steps of pushing 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 communication connection between the processes exists between the sender and the client corresponding to the identification information;
and the sending module is used for calling an application program interface function of the client through the interprocess communication under the condition that the sending party and the client have interprocess communication connection, and sending the message to be pushed included in the message pushing request to the client through the application program interface function.
9. A computer-readable storage medium, comprising a stored program, wherein the program is operable to perform the method of any one of claims 1 to 7.
10. 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 of any of claims 1 to 7 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 true CN115297162A (en) 2022-11-04
CN115297162B 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)

Cited By (1)

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

Citations (13)

* 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
US20120303774A1 (en) * 2011-05-26 2012-11-29 Mfluent Llc Enhanced Push Notification Services
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

Patent Citations (13)

* 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
US20120303774A1 (en) * 2011-05-26 2012-11-29 Mfluent Llc Enhanced Push Notification Services
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

Cited By (1)

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

Also Published As

Publication number Publication date
CN115297162B (en) 2024-03-22

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
CN109246220B (en) Message pushing system and method
CN110633442A (en) Pushing method and device and electronic equipment
US9425982B2 (en) Server and method for providing device management service and device receiving the device management service
EP3331247A1 (en) Multi-screen control method and device
CN109981421B (en) Intelligent device network distribution method and device
WO2016127612A1 (en) Monitoring processing method and device
CN111258723B (en) Transaction processing method, device, system, medium and equipment of distributed system
CN103401896A (en) Multi-Android-client service sharing method and system
CN112817751A (en) Computing resource management method and device, storage medium and electronic device
CN112671904A (en) Method and device for transmitting equipment state information, storage medium and electronic device
CN115297162B (en) Message sending method and device, storage medium and electronic device
CN114268938A (en) Method, device, equipment and storage medium for managing user front equipment
US20170279686A1 (en) Terminal Topology Management Service Method, Device, and System for Internet of Things
CN105225453B (en) Multi-control-center-based household appliance linkage method and device and control center
CN112672352A (en) Network distribution method for intelligent equipment, mesh relay node, intelligent equipment and server
CN109962967A (en) The method of data synchronization subscribed to based on increment
CN110572271B (en) Method and system for managing voice chat room
CN115174512A (en) Message pushing method and device, storage medium and electronic device
CN112995095B (en) Data processing method, device and computer readable storage medium
CN113691427A (en) Network distribution method, first device, second device, network distribution system and processor
CN112653769A (en) Message pushing method and system
CN102611914B (en) Cloud television application service system and method
CN112968788A (en) Network slice capacity setting method, control method, device, equipment and medium

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