Movatterモバイル変換


[0]ホーム

URL:


CN114168094A - Miracast message processing method, device and equipment based on inheritable state machine - Google Patents

Miracast message processing method, device and equipment based on inheritable state machine
Download PDF

Info

Publication number
CN114168094A
CN114168094ACN202111402968.3ACN202111402968ACN114168094ACN 114168094 ACN114168094 ACN 114168094ACN 202111402968 ACN202111402968 ACN 202111402968ACN 114168094 ACN114168094 ACN 114168094A
Authority
CN
China
Prior art keywords
state
message
processed
state machine
miracast
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
CN202111402968.3A
Other languages
Chinese (zh)
Other versions
CN114168094B (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.)
Shenzhen Konka Electronic Technology Co Ltd
Original Assignee
Shenzhen Konka Electronic Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Konka Electronic Technology Co LtdfiledCriticalShenzhen Konka Electronic Technology Co Ltd
Priority to CN202111402968.3ApriorityCriticalpatent/CN114168094B/en
Publication of CN114168094ApublicationCriticalpatent/CN114168094A/en
Application grantedgrantedCritical
Publication of CN114168094BpublicationCriticalpatent/CN114168094B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Classifications

Landscapes

Abstract

The embodiment of the invention provides a method, a device and equipment for processing Miracast messages based on an inheritable state machine, wherein the method comprises the following steps: when detecting that screen projection equipment is accessed, establishing virtual equipment for the screen projection equipment, and distributing a state machine for the virtual equipment; the state machine comprises a plurality of states at different levels, and inheritance relationships exist among the states at different levels; acquiring an execution action of the screen projection equipment, and triggering the state machine to enter a corresponding state according to the execution action; receiving a message to be processed, and judging whether the message needs to be processed or not according to the message to be processed and the current state; and when the message is judged to need to be processed, acquiring a state corresponding to the message from the current state and a parent state inherited from the current state, and processing the message in the corresponding state. The invention improves the success rate of multi-path Miracast screen-casting connection, and can improve the average success rate from about 80% to more than 98%.

Description

Miracast message processing method, device and equipment based on inheritable state machine
Technical Field
The invention relates to the technical field of computers, in particular to a method, a device and equipment for processing Miracast messages based on an inheritable state machine.
Background
With the continuous development of television technology, updating iteration has higher requirements on the function and performance of the Wi-Fi module. At present, a television and mobile equipment are mostly integrated with a Miracast screen projection function, and the user experience is directly influenced by the connection time of the Miracast.
At present, the Miracast connection needs a plurality of steps, mainly comprises a part 2, the first part is the connection of p2p, the second part is rtsp interaction, a great amount of coupling exists between the parts, and the situation that the connection is not good or not timely enough is likely to occur.
Disclosure of Invention
In view of the above, an object of the present invention is to provide a method, an apparatus and a device for Miracast message processing based on an inheritable state machine, so as to improve the above problems.
The embodiment of the invention provides a Miracast message processing method based on an inheritable state machine, which comprises the following steps:
when detecting that screen projection equipment is accessed, establishing virtual equipment for the screen projection equipment, and distributing a state machine for the virtual equipment; the state machine comprises a plurality of states at different levels, and inheritance relationships exist among the states at different levels;
acquiring an execution action of the screen projection equipment, and triggering the state machine to enter a corresponding state according to the execution action;
receiving a message to be processed, and judging whether the message needs to be processed or not according to the message to be processed and the current state;
and when the message is judged to need to be processed, acquiring a state corresponding to the message from the current state and a parent state inherited from the current state, and processing the message in the corresponding state.
Preferably, the method further comprises the following steps:
discarding the message when it is determined that the message does not need to be processed.
Preferably, the state corresponding to the message is obtained through a preset message-state mapping table.
Preferably, the state machine comprises:
a default state at a first level;
a P2P connection state and a P2P connection state at a second level, the P2P connection state and P2P connection state both inherit the default state;
an authentication state, an IP acquisition state, an IP valid state, an IP invalid state and a disconnection waiting state which are positioned at the third level and inherit from the connection state of the P2P;
a WFD valid state at a fourth level that inherits the IP valid state;
and the RTSP state, the WFD on state and the cleaning state which are inherited from the WFD effective state and are positioned in the fourth layer level.
Preferably, the method further comprises the following steps:
upon entering and leaving a predetermined state of the state machine, an operation corresponding to the state is performed by default.
Preferably, when entering and leaving a predetermined state of the state machine, executing by default an operation corresponding to said state comprises:
starting a screen projection interface when entering a WFD (Windows presentation device) effective state;
and when the WFD valid state is left, the screen throwing interface is cancelled.
An embodiment of the present invention further provides a Miracast message processing apparatus based on an inheritable state machine, including:
the state machine allocation unit is used for creating a virtual device for the screen projection device and allocating a state machine for the virtual device when the screen projection device is detected to be accessed; the state machine comprises a plurality of states at different levels, and inheritance relationships exist among the states at different levels;
the state triggering unit is used for acquiring the execution action of the screen projection equipment and triggering the state machine to enter a corresponding state according to the execution action;
the message judging unit is used for receiving the message to be processed and judging whether the message needs to be processed or not according to the message to be processed and the current state;
and the message processing unit is used for acquiring the state corresponding to the message from the current state and the parent state inherited from the current state when the message is judged to need to be processed, and processing the message in the corresponding state.
Preferably, the method further comprises the following steps:
a discarding unit configured to discard the message when it is determined that the message does not need to be processed.
Preferably, the state corresponding to the message is obtained through a preset message-state mapping table.
The embodiment of the invention also provides Miracast message processing equipment based on the inheritable state machine, which comprises a memory and a processor, wherein a computer program is stored in the memory and can be executed by the processor, so that the Miracast message processing method based on the inheritable state machine is realized.
In the embodiment, when multiple Miracast screen projection devices appear, one state machine is allocated to each screen projection device, one state machine can only be in one state, the corresponding message processing modes in each state are different, and different states correspond to different states of different levels of P2P and rtsp, so that a P2P connection process is attached, and the purposes of reducing errors and improving the connection success rate are achieved. Research shows that the average success rate can be improved to more than 98% from about 80% by the method.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
Fig. 1 is a flowchart illustrating a Miracast message processing method based on an inheritable state machine according to a first embodiment of the present invention.
Fig. 2 is a schematic diagram of a state machine according to an embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a Miracast message processing apparatus based on an inheritable state machine according to a second embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the 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 invention.
For better understanding of the technical solutions of the present invention, the following detailed descriptions of the embodiments of the present invention are provided with reference to the accompanying drawings.
It should be understood that the described embodiments are only some embodiments of the invention, and 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 invention.
The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
The invention is described in further detail below with reference to the following detailed description and accompanying drawings:
referring to fig. 1, a first embodiment of the present invention provides a method for Miracast message processing based on inheritable state machines, which is executed by a Miracast message processing device based on inheritable state machines (hereinafter referred to as a message processing device), and in particular, executed by one or more processors in the message processing device, to implement the following steps:
s101, when detecting that screen projection equipment is accessed, establishing virtual equipment for the screen projection equipment, and distributing a state machine for the virtual equipment; the state machine comprises a plurality of states at different levels, and inheritance relationships exist among the states at the different levels.
In this embodiment, the message processing device may be, for example, a smart television, a smart projector, a smart tablet, or the like, and may receive a screen projection picture sent by a screen projection device, such as a mobile phone, and display the screen projection picture on a display of the message processing device.
In this embodiment, the screen projection device and the message processing device may be connected through P2P, and when the message processing device detects that the screen projection device is accessed, the message processing device creates a virtual device for the screen projection device and allocates a state machine for the virtual device; the state machine comprises a plurality of states at different levels, and inheritance relationships exist among the states at the different levels.
As shown in fig. 2, fig. 2 shows one possible state machine. In fig. 2, the state machine includes:
a default state at a first level;
a P2P connection state and a P2P connection state at a second level, the P2P connection state and P2P connection state both inherit the default state;
an authentication state, an IP acquisition state, an IP valid state, an IP invalid state and a disconnection waiting state which are positioned at the third level and inherit from the connection state of the P2P;
a WFD valid state at a fourth level that inherits the IP valid state;
and the RTSP state, the WFD on state and the cleaning state which are inherited from the WFD effective state and are positioned in the fourth layer level.
In which a device can only be in one state, and if the device is in the P2P connection state, it is impossible to be in the P2P disconnection state at the same time. An inheritance relationship exists between the states, the inheritance relationship is represented by arrows in fig. 2, the WFD (Wi-Fi Direct, i.e., Wi-Fi screen projection) is in a sub-state of the WFD valid state, and the WFD valid state is in a sub-state of the IP valid state.
It should be noted that, in the embodiment of the present invention, the different states correspond to different states of different levels of P2P and rtsp, so as to conform to the P2P connection flow. In other embodiments of the present invention, the states of the state machine and the inheritance relationship between the states may also be set according to actual needs, and the state machine is only an example of the present invention and is not to be construed as a limitation of the present invention.
S102, obtaining the execution action of the screen projection equipment, and triggering the state machine to enter a corresponding state according to the execution action.
S103, receiving the message to be processed, and judging whether the message needs to be processed or not according to the message to be processed and the current state.
S104, when the message is judged to need to be processed, acquiring the state corresponding to the message from the current state and the parent state inherited from the current state, and processing the message in the corresponding state.
In the present embodiment, the messages can be processed in different states, for example, in the P2P disconnection state, the messages of P2P disconnection can be not processed, i.e., the messages are directly discarded. And when the P2P connection state receives the P2P disconnection message, some disconnection operations are needed.
In this embodiment, the message that is not processed by the child state may be handed over to the parent state, for example, the IP acquiring state may choose not to process the P2P disconnect message and be handed over to the parent state P2P connection state (as compared with the prior art, the P2P disconnect message needs to be processed step by step according to the connection flow, that is, the P2P disconnect message needs to be processed three times).
In this embodiment, the message processing mode may be defined by a preset message-state mapping table, which defines messages that may need to be processed and their corresponding states, so as to ensure accurate processing of the messages.
In addition, some operations can be selected when entering and leaving the state machine, such as entering the WFD conducting state, the screen projection interface can be started, and leaving the WFD state, the screen projection interface can be cancelled.
In summary, in this embodiment, when multiple Miracast screen projection occurs, one state machine is allocated to each screen projection device, and one state machine can only be in one state, the manner of processing the corresponding message in each state is different, and different states correspond to different states of different levels of P2P and rtsp, so as to attach the P2P connection flow, thereby achieving the purposes of reducing errors and improving the connection success rate. Research shows that the average success rate can be improved to more than 98% from about 80% by the method.
Referring to fig. 3, a second embodiment of the present invention further provides a Miracast message processing apparatus based on an inheritable state machine, which includes:
the state machine allocation unit 210 is configured to, when it is detected that a screen projection device is accessed, create a virtual device for the screen projection device, and allocate a state machine to the virtual device; the state machine comprises a plurality of states at different levels, and inheritance relationships exist among the states at different levels;
thestate triggering unit 220 is configured to acquire an execution action of the screen projection device, and trigger the state machine to enter a corresponding state according to the execution action;
a message determining unit 230, configured to receive a message to be processed, and determine whether the message needs to be processed according to the message to be processed and a current state;
a message processing unit 240, configured to, when it is determined that the message needs to be processed, obtain a state corresponding to the message from the current state and a parent state inherited from the current state, and process the message in the corresponding state.
Preferably, the method further comprises the following steps:
a discarding unit configured to discard the message when it is determined that the message does not need to be processed.
Preferably, the state corresponding to the message is obtained through a preset message-state mapping table.
The third embodiment of the present invention further provides a Miracast message processing device based on an inheritable state machine, which includes a memory and a processor, where a computer program is stored in the memory, and the computer program can be executed by the processor, so as to implement the Miracast message processing method based on the inheritable state machine.
In the embodiments provided in the present invention, it should be understood that the disclosed method can be implemented in other ways. The apparatus and method embodiments described above are illustrative only, as the flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present invention may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, an electronic device, or a network device) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes. It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

CN202111402968.3A2021-11-242021-11-24Miracast message processing method, device and equipment based on inheritable state machineActiveCN114168094B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202111402968.3ACN114168094B (en)2021-11-242021-11-24Miracast message processing method, device and equipment based on inheritable state machine

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202111402968.3ACN114168094B (en)2021-11-242021-11-24Miracast message processing method, device and equipment based on inheritable state machine

Publications (2)

Publication NumberPublication Date
CN114168094Atrue CN114168094A (en)2022-03-11
CN114168094B CN114168094B (en)2024-07-02

Family

ID=80480252

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202111402968.3AActiveCN114168094B (en)2021-11-242021-11-24Miracast message processing method, device and equipment based on inheritable state machine

Country Status (1)

CountryLink
CN (1)CN114168094B (en)

Citations (12)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101141435A (en)*2006-09-102008-03-12华为技术有限公司 Scheduling system and its message processing method
CN103473426A (en)*2013-09-242013-12-25上海无线电设备研究所Design method for satellite-borne phased array signal processing architecture based on embedded system frame
CN103513971A (en)*2012-06-202014-01-15鸿富锦精密工业(深圳)有限公司Executing system and executing method of finite-state machine
CN103702283A (en)*2013-12-122014-04-02小米科技有限责任公司Message sending method, receiving method, device, terminal equipment and server
CN105453151A (en)*2013-08-052016-03-30高通股份有限公司WLAN-capable remote control device
CN107332971A (en)*2017-05-192017-11-07青岛海信电器股份有限公司A kind of method and device of control intelligent display device Wireless Display
CN109451345A (en)*2018-11-052019-03-08四川长虹电器股份有限公司A kind of method that DLNA throws screen authority managing and controlling in Android intelligent television
CN109582398A (en)*2018-11-232019-04-05阿里巴巴集团控股有限公司A kind of condition processing method, device and electronic equipment
CN110515576A (en)*2019-07-082019-11-29华为技术有限公司 Display control method and device
CN111510336A (en)*2020-04-232020-08-07杭州迪普科技股份有限公司Network equipment state management method and device
CN112328344A (en)*2020-11-022021-02-05联想(北京)有限公司Screen projection processing method and first equipment
CN113282355A (en)*2021-05-182021-08-20Oppo广东移动通信有限公司Instruction execution method and device based on state machine, terminal and storage medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101141435A (en)*2006-09-102008-03-12华为技术有限公司 Scheduling system and its message processing method
CN103513971A (en)*2012-06-202014-01-15鸿富锦精密工业(深圳)有限公司Executing system and executing method of finite-state machine
CN105453151A (en)*2013-08-052016-03-30高通股份有限公司WLAN-capable remote control device
CN103473426A (en)*2013-09-242013-12-25上海无线电设备研究所Design method for satellite-borne phased array signal processing architecture based on embedded system frame
CN103702283A (en)*2013-12-122014-04-02小米科技有限责任公司Message sending method, receiving method, device, terminal equipment and server
CN107332971A (en)*2017-05-192017-11-07青岛海信电器股份有限公司A kind of method and device of control intelligent display device Wireless Display
CN109451345A (en)*2018-11-052019-03-08四川长虹电器股份有限公司A kind of method that DLNA throws screen authority managing and controlling in Android intelligent television
CN109582398A (en)*2018-11-232019-04-05阿里巴巴集团控股有限公司A kind of condition processing method, device and electronic equipment
CN110515576A (en)*2019-07-082019-11-29华为技术有限公司 Display control method and device
CN111510336A (en)*2020-04-232020-08-07杭州迪普科技股份有限公司Network equipment state management method and device
CN112328344A (en)*2020-11-022021-02-05联想(北京)有限公司Screen projection processing method and first equipment
CN113282355A (en)*2021-05-182021-08-20Oppo广东移动通信有限公司Instruction execution method and device based on state machine, terminal and storage medium

Also Published As

Publication numberPublication date
CN114168094B (en)2024-07-02

Similar Documents

PublicationPublication DateTitle
US9910695B2 (en)Automatic virtual machine termination in a cloud
US10601682B2 (en)Service availability management method, service availability management apparatus, and network function virtualization architecture thereof
CN110324793B (en)Information reminding method and device and electronic terminal
CN106227585B (en)Application program starting method, device and equipment
US20070005926A1 (en)Method for managing a memory in mobile terminal
CN110580188A (en)multithreading network distribution method and storage medium
CN109800204B (en)Data distribution method and related product
US20200233694A1 (en)Methods, mediums, and systems for provisioning application services
CN103257898A (en)Resource allocation method and system in embedded system
CN109275042A (en)A kind of distribution method, device, terminal and the storage medium of barrage message
CN111274022A (en)Server resource allocation method and system
CN107678918A (en)The OSD heartbeat mechanisms method to set up and device of a kind of distributed file system
CN108259526A (en)A kind of data transmission method and device
EP3518166A1 (en)Mobile terminal-based payment method and mobile terminal
CN107682389A (en)A kind of method, terminal and computer-readable recording medium for performing network request
CN109948332A (en)A kind of physical machine login password remapping method and device
CN111726835A (en) Voice calling method, device and electronic device
CN110837431A (en)Service control method, service control device, computer equipment and computer-readable storage medium
CN110753323A (en) A kind of card resource allocation method and server
CN114168094A (en)Miracast message processing method, device and equipment based on inheritable state machine
CN108390913A (en)A kind of control user uses the method and device of resource
CN111367648A (en)Resource allocation method and device
CN112100017A (en)Memory resource monitoring method and device
US20150199406A1 (en)Method and device for filtering system events, terminal, and storage medium
KR101719724B1 (en)Resource management system and method, and method for deciding resource price by the same system

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp