CN108235089B - Line switching control method, storage medium, electronic device and system - Google Patents

Line switching control method, storage medium, electronic device and system Download PDF

Info

Publication number
CN108235089B
CN108235089B CN201810024369.4A CN201810024369A CN108235089B CN 108235089 B CN108235089 B CN 108235089B CN 201810024369 A CN201810024369 A CN 201810024369A CN 108235089 B CN108235089 B CN 108235089B
Authority
CN
China
Prior art keywords
state
line
lock function
function
unlock
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
CN201810024369.4A
Other languages
Chinese (zh)
Other versions
CN108235089A (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.)
Heilongjiang Asia Pacific Electronic Engineering Co ltd
Original Assignee
Wuhan Douyu Network 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 Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201810024369.4A priority Critical patent/CN108235089B/en
Publication of CN108235089A publication Critical patent/CN108235089A/en
Application granted granted Critical
Publication of CN108235089B publication Critical patent/CN108235089B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/41Structure of client; Structure of client peripherals
    • H04N21/422Input-only peripherals, i.e. input devices connected to specially adapted client devices, e.g. global positioning system [GPS]
    • H04N21/42204User interfaces specially adapted for controlling a client device through a remote control device; Remote control devices therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/41Structure of client; Structure of client peripherals
    • H04N21/4104Peripherals receiving signals from specially adapted client devices
    • H04N21/4122Peripherals receiving signals from specially adapted client devices additional display device, e.g. video projector

Abstract

The invention discloses a line switching control method, a storage medium, electronic equipment and a system, and relates to the field of mobile interconnection, wherein the method comprises the steps of defining an atomic variable type state lock function, and defining a lock function and an unlock function for the state lock function; in the screen projection operation process, a lock function is called to lock the state lock function, and after screen projection is completed, a unlock function is called to unlock the state lock function; when the line is switched, judging whether the state lock function is in a locked state, if not, traversing each line, sequentially judging each line, if the current line state is in a selected state, emptying, and if the current line state is in a non-selected state, not processing; and then judging whether the current line is a switching target line or not, if so, setting the current line to be in a selected state, and if not, not processing. The invention can effectively ensure the synchronous operation of line switching and screen projection.

Description

Line switching control method, storage medium, electronic device and system
Technical Field
The invention relates to the field of mobile interconnection, in particular to a line switching control method, a storage medium, electronic equipment and a system.
Background
In live broadcasting viewing, when throwing the screen to the TV end through throwing the screen operation with live broadcast mobile client's live broadcast picture, throw the screen and accomplish the back, a control panel can appear on the live broadcast mobile client, there are a plurality of circuit selection buttons on the control panel, live broadcast platform is in order to guarantee that the user watches live smoothly, can provide a plurality of video source passageways, the selection circuit selects different video source passageways promptly, every video source passageway corresponds a circuit selection button on the control panel, live broadcast mobile client obtains the video source and then carries out the broadcast of live broadcast picture from the video source passageway, when certain video source passageway causes the jam because of the number of users is too much, it can normally broadcast to switch the video source passageway that the circuit selection number is few. After the live broadcast picture of the live broadcast mobile client is finished being projected, when a user clicks and selects different lines, the video source is obtained again, the screen projection operation process can be carried out again, a picture switching process can occur correspondingly at the television end, the screen projection is finished, and the television end continues to play the live broadcast picture. The traditional processing mode is to monitor relevant click events on each button of the control panel, and corresponding processing is performed when the button is clicked.
In practical application, when a user frequently and quickly clicks a switching button on a control panel, due to the fact that the speed of switching a playing page by a television end is low, the situation that the control panel is clicked for many times and the clicking is stopped and the television end continuously switches logic can occur, the effects of circuit switching of the control panel and picture switching of the television end are asynchronous, and therefore interaction conditions which are not friendly are generated.
Disclosure of Invention
Aiming at the defects in the prior art, the invention aims to provide a line switching control method which effectively ensures the synchronous operation of line switching and screen projection operation.
In order to achieve the above purposes, the technical scheme adopted by the invention is as follows:
defining an atomic variable type state lock function, and defining a lock function and an unlock function for the state lock function;
in the screen projection operation process, a lock function is called to lock the state lock function, and after screen projection is completed, a unlock function is called to unlock the state lock function;
when the line is switched, judging whether the state lock function is in a locked state, if so, prompting a user to perform line switching operation later, if not, traversing each line, sequentially judging each line, if the current line state is in a selected state, emptying, and if not, not processing; then the
And judging whether the current line is the switching target line again, if so, setting the current line in a selected state, and if not, not processing.
On the basis of the technical scheme, for the locking and unlocking operations of the state lock function:
carrying out setting value operation on the atomic variable to realize locking operation on the state lock function;
and clearing the value set by the atomic variable to realize the unlocking operation of the state lock function.
On the basis of the technical scheme, when the locking operation is carried out on the state lock function, whether the atomic variable is set or not is judged, and if yes, the locking fails.
On the basis of the technical scheme, when the state of the current line is the selected state, the live broadcast mobile terminal acquires a video source from the line and plays a live broadcast picture.
On the basis of the technical scheme, after a certain line is set to be in a selected state, screen throwing operation is carried out between the live broadcast mobile terminal and the television terminal, at the moment, a lock function is called to carry out locking operation on the state lock function, and after the screen throwing operation between the live broadcast mobile terminal and the television terminal is completed, an unlock function is called to carry out unlocking operation on the state lock function.
The invention also provides a storage medium having stored thereon a computer program which, when executed by a processor, implements the method described above.
The invention also provides an electronic device, which comprises a memory and a processor, wherein the memory stores a computer program running on the processor, and the processor executes the computer program to realize the method.
The present invention also provides a line switching control system, including:
the defining module is used for defining an atomic variable type state lock function and defining a lock function and an unlock function for the state lock function;
the upper unlocking module is used for calling a lock function to lock the state lock function in the screen projection operation process, and calling an unlock function to unlock the state lock function after screen projection is finished;
and the judging module is used for judging whether the state lock function is in a locked state when the line is switched, prompting a user to perform line switching operation later if the state lock function is in the locked state, traversing each line if the state lock function is not in the locked state, sequentially judging each line, emptying if the state of the current line is in a selected state, not processing if the current line is in a non-selected state, judging whether the current line is a switching target line again, setting the current line to be in a selected state if the current line is in the selected state, and not processing if the current line is not in the selected state.
On the basis of the technical scheme, the upper unlocking module performs locking and unlocking operations on the state lock function: carrying out setting value operation on the atomic variable to realize locking operation on the state lock function; and clearing the value set by the atomic variable to realize the unlocking operation of the state lock function.
On the basis of the technical scheme, when the state of the current line is the selected state, the live broadcast mobile terminal acquires a video source from the line and plays a live broadcast picture.
Compared with the prior art, the invention has the advantages that: the state lock function is mapped with the screen projection process through the definition of the state lock function, if the screen projection operation is currently carried out, the state lock function is in a locked state, processing is not carried out at the moment, and therefore it is guaranteed that line switching operation cannot be carried out any more when the screen projection operation is carried out, the switching operation and the screen projection operation state of a line are synchronous, and better interaction experience is brought to a user.
Drawings
Fig. 1 is a flowchart of a line switching control method according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples.
Referring to fig. 1, an embodiment of the present invention provides a line switching control method, which is suitable for a screen-casting operation of a live broadcast mobile terminal at a television terminal, and includes:
s1: a status lock function castingLock of an atomic variable type is defined, and a lock function and an unlock function are defined for the status lock function.
The screen projection is a time-consuming process, and when the screen projection for the first time is not completed, the switching operation of the screen projection for the second time is performed, so that unfriendly interactive experience is brought to a user. In the embodiment of the invention, the state lock function is an atomic variable, and the atomic variable is thread-safe in java, so that the abnormal condition can not occur when a plurality of threads operate the state lock function.
In the traditional scheme, the maintenance of the synchronization state when the live broadcast mobile terminal and the television terminal screen cast is changed by using a global variable, but the synchronization state is managed by using the global variable, so that the defects are that firstly, threads are unsafe, namely, the state is disordered when multi-thread operation is carried out, so that the state maintenance is wrong; secondly, the maintenance is complex, and programmers need to spend more time and energy to manage and maintain the synchronous state, so that the waste of human resources is caused; thirdly, due to the difficulty of maintenance, bug with abnormal state is easily introduced, so that the program is not robust enough and the effective and correct execution of the program cannot be ensured.
S2: in the screen projection operation process, a lock function is called to lock the state lock function, and after screen projection is completed, an unlock function is called to unlock the state lock function. For lock and unlock operations of the state lock function: carrying out setting value operation on the atomic variable to realize locking operation on the state lock function; and clearing the value set by the atomic variable to realize the unlocking operation of the state lock function. And when the locking operation is carried out on the state lock function, whether the atomic variable is set or not is judged, if yes, the locking fails, and at the moment, an error message, namely, the lock fails, is returned. Similarly, for unlocking the state lock function, the unlock function clears the value of the atomic variable, and the unlock function clears the atomic variable no matter whether the atomic variable is set with the value or is empty. The screen projection operation process refers to the process from the screen projection start to the screen projection end.
Through the steps, the whole screen projection process is mapped to the state lock function, and the current state condition can be acquired through the state lock function in the later stage when the switching operation of the line is carried out.
S3: when the line is switched, judging whether the state lock function is in a locked state, if so, indicating that screen projection operation is performed at the moment, prompting a user to perform line switching operation later, if not, traversing each line, sequentially judging each line, if the current line state is a selected state, emptying, and if the current line state is a non-selected state, not processing; and then, judging whether the current line is a switching target line or not, wherein the target line is a line to be switched, if so, setting the current line to be in a selected state, otherwise, not processing, and so on, thereby finishing the judgment of all lines and finishing the operation of switching to the target line.
When a certain line is set to be in a selected state, screen throwing operation is carried out between the live broadcast mobile terminal and the television terminal, at the moment, a lock function is called to carry out locking operation on the state lock function, and after the screen throwing operation between the live broadcast mobile terminal and the television terminal is completed, an unlock function is called to carry out unlocking operation on the state lock function. The state lock function is mapped with the screen projection process through the definition of the state lock function, if the screen projection operation is currently carried out, the state lock function is in a locked state, processing is not carried out at the moment, and therefore it is guaranteed that line switching operation cannot be carried out any more when the screen projection operation is carried out, the switching operation and the screen projection operation state of a line are synchronous, and better interaction experience is brought to a user.
In the conventional scheme, the switching of the lines is performed through a global variable, when different lines are selected, the global variable is changed into corresponding line information, and thus state information can be acquired through the global variable.
In an embodiment, when switching lines, after judging that the state lock function is in an unlocked state, the states of all lines are set to be in an unselected state, and then a target line is set to be in a selected state, and if switching is performed from a line 1 to a line 2, the states of all lines are set to be in the unselected state, and then the state of the line 2 is set to be in the selected state, so that switching of the lines is completed.
When the definition of the live-broadcast watching picture is switched, the screen projection operation is carried out again after the definition switching is finished, and different video sources are obtained in principle by switching the definition, so that a method similar to the line switching control method of the embodiment of the invention can be used for synchronizing the definition switching and the screen projection operation.
According to the line switching control method, through the definition of the state lock function, when screen projection operation is carried out between the live broadcast mobile terminal and the television terminal, the lock function is called to carry out locking operation on the state lock function, after the screen projection operation between the live broadcast mobile terminal and the television terminal is completed, the unlock function is called to carry out unlocking operation on the state lock function, mapping between the state lock function and the screen projection process is achieved, if the screen projection operation is carried out currently, the state lock function is in a locking state, processing is not carried out at the time, and therefore the line switching operation cannot be carried out any more when the screen projection operation is carried out, synchronization of the line switching operation and the screen projection operation state is guaranteed, and good interactive experience is brought to a user.
In addition, corresponding to the line switching control method, the present invention further provides a storage medium, where a computer program is stored, and the computer program, when executed by a processor, implements the steps of the line switching control method according to each of the above embodiments. The storage medium includes various media capable of storing program codes, such as a usb disk, a removable hard disk, a ROM (Read-Only Memory), a RAM (Random Access Memory), a magnetic disk, or an optical disk.
Referring to fig. 2, in response to the line switching control method, the present invention further provides an electronic device, which includes a memory and a processor, where the memory stores a computer program running on the processor, and the processor executes the computer program to implement the line switching control method according to the foregoing embodiments.
The invention also provides a line switching control system based on the line switching control method, which comprises a definition module, an upper unlocking module and a judgment module.
The defining module is used for defining an atomic variable type state lock function and defining a lock function and an unlock function for the state lock function; the upper unlocking module is used for calling a lock function to lock the state lock function in the screen projection operation process, and calling an unlock function to unlock the state lock function after screen projection is finished; the judging module is used for judging whether the state lock function is in a locked state when the line is switched, prompting a user to perform line switching operation later if the state lock function is in the locked state, traversing each line if the state lock function is not in the locked state, sequentially judging each line, emptying if the current line is in a selected state, not processing if the current line is in a non-selected state, judging whether the current line is a switching target line again, setting the current line to be in a selected state if the current line is in the selected state, and not processing if the current line is not in the selected state.
The locking and unlocking operations of the locking and unlocking module on the state lock function are as follows: carrying out setting value operation on the atomic variable to realize locking operation on the state lock function; and clearing the value set by the atomic variable to realize the unlocking operation of the state lock function. And when the current line state is the selected state, the live broadcast mobile terminal acquires a video source from the line and plays a live broadcast picture.
According to the line switching control system, through the definition of the state lock function, when screen projection operation is carried out between the live broadcast mobile terminal and the television terminal, the upper unlocking module calls the lock function to carry out locking operation on the state lock function, after the screen projection operation between the live broadcast mobile terminal and the television terminal is completed, the upper unlocking module calls the unlock function to carry out unlocking operation on the state lock function, mapping between the state lock function and the screen projection process is achieved, if the screen projection operation is carried out currently, the state lock function is in the locking state, processing is not carried out at the time, and therefore it is guaranteed that line switching operation cannot be carried out any more when the screen projection operation is carried out currently, synchronization of line switching operation and screen projection operation state is guaranteed, and good interactive experience is brought to users.
The present invention is not limited to the above-described embodiments, and it will be apparent to those skilled in the art that various modifications and improvements can be made without departing from the principle of the present invention, and such modifications and improvements are also considered to be within the scope of the present invention. Those not described in detail in this specification are within the skill of the art.

Claims (9)

1. A line switching control method is suitable for screen projection operation of a live broadcast mobile terminal at a television terminal, and is characterized by comprising the following steps:
defining an atomic variable type state lock function, and defining a lock function and an unlock function for the state lock function;
in the screen projection operation process, a lock function is called to lock the state lock function, and after screen projection is completed, a unlock function is called to unlock the state lock function;
when the line is switched, judging whether the state lock function is in a locked state, if so, prompting a user to perform line switching operation later, if not, traversing each line, sequentially judging each line, if the current line state is in a selected state, emptying, and if not, not processing; then the
And judging whether the current line is the switching target line again, if so, setting the current line in a selected state, and if not, not processing.
2. A line switching control method as claimed in claim 1, wherein for the locking and unlocking operations of the state lock function:
carrying out setting value operation on the atomic variable to realize locking operation on the state lock function;
and clearing the value set by the atomic variable to realize the unlocking operation of the state lock function.
3. A line switching control method as claimed in claim 1, characterized in that: and when the current line state is the selected state, the live broadcast mobile terminal acquires a video source from the line and plays a live broadcast picture.
4. A line switching control method as claimed in claim 1, characterized in that: when a certain line is set to be in a selected state, screen throwing operation is carried out between the live broadcast mobile terminal and the television terminal, at the moment, a lock function is called to carry out locking operation on the state lock function, and after the screen throwing operation between the live broadcast mobile terminal and the television terminal is completed, an unlock function is called to carry out unlocking operation on the state lock function.
5. A storage medium having a computer program stored thereon, characterized in that: the computer program, when executed by a processor, implements the method of any of claims 1 to 4.
6. An electronic device comprising a memory and a processor, the memory having stored thereon a computer program that runs on the processor, characterized in that: the processor, when executing the computer program, implements the method of any of claims 1 to 4.
7. A line switching control system, comprising:
the defining module is used for defining an atomic variable type state lock function and defining a lock function and an unlock function for the state lock function;
the upper unlocking module is used for calling a lock function to lock the state lock function in the screen projection operation process, and calling an unlock function to unlock the state lock function after screen projection is finished;
and the judging module is used for judging whether the state lock function is in a locked state when the line is switched, prompting a user to perform line switching operation later if the state lock function is in the locked state, traversing each line if the state lock function is not in the locked state, sequentially judging each line, emptying if the state of the current line is in a selected state, not processing if the current line is in a non-selected state, judging whether the current line is a switching target line again, setting the current line to be in a selected state if the current line is in the selected state, and not processing if the current line is not in the selected state.
8. The line switch control system of claim 7, wherein the up-lock module is to, for the up-lock and down-lock operations of the state-lock function: carrying out setting value operation on the atomic variable to realize locking operation on the state lock function; and clearing the value set by the atomic variable to realize the unlocking operation of the state lock function.
9. A line switching control system as claimed in claim 7, wherein: and when the current line state is the selected state, the live broadcast mobile terminal acquires a video source from the line and plays a live broadcast picture.
CN201810024369.4A 2018-01-10 2018-01-10 Line switching control method, storage medium, electronic device and system Active CN108235089B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810024369.4A CN108235089B (en) 2018-01-10 2018-01-10 Line switching control method, storage medium, electronic device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810024369.4A CN108235089B (en) 2018-01-10 2018-01-10 Line switching control method, storage medium, electronic device and system

Publications (2)

Publication Number Publication Date
CN108235089A CN108235089A (en) 2018-06-29
CN108235089B true CN108235089B (en) 2021-02-02

Family

ID=62640269

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810024369.4A Active CN108235089B (en) 2018-01-10 2018-01-10 Line switching control method, storage medium, electronic device and system

Country Status (1)

Country Link
CN (1) CN108235089B (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102904939A (en) * 2012-09-26 2013-01-30 惠州市华阳多媒体电子有限公司 Method and associated device of screen sharing
CN105518643A (en) * 2013-08-30 2016-04-20 三星电子株式会社 Multi display method, storage medium, and electronic device
EP3011725A1 (en) * 2013-06-18 2016-04-27 Samsung Electronics Co., Ltd. Method and apparatus for controlling content shared between devices in wireless communication system
CN106569758A (en) * 2015-10-10 2017-04-19 阿里巴巴集团控股有限公司 Wireless projection screen method and device
CN107003818A (en) * 2014-10-17 2017-08-01 三星电子株式会社 The method and the equipment using this method of screen are shared between devices
CN107509094A (en) * 2017-09-12 2017-12-22 中广热点云科技有限公司 A kind of method of intelligent television programme televised live association request program

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060277488A1 (en) * 2005-06-07 2006-12-07 Eastman Kodak Company Information presentation on wide-screen displays

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102904939A (en) * 2012-09-26 2013-01-30 惠州市华阳多媒体电子有限公司 Method and associated device of screen sharing
EP3011725A1 (en) * 2013-06-18 2016-04-27 Samsung Electronics Co., Ltd. Method and apparatus for controlling content shared between devices in wireless communication system
CN105518643A (en) * 2013-08-30 2016-04-20 三星电子株式会社 Multi display method, storage medium, and electronic device
CN107003818A (en) * 2014-10-17 2017-08-01 三星电子株式会社 The method and the equipment using this method of screen are shared between devices
CN106569758A (en) * 2015-10-10 2017-04-19 阿里巴巴集团控股有限公司 Wireless projection screen method and device
CN107509094A (en) * 2017-09-12 2017-12-22 中广热点云科技有限公司 A kind of method of intelligent television programme televised live association request program

Also Published As

Publication number Publication date
CN108235089A (en) 2018-06-29

Similar Documents

Publication Publication Date Title
US10945002B2 (en) Multimedia playback method and related device
KR101924163B1 (en) Methods, systems, and media for managing output of an hdmi source
US20180103296A1 (en) Method and apparatus for video playing processing and television
CN105828163A (en) Video preview method and device
CN112153470B (en) Video playing method and device, computer equipment and storage medium
US11706489B2 (en) Display apparatus with intelligent user interface
US20230061691A1 (en) Display Apparatus with Intelligent User Interface
US20220027117A1 (en) Screen projection processing method and device
CN111277884A (en) Video playing method and device
CN104883583A (en) Method and device for acquiring online video screenshot
CN104994427A (en) Method and system for configuring and managing self-start-up of smart television desktop
CN103997680A (en) Switching method and device of video bitstream
CN104135693A (en) A video playing method, smart TV and server
CN112738539A (en) Live broadcast room switching method and device, computer readable storage medium and electronic equipment
US20170188109A1 (en) Method and electronic device for switching video
CN109348285A (en) Channel switching method and device
CN103729240A (en) Application program control method
CN105704540B (en) Switch the method and apparatus of live telecast channel
CN106060633A (en) Signal source image preview method and television terminal
US20170134789A1 (en) Operation instructing method and apparatus for remote controller of intelligent television
CN113014985A (en) Interactive multimedia content processing method and device, electronic equipment and storage medium
CN112492374A (en) Display method and device of floating window, television and storage medium
CN110012345B (en) Channel switching method and television terminal
CN103747331A (en) Interactive method of watching videos and device thereof
CN107484024B (en) Method for realizing global floating menu by using hot key based on WEBOS intelligent television system

Legal Events

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

Effective date of registration: 20240320

Address after: No. 1, 11th Floor, Building A, No. 6 Shanghai Street, Daoli District, Harbin City, Heilongjiang Province, 150000 (residential)

Patentee after: Heilongjiang Asia Pacific Electronic Engineering Co.,Ltd.

Country or region after: Zhong Guo

Address before: 430000 East Lake Development Zone, Wuhan City, Hubei Province, No. 1 Software Park East Road 4.1 Phase B1 Building 11 Building

Patentee before: WUHAN DOUYU NETWORK TECHNOLOGY Co.,Ltd.

Country or region before: Zhong Guo