CN109698973A - A kind of progress update method, device, electronic equipment and medium - Google Patents

A kind of progress update method, device, electronic equipment and medium Download PDF

Info

Publication number
CN109698973A
CN109698973A CN201811641257.XA CN201811641257A CN109698973A CN 109698973 A CN109698973 A CN 109698973A CN 201811641257 A CN201811641257 A CN 201811641257A CN 109698973 A CN109698973 A CN 109698973A
Authority
CN
China
Prior art keywords
progress
barrage
processing controller
message
controller class
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
CN201811641257.XA
Other languages
Chinese (zh)
Other versions
CN109698973B (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.)
Wuhan Douyu Network Technology 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 CN201811641257.XA priority Critical patent/CN109698973B/en
Publication of CN109698973A publication Critical patent/CN109698973A/en
Application granted granted Critical
Publication of CN109698973B publication Critical patent/CN109698973B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/4302Content synchronisation processes, e.g. decoder synchronisation
    • H04N21/4307Synchronising the rendering of multiple content streams or additional data on devices, e.g. synchronisation of audio on a mobile phone with the video output on the TV screen
    • 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/44Arrangements for executing specific programs
    • G06F9/448Execution paradigms, e.g. implementations of programming paradigms
    • G06F9/4488Object-oriented
    • G06F9/449Object-oriented method invocation or resolution
    • 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/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/431Generation of visual interfaces for content selection or interaction; Content or additional data rendering
    • H04N21/4312Generation of visual interfaces for content selection or interaction; Content or additional data rendering involving specific graphical features, e.g. screen layout, special fonts or colors, blinking icons, highlights or animations
    • 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/47End-user applications
    • H04N21/478Supplemental services, e.g. displaying phone caller identification, shopping application
    • H04N21/4788Supplemental services, e.g. displaying phone caller identification, shopping application communicating with other users, e.g. chatting
    • 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/47End-user applications
    • H04N21/488Data services, e.g. news ticker
    • H04N21/4884Data services, e.g. news ticker for displaying subtitles

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Stored Programmes (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a kind of progress update method, device, electronic equipment and medium, method includes: that barrage distributor obtains the progress barrage message generated by preset barrage messaging protocol, and the progress barrage message includes current schedules data;The barrage distributor is by the progress barrage message distribution to processing controller class predetermined;The processing controller class verifies the progress barrage message as after legitimate messages, the value of progress bar view object is updated according to the current schedules data in the progress barrage message, to update the progress image currently shown on display unit, wherein, the progress bar view object is passed in advance in the processing controller class, so that the processing controller class holds the adduction relationship of the progress bar view object.The present invention solve existing progress update existing for can not the synchronous technical problem of multi-user, realize the synchronous progress of multi-user and update.

Description

A kind of progress update method, device, electronic equipment and medium
Technical field
The present invention relates to Internet technical field more particularly to a kind of progress update method, device, electronic equipment and Jie Matter.
Background technique
With the progress of network communication technology and the speed-raising of broadband network, online game, network direct broadcasting etc. types of applications Obtained more and more development, more and more users' selection on the net by types of applications or web interface carry out amusement with It makes friends.
Current application and webpage in order to provide the user with better service, can usually need to carry out safety promotion, Interactive interface improves, new function adds or display appearance is improved etc. update, understands update progress, Jiu Huiti for the ease of user It is shown for progress bar.In addition, opening some page in user, opening some program, download some resource or handoff scenario When, process is understood for the ease of user, and progress msg can be also provided and shown.
However, what existing progress msg was updated often through conventional message mechanism, that is to say, that by progress msg Message be sent on progress bar, progress bar receive message handle later update operation.There are many disadvantages for this mode Problem, for example, local message can not carry out the synchronization of progress msg between a plurality of users.
As it can be seen that existing progress is updated, there is a problem of can not multi-user synchronization.
Summary of the invention
The embodiment of the present application solves existing by providing a kind of progress update method, device, electronic equipment and medium It can not the synchronous technical problem of multi-user existing for progress update.
In a first aspect, providing a kind of progress update method, comprising:
Barrage distributor obtains the progress barrage message generated by preset barrage messaging protocol, the progress barrage message Including current schedules data;
The barrage distributor is by the progress barrage message distribution to processing controller class predetermined;
The processing controller class is verified after the progress barrage message is legitimate messages, according to the progress barrage message In current schedules data update the value of progress bar view object, to update the progress image currently shown on display unit, Wherein, the progress bar view object is passed in advance in the processing controller class, so that the processing controller class is held There is the adduction relationship of the progress bar view object.
Optionally, the progress barrage message further includes following any one or more: type of message, progress unique identification Symbol, history progress data and check bit information;Wherein, the type of message is described for distinguishing progress message and barrage message For progress unique identifier for object belonging to description progress, the history progress data is the preceding progress data once obtained, The check bit information is MD5 check bit information.
Optionally, the definition method of the processing controller class are as follows: pass through Public Class Processing controller class described in ProgressDataController { } command definition;Wherein, ProgressDataController For the title of the processing controller class, the permission that public characterizes the processing controller class is publicly-owned type, so that described Barrage distributor can hold the processing controller class, and send the processing controller class for the progress barrage message In.
Optionally, the barrage distributor by the progress barrage message distribution to processing controller class predetermined it Afterwards, further includes: the progress barrage message is parsed by the recording controller class by the barrage analytic method of standard The mProgressBean object of ProgressBean type is stored with the progress barrage in the mProgressBean object Content information in message.
Optionally, it is legitimate messages that the processing controller class, which verifies the progress barrage message, including it is following a kind of or A variety of combinations: according to the check bit information, MD5 method of calibration is used to verify whether the progress barrage message disappears to be legal Breath;The history progress data is compared with the history progress data being locally stored, according to comparison result verifying it is described into Spend whether barrage message is legitimate messages;Verify whether the type of message meets the requirements to verify the progress barrage message and be No is legitimate messages;Verify whether the progress unique identifier meets the requirements come whether verify the progress barrage message be conjunction Method message;Wherein, the check bit information, the history progress data, the type of message and the progress unique identifier Obtained from the mProgressBean object by get order.
Optionally, the progress bar view object is passed to the method in the processing controller class in advance are as follows: is locating The progress bar view native object of global page Class Type is defined in reason controller class;The classes of pages is progress bar view Class belonging to figure object;The constructed fuction of the processing controller class is called in the classes of pages belonging to progress bar view object It instantiates the progress data object of the processing controller class, calls set () method in progress data object by the progress View object is transmitted to the processing controller class, and the progress bar view native object is arranged and regards equal to the progress bar Figure object is equal to relationship.
Optionally, the current schedules data according in the progress barrage message update progress bar view object Value, comprising: the current schedules data in the progress barrage message are obtained by get order;It will be described current by set order Progress data, which updates, causes the progress bar view native object, to update the progress bar view pair based on the relationship that is equal to As.
Second aspect provides a kind of progress updating device, comprising:
Barrage distributor, for obtaining the progress barrage message pressing preset barrage messaging protocol and generating, the progress bullet Curtain message includes current schedules data;By the progress barrage message distribution to processing controller class predetermined;
Processing controller is verified after the progress barrage message is legitimate messages for the processing controller class, according to Current schedules data in the progress barrage message update the value of progress bar view object, to update current on display unit The progress image of display, wherein the progress bar view object is passed in advance in the processing controller class, so that described Processing controller class holds the adduction relationship of the progress bar view object.
The third aspect, provides a kind of electronic equipment, including memory, processor and storage on a memory and can handled The computer program run on device, which is characterized in that the processor realizes that first aspect is any described when executing described program Method.
Fourth aspect provides a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that First aspect any method is realized when the program is executed by processor.
One or more technical solutions provided in the embodiments of the present application have at least the following technical effects or advantages:
Method, apparatus, electronic equipment and medium provided by the embodiments of the present application, it is creative updated using barrage into Degree, the progress barrage message that setting progress is generated by barrage messaging protocol are distributed to handle by barrage distributor Processing controller class is realized progress being quickly synchronized to multi-user due to multi-user's synchronization distribution function of barrage distributor. And by the way that progress bar view object is transferred in advance in processing controller class, so that processing controller class holds progress bar view The adduction relationship of object, thus realize processing controller class verifying progress barrage message be legitimate messages after, can be according to progress bullet Current schedules data in curtain message update the value of progress bar view object, technically realize and are carried out by barrage distributor The synchronous progress of multi-user updates.
Detailed description of the invention
To describe the technical solutions in the embodiments of the present invention more clearly, make required in being described below to embodiment Attached drawing is briefly described, it should be apparent that, drawings in the following description are some embodiments of the invention, for this For the those of ordinary skill of field, without creative efforts, it can also be obtained according to these attached drawings others Attached drawing.
Fig. 1 is the flow chart of progress update method in the embodiment of the present application one;
Fig. 2 is the structural schematic diagram of device in the embodiment of the present application two;
Fig. 3 is the structural schematic diagram of electronic equipment in the embodiment of the present application;
Fig. 4 is the structural schematic diagram of computer readable storage medium in the embodiment of the present application.
Specific embodiment
The embodiment of the present application solves existing by providing a kind of progress update method, device, electronic equipment and medium It can not the synchronous technical problem of multi-user existing for progress update.Creative updates progress using barrage, and setting progress is logical The progress barrage message of barrage messaging protocol generation is crossed to handle, and is distributed to processing controller class by barrage distributor, Due to multi-user's synchronization distribution function of barrage distributor, realizes and progress is quickly synchronized to multi-user.And by by progress View object is transferred in advance in processing controller class, so that the reference that processing controller class holds progress bar view object is closed System, thus realize processing controller class verifying progress barrage message be legitimate messages after, can be according to working as in progress barrage message Preceding progress data updates the value of progress bar view object, technically realizes and carries out what multi-user synchronized by barrage distributor Progress updates.
In order to better understand the above technical scheme, in conjunction with appended figures and specific embodiments to upper Technical solution is stated to be described in detail.
Embodiment one
As shown in Figure 1, present embodiments providing a kind of progress update method, comprising:
Step S101, barrage distributor obtain by preset barrage messaging protocol generate progress barrage message, it is described into Spending barrage message includes current schedules data;
Step S102, the barrage distributor is by the progress barrage message distribution to processing controller predetermined Class;
Step S103, the processing controller class are verified after the progress barrage message is legitimate messages, according to it is described into The current schedules data spent in barrage message update the value of progress bar view object, currently show on display unit to update Progress image, wherein the progress bar view object is passed in advance in the processing controller class, so that the processing is controlled Device class processed holds the adduction relationship of the progress bar view object.
In the embodiment of the present application, the method can be applied to smart phone, notebook, desktop computer and tablet computer Etc. clients, also can be applied to server or cloud, this is not restricted.The case where being obtained for progress data from local, The case where all steps of this method are locally implemented in client, obtain for progress data from server, can be by client It end, can also be in server end implementation steps in all steps for locally implementing this method after server acquisition progress data S101~102, after distributing progress barrage information to one or more clients, in each client executing step S103, herein With no restriction.
Progress data in the present embodiment can be safety promotion, interactive interface improves, new function addition or display are outer See improve etc. update progress data, be also possible to user open some page, open some program, download some resource or The progress data of handoff scenario, this is not restricted, also will not enumerate.
In the following, the specific implementation step of progress update method provided by the embodiments of the present application is discussed in detail in conjunction with Fig. 1:
Step S101, barrage distributor obtain by preset barrage messaging protocol generate progress barrage message, it is described into Spending barrage message includes current schedules data.
The present embodiment is the distribution that progress data is carried out using barrage distributor, therefore needs first to design progress bar more It is protocol related between new progress data and barrage distributor, that is, default barrage messaging protocol is needed, in order to subsequent calculating Current schedules data out can generate progress barrage message based on barrage messaging protocol.The barrage messaging protocol is the bullet of standard The protocol format of curtain message.
For the ease of obtaining the relevant information of progress from progress barrage message and guaranteeing the accuracy of message, can be set Progress barrage message further includes following any one or more:
Type of message, progress unique identifier, history progress data and check bit information;Wherein, the type of message is used In distinguishing progress message and barrage message, the progress unique identifier for object belonging to description progress, the history into For degree according to being the preceding progress data once obtained, the check bit information is MD5 check bit information.It is illustrated separately below:
Current schedules data: i.e. current calculated progress data value can be identified with progress.Progress@= 30 indicate that current schedules are 30%.
Type of message: when carrying progress data using the progress barrage message of barrage messaging protocol, in order to avoid it Obscure with common barrage message, type of message is set to distinguish progress message and barrage message.It for example, can be progress Unique type field information is added in barrage message design, and the type is for uniquely indicating that the progress barrage message is a progress The message of update.Type=progress, the subsequent type that message is distinguished according to the field of type can specifically be designed.
Unique identifier: for object belonging to description progress, identify that the progress is specific convenient for server and local side The progress of which event, which module is described, therefore it includes unique identifier that progress barrage message, which can be set,.For example, right Platform is broadcast live, if the progress is a certain progress shown in some live streaming room, which can be used The information in live streaming room is designed, such as is designed as roomId (room number).
History progress data: in order to guarantee that calculating can be set when design schedule barrage message in the accuracy of progress Enter history progress data to verify last progress data, such as the field information of lastProgress can be designed for marking Remember last progress data.
Check bit information: from security consideration, progress barrage message is distributed in transmission process in order to prevent is distorted, can To be added to the check bit information of a md5 in progress barrage message, it can guarantee the integrality of progress barrage message in this way.
Assuming that above-mentioned all information are added, provide the final progress barrage generated according to barrage messaging protocol of setting and disappear Breath, as follows:
{ type@=progress/roomId@=10202/progress@=30/lastProgress@=25/md5= 22d3e2d/}
Wherein, it is split with "/" between each information;It is defined by@=symbol ,@=symbol left side is agreement Key information, the right are agreement value informations.It is above-mentioned provide be only a message example, be not to limit the format of message and interior Hold.
Step S102, the barrage distributor is by the progress barrage message distribution to processing controller predetermined Class.
Barrage distributor can be the software module on server, or the software module in client, it can be with It is independent barrage the distribution server, this is not restricted.
It, can be according to unique identifier and information type by progress barrage after barrage distributor gets progress barrage message Message distribution is specifically distributed in the processing controller class in each client to relevant each client.
The processing controller class be it is predetermined, be specifically defined method be by Public Class Processing controller class described in ProgressDataController { } command definition;Wherein, ProgressDataController For the title of the processing controller class, the permission that public characterizes the processing controller class is publicly-owned type, so that described Barrage distributor can hold the processing controller class, and send the processing controller class for the progress barrage message In.
Step S103, the processing controller class are verified after the progress barrage message is legitimate messages, according to it is described into The current schedules data spent in barrage message update the value of progress bar view object, currently show on display unit to update Progress image, wherein the progress bar view object is passed in advance in the processing controller class, so that the processing is controlled Device class processed holds the adduction relationship of the progress bar view object.
After processing controller class receives the progress barrage message of barrage distributor distribution, pass through the bullet of standard first The progress barrage message is parsed into the mProgressBean object of ProgressBean type by curtain analytic method, described The content field information being stored in mProgressBean object in the progress barrage message.In mProgressBean object Each content field information of the progress barrage message of storage has a corresponding getXXX to come from mProgressBean pairs As the acquisition of middle calling, also there is a corresponding setXXX method that write-in is set in mProgressBean object.Consequently facilitating Judge whether the progress barrage message is legitimate messages, is also convenient for the extraction and write-in of data.
In the embodiment of the present application, it is legitimate messages that the processing controller class, which verifies the progress barrage message, can be with Combination including one or more of.When only following verifying can be arranged is legal, progress barrage message is just thought For legitimate messages, when also can be set a few in following verifying or one and being verified as legal, it is believed that progress barrage message is Legitimate messages:
According to the check bit information, MD5 method of calibration is used whether to verify the progress barrage message for legitimate messages;
The history progress data is compared with the history progress data being locally stored, institute is verified according to comparison result State whether progress barrage message is legitimate messages;
Verify whether the type of message meets the requirements come whether verify the progress barrage message be legitimate messages;
Verify whether the progress unique identifier meets the requirements to verify whether the progress barrage message is legal disappear Breath;
Wherein, the check bit information, the history progress data, the type of message and the progress unique identifier Obtained from the mProgressBean object by get order.
For example, when only above-mentioned verifying is legal with setting, just think that progress barrage message is that legitimate messages are Example:
Firstly, obtaining MD5 by calling mProgressBean.getMd5 () method in mProgressBean object Check information.Then barrage information is verified by the MD5 method of calibration of standard, if it find that verification result and obtain The value of the MD5 taken is identical, it is believed that the message is legal, just can be carried out subsequent processing operation, otherwise it is assumed that the message is illegal, Directly discard message, operation without any processing.
Then, if MD5 verification passes through, mProgressBean.getLastProgress () method is called to obtain History progress data, and the value of the value that will acquire and the history progress data localLastProgress being locally stored carry out pair Than, if it find that it is identical, think that this progress msg is effective.Otherwise, it is also necessary to judge localLastProgress= Whether=0 is true, if being equal to 0 explanation is the barrage progress message sent for the first time, also thinks that the barrage message is that have at this time Effect, be otherwise exactly an invalid message.It needs to terminate entire process flow by returning if it is invalid message.It needs Bright, localLastProgress field is to be previously defined in processing controller class, i.e. ProgressDataController In class, specific definition method is setting private int localLastProgress=0, which mainly uses In the last progress msg of storage, initial value 0.
If history progress data is verified, the value information of localLastProgress is updated, specific update side Method is localLastProgress=mProgressBean.getProgress () method by current latest news assignment For localLastProgress, use when thus can be convenient comparison localLastProgress next time.
Next, by way of string matching come verification message type type and unique identifier roomId whether It is legal, come particular by calling TextUtils.equals (roomId, mProgressBean.getRoomId ()) method Room number information is verified, similarly by similar mode come the information of verification message type.If there is any one is illegal Just directly returning terminates entire process flow, otherwise continues with subsequent update step.
Certainly, in the specific implementation process, processing controller class verifying progress barrage message whether be legitimate messages side Method is not limited to the above-mentioned example enumerated, and can according to need setting, this is not restricted.
The processing controller class is verified after the progress barrage message is legitimate messages, further according in progress barrage message Current schedules data update progress bar view object value.The value of progress bar view object determines to be shown on display unit The display state of progress image.The progress image can be strip progress image, can be numeric type progress image, is also possible to Circular ring type progress image etc., this is not restricted.For example, the value of progress bar view object is 35, then can be shown on display unit Show 35% progress value, or there is 35% region to be the strip of dark color, or have 35% area for dark annulus.
In the present embodiment, in order to enable processing controller class can update progress bar view object, processing can first be allowed Controller class is held mutually with progress bar view object, and specific practice is that progress bar view object is transferred to processing control in advance In device class, so that the processing controller class holds the adduction relationship of the progress bar view object.
Specifically, the first example in two classes dissolves the object of other side's class, needs to define in processing controller class complete The progress bar view native object of office;And the processing controller class is called in the classes of pages belonging to progress bar view object Constructed fuction instantiates the progress data object of the processing controller class, calls set () method in progress data object The progress bar view object is transmitted to the processing controller class, and the progress bar view native object is set equal to institute That states progress bar view object is equal to relationship.
For example, in processing controller class, i.e. this side of ProgressDataController class: first definition is complete wherein The progress bar view native object of the ProgressBar class of office, i.e. localProgressBarView object.With convenient Other functions in ProgressDataController class by localProgressBarView object carry out operation and Processing.
In progress bar view object, i.e. this side of mProgressBar object: the classes of pages where progress bar view object In by calling the constructed fuction of ProgressDataController class to instantiate ProgressDataController class The progress data object of type, i.e. mProgressDataController object.Then it calls SetProgressBar (mProgressBar) method in mProgressDataController object is by progress bar view pair As that is, mProgressBar object is transmitted in ProgressDataController class.
By the processing to ProgressDataController class and classes of pages two sides, realize processing controller class with Progress bar view object is held mutually.Again and the progress bar view native object is set equal to the progress bar view object Equal to relationship, consequently facilitating the access of subsequent ProgressDataController class updates the value of progress bar view object.Specifically Setting method uses setProgressBar function in ProgressDataController class, passes through calling The value of mProgressBar object is converted to global access by the method for localProgressBarView=mProgressBar The value of the variable localProgressBarView object of permission, so that subsequent can be by updating localProgressBarView Object is realized and updates mProgressBar object.
After completing the above-mentioned setting to ProgressDataController class and classes of pages two sides, if processing control Device class receives the progress barrage message of the barrage distributor distribution by step S102, then can pass through get order The current schedules data (targetProgress) in the progress barrage message are obtained, then by set order, such as passes through tune The current schedules data are updated with localProgressBarView.setProgress (targetProgress) order Local (localProgressBarView) object of the progress bar view is caused, thus based on setting The relationship of localProgressBarView=mProgressBar updates the progress bar view to reach (mProgressBar) purpose of object.To update current schedules data onto progress bar view object, thus complete The update of progress bar view.
Specifically, progress is updated using barrage by creative, setting progress is generated by barrage messaging protocol Progress barrage message handle, and processing controller class is distributed to by barrage distributor, it is more due to barrage distributor User's synchronization distribution function is realized progress being quickly synchronized to multi-user.And by the way that progress bar view object is transmitted in advance Into processing controller class, so that processing controller class holds the adduction relationship of progress bar view object, to realize processing control Device class processed verifies progress barrage message as that can update progress according to the current schedules data in progress barrage message after legitimate messages The value of view object technically realizes and carries out the synchronous progress of multi-user by barrage distributor and update.
Further, it is contemplated that the adduction relationship of processing controller class and progress bar view object is mutually locked in aforementioned schemes The relationship of some bidirectional dependencies, coupled relation is more complicated, and the subsequent maintainability of program that will lead to is lower, can not facilitate program Maintenance and expansion.Once modification first, other relevant information is likely to influence other side, in this way can make subsequent exploitation At unnecessary maintenance cost.
Therefore in another embodiment, it is legitimate messages that the processing controller class, which verifies the progress barrage message, Afterwards, in order to enable processing controller class can update progress bar view object, and in the update not direct coupling of progress bar view object It closes, the relatively independent update of energy and maintenance can define communication protocol function as processing controller class and progress bar view pair The communication association bridge of elephant.Specific practice is to define communication protocol, and the communication protocol includes the communication protocol function, described Communication protocol function includes the function parameter of update progress;In the classes of pages belonging to the progress bar view object described in manifolding Communication protocol function to generate manifolding protocol function, and inherits the communication protocol by the manifolding protocol function, establishes Inheritance;By the communication protocol function passes to the processing controller class, hold the processing controller class described Communication protocol function or its adduction relationship.
For example, communication protocol title can be defined as ControllerToBar, and ControllerToBar is assisted Communication protocol function onProgressUpdate is contained in view, which is in processing controller class The agreement letter communicated between (ProgressDataController class) and progress bar view object (ProgressBar class) Number.Function parameter progress parameter in the communication protocol function is used for the update of progress msg.Certainly, in the present embodiment Function/class/object title is served only for illustrating, with no restriction.
After defining communication protocol, communication protocol described in page Similar integral belonging to the progress bar view object is set. The communication protocol function can be specifically made carbon copies in the classes of pages, to generate manifolding protocol function, and pass through the manifolding Protocol function inherits the communication protocol, establishes inheritance.For example, implements can be passed through ControllerToBar order is arranged the page Similar integral communication protocol, that is, passes through public void OnProgressUpdate (int progress) method makes carbon copies the communication protocol function in communication protocol, generates manifolding agreement letter Number, subsequent progress bar view object can obtain new progress data progress progress update generating in manifolding protocol function.
And make carbon copies protocol function and inherit the communication protocol, therefore after communication protocol function is updated, it can will update number Value is inherited to the manifolding protocol function.Therefore the application has also set up the pass of the coupling between communication protocol and processing controller class System controls the processing hold processing controller by the communication protocol function passes to the processing controller class Device class holds the communication protocol function or its adduction relationship, to indirectly couple with progress bar view object.
In the embodiment of the present application, by the communication protocol function passes to the method for the processing controller class are as follows: The communication protocol native object of the type of the global classes of pages is defined in processing controller class, and in the communication protocol Register method is called to transmit communication protocol function, the communication protocol function enters to join parameter assignment to the communication protocol Native object, the communication protocol function and the communication protocol native object establish the relationship of being equal to.
For example, in this side communication protocol ControllerToBar: by calling ProgressDataController Register ((ControllerToBar) this) in class gives communication protocol function passes ProgressDataController class.This object is transmitted when calling register method.What this object represented Progress bar view object, since progress bar view object inherits communication protocol, it is therefore desirable to by the type of this object into Row unsteady state operation is converted into communication protocol type, and is transmitted in register function.Wherein, register function is to belong to The function of processing controller class, definition command are as follows: public void register (ControllerToBar iControllerToBar){}.The order is the publicly-owned type of public, and return value is void type, and function name is Register, including enter parameter iControllerToBar, entering to join parameter type is customized communication protocol (ControllerToBar) parameter of type, until equal with the value of communication protocol function.
In this side of processing controller class, need to define global communication protocol inside processing controller The variable communication agreement native object (localControllerToBar) of ControllerToBar type, in register letter It carries out sentencing sky to entering parameter first by way of calling iControllerToBar==null during several realizations Processing just ends processing process if it is sky, otherwise just passes through localControllerToBar=iControllerToBar Method will enter to join parameter information and be assigned in global communication protocol native object localControllerToBar, logical in this way Letter agreement native object localControllerToBar has just been directed to the pointer of communication protocol function in fact.
After completing the above-mentioned setting to ProgressDataController class and communication protocol two sides, if processing control Device class processed receives the progress barrage message of the barrage distributor distribution by step S102, then can be ordered by get Enable the current schedules data (targetProgress) obtained in the progress barrage message;Again by set order, such as pass through It calls localControllerToBar.setonProgressUpdate (targetProgress) order described will work as to advance Degree is according to the cause communication protocol native object localControllerToBar is updated, to update institute based on the relationship that is equal to Communication protocol function is stated, and then the manifolding protocol function is updated based on the inheritance, is assisted to update with the manifolding View function belongs to the value of the progress bar view object of the classes of pages, and this completes the updates of progress bar view.
Specifically, it is transmitted between progress bar view object and processing controller class by setting communication protocol function Progress data, thus realize processing controller class verifying progress barrage message be legitimate messages after, can be according to progress barrage message In current schedules data update progress bar view object value, technically realize by barrage distributor carry out multi-user Synchronous progress updates.Also avoid follow-up maintenance caused by direct-coupling between processing controller class and progress bar view object With the difficulty of extension, is coupled by way of agreement, can thus be dropped than the degree of direct-coupling relationship between the two Low, logic function is independent from each other, and can greatly be improved maintainability and scalability of code etc., be reduced follow-up maintenance Cost.
Based on the same inventive concept, this application provides the corresponding Installation practice of embodiment one, detailed in Example two.
Embodiment two
The present embodiment provides a kind of progress updating devices, as described in Figure 2, comprising:
Barrage distributor 201, for obtaining the progress barrage message pressing preset barrage messaging protocol and generating, the progress Barrage message includes current schedules data;By the progress barrage message distribution to processing controller class predetermined;
Processing controller 202, verifying the progress barrage message for the processing controller class is root after legitimate messages The value of progress bar view object is updated according to the current schedules data in the progress barrage message, is taken in update display unit The progress image of preceding display, wherein the progress bar view object is passed in advance in the processing controller class, so that institute State the adduction relationship that processing controller class holds the progress bar view object.
Since the device that the present embodiment is introduced is device used by method in implementation the embodiment of the present application one, so base The method described in the embodiment of the present application one, those skilled in the art can understand the specific of the device of the present embodiment Embodiment and its various change form, so how to realize the method in the embodiment of the present application no longer for the device at this It is discussed in detail.As long as those skilled in the art implement equipment used by the method in the embodiment of the present application, this is belonged to Apply for the range to be protected.
Based on the same inventive concept, this application provides the corresponding apparatus embodiments of embodiment one, detailed in Example three.
Embodiment three
The present embodiment provides a kind of electronic equipment, as shown in figure 3, including memory 310, processor 320 and being stored in On reservoir 310 and the computer program 311 that can run on the processor 320, processor 320 execute real when computer program 311 It is existing:
Barrage distributor obtains the progress barrage message generated by preset barrage messaging protocol, the progress barrage message Including current schedules data;
The barrage distributor is by the progress barrage message distribution to processing controller class predetermined;
The processing controller class is verified after the progress barrage message is legitimate messages, according to the progress barrage message In current schedules data update the value of progress bar view object, to update the progress image currently shown on display unit, Wherein, the progress bar view object is passed in advance in the processing controller class, so that the processing controller class is held There is the adduction relationship of the progress bar view object.
Since the electronic equipment that the present embodiment is introduced is equipment used by method in implementation the embodiment of the present application one, therefore And based on method described in the embodiment of the present application one, the electronics that those skilled in the art can understand the present embodiment is set Standby specific embodiment and its various change form, so how to realize the embodiment of the present application for the electronic equipment herein In method be no longer discussed in detail.As long as those skilled in the art implement to set used by the method in the embodiment of the present application It is standby, belong to the range to be protected of the application.
Based on the same inventive concept, this application provides the corresponding storage medium of embodiment one, detailed in Example four.
Example IV
The present embodiment provides a kind of computer readable storage mediums 400, as shown in figure 4, being stored thereon with computer program 411, realization when which is executed by processor:
Barrage distributor obtains the progress barrage message generated by preset barrage messaging protocol, the progress barrage message Including current schedules data;
The barrage distributor is by the progress barrage message distribution to processing controller class predetermined;
The processing controller class is verified after the progress barrage message is legitimate messages, according to the progress barrage message In current schedules data update the value of progress bar view object, to update the progress image currently shown on display unit, Wherein, the progress bar view object is passed in advance in the processing controller class, so that the processing controller class is held There is the adduction relationship of the progress bar view object.
In the specific implementation process, it when which is executed by processor, may be implemented any in embodiment one Embodiment.
It should be understood by those skilled in the art that, the embodiment of the present invention can provide as method, system or computer program Product.Therefore, complete hardware embodiment, complete software embodiment or reality combining software and hardware aspects can be used in the present invention Apply the form of example.Moreover, it wherein includes the computer of computer usable program code that the present invention, which can be used in one or more, The computer program implemented in usable storage medium (including but not limited to magnetic disk storage, CD-ROM, optical memory etc.) produces The form of product.
The present invention be referring to according to the method for the embodiment of the present invention, the process of equipment (system) and computer program product Figure and/or block diagram describe.It should be understood that every one stream in flowchart and/or the block diagram can be realized by computer program instructions The combination of process and/or box in journey and/or box and flowchart and/or the block diagram.It can provide these computer programs Instruct the processor of general purpose computer, special purpose computer, Embedded Processor or other programmable data processing devices to produce A raw machine, so that being generated by the instruction that computer or the processor of other programmable data processing devices execute for real The device for the function of being specified in present one or more flows of the flowchart and/or one or more blocks of the block diagram.
These computer program instructions, which may also be stored in, is able to guide computer or other programmable data processing devices with spy Determine in the computer-readable memory that mode works, so that it includes referring to that instruction stored in the computer readable memory, which generates, Enable the manufacture of device, the command device realize in one box of one or more flows of the flowchart and/or block diagram or The function of being specified in multiple boxes.
These computer program instructions also can be loaded onto a computer or other programmable data processing device, so that counting Series of operation steps are executed on calculation machine or other programmable devices to generate computer implemented processing, thus in computer or The instruction executed on other programmable devices is provided for realizing in one or more flows of the flowchart and/or block diagram one The step of function of being specified in a box or multiple boxes.
Although preferred embodiments of the present invention have been described, it is created once a person skilled in the art knows basic Property concept, then additional changes and modifications may be made to these embodiments.So it includes excellent that the following claims are intended to be interpreted as It selects embodiment and falls into all change and modification of the scope of the invention.
Obviously, various changes and modifications can be made to the invention without departing from essence of the invention by those skilled in the art Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies Within, then the present invention is also intended to include these modifications and variations.

Claims (10)

1. a kind of progress update method characterized by comprising
Barrage distributor obtains the progress barrage message generated by preset barrage messaging protocol, and the progress barrage message includes Current schedules data;
The barrage distributor is by the progress barrage message distribution to processing controller class predetermined;
The processing controller class is verified after the progress barrage message is legitimate messages, according in the progress barrage message Current schedules data update the value of progress bar view object, to update the progress image currently shown on display unit, wherein The progress bar view object is passed in advance in the processing controller class so that the processing controller class hold it is described The adduction relationship of progress bar view object.
2. the method as described in claim 1, which is characterized in that the progress barrage message further includes following any or more Kind:
Type of message, progress unique identifier, history progress data and check bit information;
Wherein, the type of message is for distinguishing progress message and barrage message, the progress unique identifier for describe into Object belonging to degree, the history progress data are the preceding progress data once obtained, and the check bit information is MD5 check bit Information.
3. the method as described in claim 1, which is characterized in that the definition method of the processing controller class are as follows:
Pass through processing controller class described in Public Class ProgressDataController { } command definition;
Wherein, ProgressDataController is the title of the processing controller class, and public characterizes the processing control The permission of device class processed is publicly-owned type, so that the barrage distributor can hold the processing controller class, and by the progress Barrage message is sent in the processing controller class.
4. the method as described in claim 1, which is characterized in that the barrage distributor by the progress barrage message distribution extremely After processing controller class predetermined, further includes:
The progress barrage message is parsed by the recording controller class by the barrage analytic method of standard The mProgressBean object of ProgressBean type is stored with the progress barrage in the mProgressBean object Content information in message.
5. method as claimed in claim 4, which is characterized in that the processing controller class verifies the progress barrage message and is Legitimate messages, the combination including one or more of:
According to the check bit information, MD5 method of calibration is used whether to verify the progress barrage message for legitimate messages;
The history progress data is compared with the history progress data being locally stored, according to comparison result verifying it is described into Spend whether barrage message is legitimate messages;
Verify whether the type of message meets the requirements come whether verify the progress barrage message be legitimate messages;
Verify whether the progress unique identifier meets the requirements come whether verify the progress barrage message be legitimate messages;
Wherein, the check bit information, the history progress data, the type of message and the progress unique identifier are logical Get order is crossed to obtain from the mProgressBean object.
6. the method as described in claim 1, which is characterized in that the progress bar view object is passed to the processing in advance Method in controller class are as follows:
The progress bar view native object of global page Class Type is defined in processing controller class;The classes of pages is described Class belonging to progress bar view object;
It is described to instantiate that the constructed fuction of the processing controller class is called in the classes of pages belonging to progress bar view object The progress data object of processing controller class calls set () method in progress data object by the progress bar view object Be transmitted to the processing controller class, and be arranged the progress bar view native object equal to the progress bar view object etc. In relationship.
7. method as claimed in claim 6, which is characterized in that the current schedules number according in the progress barrage message According to the value for updating progress bar view object, comprising:
The current schedules data in the progress barrage message are obtained by get order;
The current schedules data are updated by set order and cause the progress bar view native object, thus based on described etc. The progress bar view object is updated in relationship.
8. a kind of progress updating device characterized by comprising
Barrage distributor, for obtaining the progress barrage message pressing preset barrage messaging protocol and generating, the progress barrage disappears Breath includes current schedules data;By the progress barrage message distribution to processing controller class predetermined;
Processing controller is verified after the progress barrage message is legitimate messages for the processing controller class, according to described Current schedules data in progress barrage message update the value of progress bar view object, currently show on display unit to update Progress image, wherein the progress bar view object is passed in advance in the processing controller class, so that the processing Controller class holds the adduction relationship of the progress bar view object.
9. a kind of electronic equipment including memory, processor and stores the calculating that can be run on a memory and on a processor Machine program, which is characterized in that the processor realizes claim 1-6 any method when executing described program.
10. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the program is by processor Claim 1-6 any method is realized when execution.
CN201811641257.XA 2018-12-29 2018-12-29 Progress updating method and device, electronic equipment and medium Active CN109698973B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811641257.XA CN109698973B (en) 2018-12-29 2018-12-29 Progress updating method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811641257.XA CN109698973B (en) 2018-12-29 2018-12-29 Progress updating method and device, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN109698973A true CN109698973A (en) 2019-04-30
CN109698973B CN109698973B (en) 2021-01-01

Family

ID=66232411

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811641257.XA Active CN109698973B (en) 2018-12-29 2018-12-29 Progress updating method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN109698973B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112764785A (en) * 2020-12-24 2021-05-07 江苏云涌电子科技股份有限公司 Method for automatically upgrading multi-stage controller

Citations (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090158154A1 (en) * 2007-12-14 2009-06-18 Lg Electronics Inc. Mobile terminal and method of playing data therein
WO2010109057A1 (en) * 2009-03-27 2010-09-30 Nokia Corporation Method and apparatus for providing comments during content rendering
CN104618785A (en) * 2014-04-16 2015-05-13 腾讯科技(北京)有限公司 Audio and video playing method, device and system
CN104869468A (en) * 2015-04-22 2015-08-26 腾讯科技(北京)有限公司 Method and apparatus for displaying screen information
CN105430440A (en) * 2014-09-04 2016-03-23 腾讯科技(深圳)有限公司 Multimedia information playing degree-of-interest processing method, serve and client
CN105812889A (en) * 2016-03-31 2016-07-27 北京奇艺世纪科技有限公司 Method and system for displaying playing progress bar
CN105828171A (en) * 2016-03-14 2016-08-03 乐视网信息技术(北京)股份有限公司 Intelligent interconnection method and intelligent terminal
CN105979337A (en) * 2015-12-28 2016-09-28 武汉斗鱼网络科技有限公司 Video comment playing device and method
CN105979388A (en) * 2015-12-02 2016-09-28 乐视网信息技术(北京)股份有限公司 Video review publishing method and system
CN106303745A (en) * 2016-08-16 2017-01-04 腾讯科技(深圳)有限公司 The treating method and apparatus of barrage
CN106507202A (en) * 2016-11-11 2017-03-15 传线网络科技(上海)有限公司 Control method for playing back and device
CN106658213A (en) * 2016-10-19 2017-05-10 上海幻电信息科技有限公司 Play progress intercommunicated communication processing method
US20170251240A1 (en) * 2015-01-20 2017-08-31 Tencent Technology (Shenzhen) Company Limited Bullet screen information processing method, client, service platform and storage medium
CN107690078A (en) * 2017-09-28 2018-02-13 腾讯科技(深圳)有限公司 Barrage method for information display, provide method and equipment
CN107707967A (en) * 2017-09-30 2018-02-16 咪咕视讯科技有限公司 The determination method, apparatus and computer-readable recording medium of a kind of video file front cover
CN107911733A (en) * 2017-11-08 2018-04-13 北京潘达互娱科技有限公司 Message treatment method and device
CN108200457A (en) * 2018-01-19 2018-06-22 深圳市沃特沃德股份有限公司 The method and playback equipment that multiple playback equipments are played simultaneously
US20180255348A1 (en) * 2014-12-23 2018-09-06 Rovi Guides, Inc. Methods and systems for presenting information about multiple media assets
CN108540829A (en) * 2018-04-12 2018-09-14 青岛海信电器股份有限公司 A kind of more playback equipment synchronous broadcast methods, system and terminal
CN108769819A (en) * 2018-06-20 2018-11-06 网易(杭州)网络有限公司 Playing progress rate control method, medium, device and computing device

Patent Citations (20)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090158154A1 (en) * 2007-12-14 2009-06-18 Lg Electronics Inc. Mobile terminal and method of playing data therein
WO2010109057A1 (en) * 2009-03-27 2010-09-30 Nokia Corporation Method and apparatus for providing comments during content rendering
CN104618785A (en) * 2014-04-16 2015-05-13 腾讯科技(北京)有限公司 Audio and video playing method, device and system
CN105430440A (en) * 2014-09-04 2016-03-23 腾讯科技(深圳)有限公司 Multimedia information playing degree-of-interest processing method, serve and client
US20180255348A1 (en) * 2014-12-23 2018-09-06 Rovi Guides, Inc. Methods and systems for presenting information about multiple media assets
US20170251240A1 (en) * 2015-01-20 2017-08-31 Tencent Technology (Shenzhen) Company Limited Bullet screen information processing method, client, service platform and storage medium
CN104869468A (en) * 2015-04-22 2015-08-26 腾讯科技(北京)有限公司 Method and apparatus for displaying screen information
CN105979388A (en) * 2015-12-02 2016-09-28 乐视网信息技术(北京)股份有限公司 Video review publishing method and system
CN105979337A (en) * 2015-12-28 2016-09-28 武汉斗鱼网络科技有限公司 Video comment playing device and method
CN105828171A (en) * 2016-03-14 2016-08-03 乐视网信息技术(北京)股份有限公司 Intelligent interconnection method and intelligent terminal
CN105812889A (en) * 2016-03-31 2016-07-27 北京奇艺世纪科技有限公司 Method and system for displaying playing progress bar
CN106303745A (en) * 2016-08-16 2017-01-04 腾讯科技(深圳)有限公司 The treating method and apparatus of barrage
CN106658213A (en) * 2016-10-19 2017-05-10 上海幻电信息科技有限公司 Play progress intercommunicated communication processing method
CN106507202A (en) * 2016-11-11 2017-03-15 传线网络科技(上海)有限公司 Control method for playing back and device
CN107690078A (en) * 2017-09-28 2018-02-13 腾讯科技(深圳)有限公司 Barrage method for information display, provide method and equipment
CN107707967A (en) * 2017-09-30 2018-02-16 咪咕视讯科技有限公司 The determination method, apparatus and computer-readable recording medium of a kind of video file front cover
CN107911733A (en) * 2017-11-08 2018-04-13 北京潘达互娱科技有限公司 Message treatment method and device
CN108200457A (en) * 2018-01-19 2018-06-22 深圳市沃特沃德股份有限公司 The method and playback equipment that multiple playback equipments are played simultaneously
CN108540829A (en) * 2018-04-12 2018-09-14 青岛海信电器股份有限公司 A kind of more playback equipment synchronous broadcast methods, system and terminal
CN108769819A (en) * 2018-06-20 2018-11-06 网易(杭州)网络有限公司 Playing progress rate control method, medium, device and computing device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112764785A (en) * 2020-12-24 2021-05-07 江苏云涌电子科技股份有限公司 Method for automatically upgrading multi-stage controller

Also Published As

Publication number Publication date
CN109698973B (en) 2021-01-01

Similar Documents

Publication Publication Date Title
CN105122931B (en) Electronic equipment and the method that personal cloud device is registered in its portal user server
CN106682028B (en) Method, device and system for acquiring webpage application
US20120326847A1 (en) Secure tag management method and system
CN108259413B (en) Method for obtaining certificate and authenticating and network equipment
CN106164917B (en) User's specific application for remote session activates
EP4216077A1 (en) Blockchain network-based method and apparatus for data processing, and computer device
US20210089673A1 (en) Information processing apparatus, information processing method, and program
CN111310233B (en) Application interface display method, device, equipment and storage medium
CN112995357B (en) Domain name management method, device, medium and electronic equipment based on cloud hosting service
CN110808839B (en) Processing method, device, equipment and medium for block chain abnormal data
CN106790727A (en) Information push method and device
CN111355723A (en) Single sign-on method, device, equipment and readable storage medium
CN105871695A (en) Emoji sending method and device
CN104135674B (en) The acquisition of OSD subject documents, providing method, device and more new system
WO2019095388A1 (en) Remotely-assisted processing method and device
CN109698974A (en) A kind of method, apparatus, electronic equipment and the medium of display progress
US20180159899A1 (en) User interface for low-touch security policy provisioning
CN109698973A (en) A kind of progress update method, device, electronic equipment and medium
CN115955362B (en) Block chain-based data storage and communication method, device, equipment and medium
CN107273102A (en) The generation method and device of mobile applications
JPWO2018211834A1 (en) Information processing apparatus and information processing method
CN110941412B (en) Method, system and terminal for realizing multi-terminal animation collaborative browsing based on pictures
CN102005001A (en) Login method, device and system of internet bank
KR20210027011A (en) Peer node, method for processing information executed on peer node and blockchain platform system
WO2018205941A1 (en) Information processing method, apparatus and system

Legal Events

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