CN109698974A - A kind of method, apparatus, electronic equipment and the medium of display progress - Google Patents

A kind of method, apparatus, electronic equipment and the medium of display progress Download PDF

Info

Publication number
CN109698974A
CN109698974A CN201811646179.2A CN201811646179A CN109698974A CN 109698974 A CN109698974 A CN 109698974A CN 201811646179 A CN201811646179 A CN 201811646179A CN 109698974 A CN109698974 A CN 109698974A
Authority
CN
China
Prior art keywords
progress
barrage
communication protocol
message
processing controller
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
CN201811646179.2A
Other languages
Chinese (zh)
Other versions
CN109698974B (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 CN201811646179.2A priority Critical patent/CN109698974B/en
Publication of CN109698974A publication Critical patent/CN109698974A/en
Application granted granted Critical
Publication of CN109698974B publication Critical patent/CN109698974B/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/451Execution arrangements for user interfaces
    • 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

Abstract

The invention discloses method, apparatus, electronic equipment and the media of a kind of display progress, 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 verifies the progress barrage message as after legitimate messages, pass through progress barrage message described in communication protocol function transfer predetermined to update progress bar view object, to update the value of the progress bar view object according to the current schedules data, to update the progress image currently shown on display unit, wherein, the progress bar view object is communicated with the processing controller class by the communication protocol function.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 method, apparatus, electronic equipment and the medium of display progress
Technical field
The present invention relates to Internet technical field more particularly to a kind of method, apparatus, electronic equipment and the Jie of display progress 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 method, apparatus, electronic equipment and the medium of a kind of display progress Progress update existing for can not the synchronous technical problem of multi-user.
In a first aspect, providing a kind of method of display progress, 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 verifies the progress barrage message to pass through communication protocols predetermined after legitimate messages Progress barrage message described in function transfer is discussed to update progress bar view object, according to 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 pair As being communicated with the processing controller class by the communication protocol function.
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, 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;It is legitimate messages that the processing controller class, which verifies the progress barrage message, Combination including one or more of: according to the check bit information, the progress barrage is verified using MD5 method of calibration and is disappeared Whether breath is legitimate messages;The history progress data is compared with the history progress data being locally stored, according to comparison Whether progress barrage message described in result verification is legitimate messages;Verify the type of message whether meet the requirements it is described to verify Whether progress barrage message is legitimate messages;Verify whether the progress unique identifier meets the requirements to verify the progress bullet Whether curtain message is legitimate messages;Wherein, the check bit information, the history progress data, the type of message and described Progress unique identifier is obtained from the mProgressBean object by get order.
Optionally, the definition method of the communication protocol function are as follows: define communication protocol, the communication protocol includes described Communication protocol function, the communication protocol function include the function parameter of update progress;Belonging to the progress bar view object Classes of pages in make carbon copies the communication protocol function, to generate manifolding protocol function, and by the manifolding protocol function come after The communication protocol is held, inheritance is established;By the communication protocol function passes to the processing controller class, make the place Reason controller class holds the communication protocol function.
Optionally, described by the communication protocol function passes to the processing controller class, comprising: in processing controller The communication protocol native object of the global page Class Type is defined in class;The side register is called in the communication protocol Method transmits communication protocol function, and the communication protocol function enters to join parameter assignment to the communication protocol native object, described Communication protocol function and the communication protocol native object establish the relationship of being equal to.
Optionally, it is described by progress barrage message described in communication protocol function transfer predetermined to updating progress bar View object, to update the value of the progress bar view object according to the current schedules data, comprising: obtained by get order Take the current schedules data in the progress barrage message;The current schedules data are updated by set order and cause described lead to Agreement native object is believed, to update the communication protocol function based on the relationship that is equal to, and then more based on the inheritance The new manifolding protocol function, to update the progress bar view for belonging to the classes of pages with the manifolding protocol function The value of object.
Second aspect provides a kind of device of display progress, comprising:
Barrage distributor obtains the progress barrage message generated by preset barrage messaging protocol for barrage distributor, The progress barrage message includes current schedules data;By the progress barrage message distribution to processing controller predetermined Class;
Processing controller verifies the progress barrage message for the processing controller class to pass through after legitimate messages Progress barrage message described in communication protocol function transfer predetermined is to progress bar view object is updated, according to described current Progress data updates the value of the progress bar view object, to update the progress image currently shown on display unit, wherein The progress bar view object is communicated with the processing controller class by the communication protocol function;
Communication protocol module, for defining the communication protocol function.
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 the progress data between progress bar view object and processing controller class is transmitted by setting communication protocol function, thus real It, can be according to the current schedules data in progress barrage message after existing processing controller class verifying progress barrage message is legitimate messages The value for updating progress bar view object technically realizes and carries out the synchronous progress update of multi-user by barrage distributor. Also than avoiding the difficulty of follow-up maintenance caused by direct-coupling and extension between processing controller class and progress bar view object, Reduce follow-up maintenance cost.
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 that the method for progress is shown 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 400 in the embodiment of the present application.
Specific embodiment
The embodiment of the present application solves existing by providing method, apparatus, electronic equipment and the medium of a kind of display progress Progress update existing for can not the synchronous technical problem of multi-user.Creative updates progress using barrage, and progress is arranged The progress barrage message generated by barrage messaging protocol is distributed to processing controller by barrage distributor to handle Class is realized progress being quickly synchronized to multi-user due to multi-user's synchronization distribution function of barrage distributor.And pass through setting Communication protocol function transmits the progress data between progress bar view object and processing controller class, to realize processing control Device class verifies progress barrage message as that can update progress bar 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 update of multi-user by barrage distributor.Also than avoiding The difficulty of follow-up maintenance caused by direct-coupling and extension between processing controller class and progress bar view object, reduces subsequent dimension Protect cost.
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, a kind of method for present embodiments providing display progress, 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 is verified after the progress barrage message is legitimate messages, by fixed in advance Progress barrage message described in the communication protocol function transfer of justice is to progress bar view object is updated, according to the current schedules number According to the value for updating the progress bar view object, to update the progress image currently shown on display unit, wherein it is described into Degree view object is communicated with the processing controller class by the communication protocol function.
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~S102, 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 display progress 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 barrage distributor is the barrage generated by the constructed fuction of barrage distributor Distributor object.
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 is verified after the progress barrage message is legitimate messages, by fixed in advance Progress barrage message described in the communication protocol function transfer of justice is to progress bar view object is updated, according to the current schedules number According to the value for updating the progress bar view object, to update the progress image currently shown on display unit, wherein it is described into Degree view object is communicated with the processing controller class by the communication protocol function.
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;
By verifying whether the type of message meets the requirements come whether verify the progress barrage message be legitimate messages;
By verifying 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.
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, and in update progress View object not direct-coupling, can relatively independent update and maintenance, communication protocol function can be defined as processing control The communication association bridge of device class and progress bar view object.Specific practice is to define communication protocol, and the communication protocol includes institute Communication protocol function is stated, the communication protocol function includes the function parameter of update progress;In the progress bar view object institute The communication protocol function is made carbon copies in the classes of pages of category, to generate manifolding protocol function, and by the manifolding protocol function come The communication protocol is inherited, inheritance is established;By the communication protocol function passes to the processing controller class, make described Processing controller class holds the 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, value are 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, 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 setting communication protocol function come transmit into The progress data between a view object and processing controller class is spent, to realize that processing controller class verifies progress barrage message After legitimate messages, the value of progress bar view object can be updated according to the current schedules data in progress barrage message, from technology On realize and the synchronous progress of multi-user is carried out by barrage distributor update.It also avoids processing controller class and progress bar regards The difficulty of follow-up maintenance caused by direct-coupling and extension between figure object, carries out coupling by way of agreement between the two It closes, can thus be reduced than the degree of direct-coupling relationship, logic function is independent from each other, and can greatly improve code Maintainable and scalability etc. reduces follow-up maintenance cost.
The application also provides another embodiment, and it is legal that the processing controller class, which verifies the progress barrage message, After message, in order to enable processing controller class can update progress bar view object, processing controller class and progress can be first allowed View object is held mutually, and specific practice is that progress bar view object is transferred in advance in processing controller class, so that institute State the adduction relationship that processing controller class holds the progress bar view object.By way of holding mutually, setting can be reduced The workload of communication protocol function reduces the realization difficulty of progress data transmission plan.
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.
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 devices of display progress, as shown in Figure 2, comprising:
Barrage distributor 201 obtains for barrage distributor and disappears by the progress barrage that preset barrage messaging protocol generates Breath, the progress barrage message includes current schedules data;The progress barrage message distribution to processing predetermined is controlled Device class processed;
Processing controller 202 verifies the progress barrage message for the processing controller class to lead to after legitimate messages Progress barrage message described in communication protocol function transfer predetermined is crossed to progress bar view object is updated, to work as according to Preceding progress data updates the value of the progress bar view object, so that the progress image currently shown on display unit is updated, In, the progress bar view object is communicated with the processing controller class by the communication protocol function;
Communication protocol module 203, for defining the communication protocol function.
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 verifies the progress barrage message to pass through communication protocols predetermined after legitimate messages Progress barrage message described in function transfer is discussed to update progress bar view object, according to 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 pair As being communicated with the processing controller class by the communication protocol function.
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 verifies the progress barrage message to pass through communication protocols predetermined after legitimate messages Progress barrage message described in function transfer is discussed to update progress bar view object, according to 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 pair As being communicated with the processing controller class by the communication protocol function.
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 method of display progress 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 verifies the progress barrage message to pass through communication protocol letter predetermined after legitimate messages Number transmits the progress barrage message to progress bar view object is updated, to update the progress according to the current schedules data The value of view object, to update the progress image currently shown on display unit, wherein the progress bar view object with The processing controller class is communicated by the communication protocol function.
2. 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.
3. 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.
4. method as claimed in claim 3, 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;
It is legitimate messages that the processing controller class, which verifies the progress barrage message, 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.
5. the method as described in claim 1, which is characterized in that the definition method of the communication protocol function are as follows:
Define communication protocol, the communication protocol includes the communication protocol function, the communication protocol function include update into The function parameter of degree;
The communication protocol function is made carbon copies in the classes of pages belonging to the progress bar view object, makes carbon copies agreement letter to generate Number, and the communication protocol is inherited by the manifolding protocol function, establish inheritance;
By the communication protocol function passes to the processing controller class, the processing controller class is made to hold the communication protocols Discuss function.
6. method as claimed in claim 5, which is characterized in that described to control the communication protocol function passes to the processing Device class processed, comprising:
The communication protocol native object of the global page Class Type is defined in processing controller class;
Register method is called to transmit communication protocol function in the communication protocol, the communication protocol function enters ginseng ginseng Number is assigned to the communication protocol native object, and the communication protocol function and the communication protocol native object, which are established to be equal to, to close System.
7. method as claimed in claim 6, which is characterized in that described by described in communication protocol function transfer predetermined Progress barrage message is to progress bar view object is updated, to update the progress bar view object according to the current schedules data Value, 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 communication protocol native object, are closed with being equal to based on described in System updates the communication protocol function, and then updates the manifolding protocol function based on the inheritance, thus update and institute State the value that manifolding protocol function belongs to the progress bar view object of the classes of pages.
8. a kind of device of display progress characterized by comprising
Barrage distributor obtains the progress barrage message generated by preset barrage messaging protocol for barrage distributor, described Progress barrage 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, by preparatory Progress barrage message described in the communication protocol function transfer of definition is to progress bar view object is updated, according to the current schedules Data update the value of the progress bar view object, to update the progress image currently shown on display unit, wherein described Progress bar view object is communicated with the processing controller class by the communication protocol function;
Communication protocol module, for defining the communication protocol function.
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 method as claimed in claim 1 to 7 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 Method as claimed in claim 1 to 7 is realized when execution.
CN201811646179.2A 2018-12-29 2018-12-29 Method, device, electronic equipment and medium for displaying progress Active CN109698974B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811646179.2A CN109698974B (en) 2018-12-29 2018-12-29 Method, device, electronic equipment and medium for displaying progress

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811646179.2A CN109698974B (en) 2018-12-29 2018-12-29 Method, device, electronic equipment and medium for displaying progress

Publications (2)

Publication Number Publication Date
CN109698974A true CN109698974A (en) 2019-04-30
CN109698974B CN109698974B (en) 2021-01-01

Family

ID=66233078

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811646179.2A Active CN109698974B (en) 2018-12-29 2018-12-29 Method, device, electronic equipment and medium for displaying progress

Country Status (1)

Country Link
CN (1) CN109698974B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110022493A (en) * 2019-05-21 2019-07-16 北京字节跳动网络技术有限公司 Playback progress display methods, device, electronic equipment and storage medium
CN112100187A (en) * 2020-08-31 2020-12-18 湖北美和易思教育科技有限公司 Student learning data storage method and device based on VueJS

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130004138A1 (en) * 2011-06-30 2013-01-03 Hulu Llc Commenting Correlated To Temporal Point Of Video Data
CN103051646A (en) * 2011-10-12 2013-04-17 腾讯数码(天津)有限公司 Information synchronization method and device
CN106358065A (en) * 2016-08-26 2017-01-25 乐视控股(北京)有限公司 Multimedia information processing method and system
US20170048282A1 (en) * 2015-08-13 2017-02-16 Vyu Labs, Inc. Participant selection and abuse prevention for interactive video sessions
CN106792087A (en) * 2016-12-14 2017-05-31 上海青声网络科技有限公司 The method and device that a kind of barrage shows
CN106909414A (en) * 2015-12-23 2017-06-30 北京奇虎科技有限公司 The downloading data processing method and device of application program
US20170289210A1 (en) * 2016-04-04 2017-10-05 Dropbox, Inc. Change comments for synchronized content items
CN109005465A (en) * 2018-08-07 2018-12-14 武汉斗鱼网络科技有限公司 Barrage message distributing method, device, equipment and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130004138A1 (en) * 2011-06-30 2013-01-03 Hulu Llc Commenting Correlated To Temporal Point Of Video Data
CN103051646A (en) * 2011-10-12 2013-04-17 腾讯数码(天津)有限公司 Information synchronization method and device
US20170048282A1 (en) * 2015-08-13 2017-02-16 Vyu Labs, Inc. Participant selection and abuse prevention for interactive video sessions
CN106909414A (en) * 2015-12-23 2017-06-30 北京奇虎科技有限公司 The downloading data processing method and device of application program
US20170289210A1 (en) * 2016-04-04 2017-10-05 Dropbox, Inc. Change comments for synchronized content items
CN106358065A (en) * 2016-08-26 2017-01-25 乐视控股(北京)有限公司 Multimedia information processing method and system
CN106792087A (en) * 2016-12-14 2017-05-31 上海青声网络科技有限公司 The method and device that a kind of barrage shows
CN109005465A (en) * 2018-08-07 2018-12-14 武汉斗鱼网络科技有限公司 Barrage message distributing method, device, equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110022493A (en) * 2019-05-21 2019-07-16 北京字节跳动网络技术有限公司 Playback progress display methods, device, electronic equipment and storage medium
CN112100187A (en) * 2020-08-31 2020-12-18 湖北美和易思教育科技有限公司 Student learning data storage method and device based on VueJS
CN112100187B (en) * 2020-08-31 2024-01-26 武汉美和易思数字科技有限公司 Student learning data storage method and device based on VueJS

Also Published As

Publication number Publication date
CN109698974B (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
US20180234816A1 (en) Providing access to applications with varying enrollment levels
WO2017080385A1 (en) Webpage application acquiring method, device and system
CN107249004B (en) Identity authentication method, device and client
US20190052619A1 (en) Systems, apparatuses, methods, and non-transitory computer readable media for authenticating user using history of user
CN106164917B (en) User's specific application for remote session activates
EP4216077A1 (en) Blockchain network-based method and apparatus for data processing, and computer device
WO2019193820A1 (en) Information processing device, information processing method, and program
CN109361508A (en) Data transmission method, electronic equipment and computer readable storage medium
CN104301875A (en) Short message processing method and device
CN111355723A (en) Single sign-on method, device, equipment and readable storage medium
CN109194651A (en) A kind of identity identifying method, device, equipment and storage medium
CN109698974A (en) A kind of method, apparatus, electronic equipment and the medium of display progress
WO2019095388A1 (en) Remotely-assisted processing method and device
CN109698973A (en) A kind of progress update method, device, electronic equipment and medium
CN112995357B (en) Domain name management method, device, medium and electronic equipment based on cloud hosting service
CN110941412B (en) Method, system and terminal for realizing multi-terminal animation collaborative browsing based on pictures
CN109981521B (en) Message association method, message association device and message association system
CN102005001A (en) Login method, device and system of internet bank
US9866562B2 (en) File and bit location authentication
KR20210027011A (en) Peer node, method for processing information executed on peer node and blockchain platform system
CN109788054A (en) A kind of configuration method, server and the medium of Distributed Application coordination service node
KR102648350B1 (en) Method and apparatus for delivering signed content
CN115021995B (en) Multi-channel login method, device, equipment and storage medium
CN112491893B (en) Block chain terminal equipment network access method, device, server and storage medium

Legal Events

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