CN110321227A - Page data synchronous method, electronic device and computer readable storage medium - Google Patents

Page data synchronous method, electronic device and computer readable storage medium Download PDF

Info

Publication number
CN110321227A
CN110321227A CN201810269741.8A CN201810269741A CN110321227A CN 110321227 A CN110321227 A CN 110321227A CN 201810269741 A CN201810269741 A CN 201810269741A CN 110321227 A CN110321227 A CN 110321227A
Authority
CN
China
Prior art keywords
synchronized
data
page
synchronization
data field
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.)
Pending
Application number
CN201810269741.8A
Other languages
Chinese (zh)
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.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201810269741.8A priority Critical patent/CN110321227A/en
Publication of CN110321227A publication Critical patent/CN110321227A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores

Abstract

The embodiment of the present application discloses a kind of page data synchronous method, electronic device and computer readable storage medium, is related to field of communication technology.Page data synchronous method therein includes: to obtain all data to be synchronized;According to Data Synchronization Protocol, the respectively corresponding page to be synchronized of the data to be synchronized, the method for synchronization of the data field to be synchronized in the page to be synchronized and the data to be synchronized in the corresponding page to be synchronized are determined;According to the method for synchronization, the data field to be synchronized is updated in the page to be synchronized, and the data to be synchronized are synchronized to the updated data field to be synchronized.The above method, electronic device and computer readable storage medium can be used for improving the synchronous flexibility of page data, simplify simultaneously operating, reduce client maintenance cost and shorten its development cycle.

Description

Page data synchronous method, electronic device and computer readable storage medium
Technical field
This application involves field of communication technology more particularly to a kind of page data synchronous method, electronic device and computer Readable storage medium storing program for executing.
Background technique
The development trend of current most application first is that mobilism.And above-mentioned application is by multiple page structures mostly At, and partial page is interrelated, therefore how synchronous in the interior cross-page face data of realization of application, becomes the application of Most current One of frequent problems faced when realizing mobilism.The existing interior cross-page face data simultaneous techniques of application, height rely on terminal, The synchronization of monitoring and data for new field, needs to follow the version for the application installed in terminal.That is, to It has installed and has increased data field in the page of application newly, it is necessary to first pass through installation in the terminal and support answering for the newly-increased data field With upgrade package, by application upgrade to new version, therefore it is cumbersome and lack flexibility.In addition, application upgrade packet exploitation week Phase is longer and can increase accordingly the maintenance cost of application.
Summary of the invention
In view of this, the embodiment of the present application provides a kind of page data synchronous method, electronic device and computer-readable deposits Storage media can be used for improving the synchronous flexibility of page data, simplify simultaneously operating, reduces client maintenance cost and shortens it Development cycle.
On the one hand the embodiment of the present application provides a kind of page data synchronous method, comprising: obtain all numbers to be synchronized According to;According to Data Synchronization Protocol, determine the corresponding page to be synchronized of each data to be synchronized, in the page to be synchronized to The method of synchronization of synchrodata field and the data to be synchronized in the corresponding page to be synchronized;According to the side of synchronization Formula updates the data field to be synchronized in the page to be synchronized, and the data to be synchronized is synchronized to updated The data field to be synchronized.
On the one hand the embodiment of the present application additionally provides a kind of electronic device, comprising: synchrodata obtains module, for obtaining All data to be synchronized;Data management by synchronization module, for determining each data pair to be synchronized according to Data Synchronization Protocol The page to be synchronized, the data field to be synchronized in the page to be synchronized and the data to be synchronized answered are corresponding to same Walk the method for synchronization in the page;The data management by synchronization module is also used to according to the method for synchronization, in the page to be synchronized The data field to be synchronized is updated in face, and the data to be synchronized are synchronized to the updated data word to be synchronized Section.
On the one hand the embodiment of the present application additionally provides a kind of computer readable storage medium, be stored thereon with computer journey Sequence, which is characterized in that when the computer program is executed by processor, realize above-mentioned page data synchronous method.
Each embodiment of the application, by the way that when getting all data to be synchronized, the data issued according to server are same Agreement is walked, determines the corresponding page to be synchronized of each data to be synchronized, the data field to be synchronized in the page to be synchronized and to same The method of synchronization of the step data in the corresponding page to be synchronized updates in the page to be synchronized to same then according to the method for synchronization Step data field, and data to be synchronized are synchronized to updated data field to be synchronized, due to the update for data field It is the Data Synchronization Protocol issued based on server, therefore while realizing cross-page face data dynamic synchronization, has broken data Field contents data synchronize the dependence to terminal versions, so that the synchronous flexibility of page data can be improved, simplify synchronous behaviour Make, reduce client maintenance cost and shortens its development cycle.
Detailed description of the invention
Fig. 1 is the applied environment figure of page data synchronous method provided by the embodiments of the present application;
Fig. 2 is the schematic diagram of the page to be synchronized of page data synchronous method provided by the embodiments of the present application application;
Fig. 3 is the whole schematic diagram for realizing frame of page data synchronous method provided by the embodiments of the present application;
Fig. 4 is the implementation process schematic diagram for the page data synchronous method that one embodiment of the application provides;
Fig. 5 is the implementation process schematic diagram for the page data synchronous method that another embodiment of the application provides;
Fig. 6 is the data management by synchronization module of electronic device in page data synchronous method provided by the embodiments of the present application Operation principle schematic diagram;
Fig. 7 is the structural schematic diagram for the electronic device that one embodiment of the application provides;
Fig. 8 is the structural schematic diagram for the electronic device that another embodiment of the application provides;
Fig. 9 is the hardware structural diagram for the electronic device that one embodiment of the application provides.
Specific embodiment
Further to illustrate technical means and efficacy that the application is taken by the predetermined goal of the invention of realization, below in conjunction with Attached drawing and preferred embodiment, to specific embodiment, structure, feature and its effect according to the application, detailed description is as follows.
Referring to Fig. 1, being the applied environment figure of page data synchronous method provided by the embodiments of the present application.As shown in Figure 1, Electric terminal 100 and server 200 carry out data interaction by wired or wireless network.Electric terminal 100, which can be, to be equipped with The intelligent mobiles such as mobile phone, smartwatch, the tablet computer of APP (Application, application program) with page presentation function Terminal, alternatively, other non-terminals that can carry out data processing on the move.Server 200 can be multiple with not The distributed server cluster constituted with the server of processing function.
As shown in Fig. 2, the APP with page presentation function installed in electric terminal 100 includes multiple for showing not With the page of content, between the different pages, there is some data that are mutually related to need to synchronize, such as: " comment number ", " point Praise number ", " thumbing up state ", " number of subscribers and state " etc..Such as Fig. 2, based on the considerations of mobilism, when the data of a page When changing, the data of other related pages will also synchronize change.Meanwhile the content of page presentation can be according to matching from the background It sets and changes, synchronous data are also possible to need to make corresponding adjustment, increase " sharing number ", " downloading such as in the page The data fields such as number ".
It should be understood that the content for including in the page can be using data field as carrier, the content number of the same data field It is shown in the different pages according to that can apply.It may include multiple display areas on the page, each display area is for opening up Show the content-data of one or more data fields.
Electronic device 100 is mainly used for obtaining all data to be synchronized from server 200, according to Data Synchronization Protocol, Determine that each data to be synchronized corresponding page, the data field to be synchronized in the page to be synchronized and data to be synchronized to be synchronized exist The method of synchronization in the corresponding page to be synchronized.Then, it according to the determining method of synchronization, is updated in the page to be synchronized to be synchronized Data field, and data to be synchronized are synchronized to updated data field to be synchronized.
Server 200 is mainly used for configuration and needs that the data information of dynamic synchronization in electric terminal 100, to issue data same Data to be synchronized step agreement and that transmission needs synchronization to be shown in the page.Wherein data to be synchronized refer to the page Business datum, that is, the related data of content shown in the page, the specific value such as thumbed up.
In this present embodiment, as shown in figure 3, the whole of following page data synchronous method is realized in frame, electronic device 100 can include: data management by synchronization module 110, cache module 120 and memory management module 130.Server 200 can include: number According to synchronization configuration system 210 and Data Synchronization Protocol sending system 220.
Wherein, data management by synchronization module 110, the Data Synchronization Protocol for being issued according to server 200, by server 200 data to be synchronized sent synchronize in the page to be synchronized.In other words, the effect of data management by synchronization module 110 mainly has Two: synchronous data are needed in administration page, and when the data in some page change, the page of notice association in time It is synchronous that face carries out data.
Cache module 120 subsequent used and is read in local, facilitating data buffer storage to be synchronized.
Memory management module 130, for managing the EMS memory occupation when carrying out page data and synchronizing.
Data synchronization configuration system 210, for configuring the data information for needing dynamic synchronization for electric terminal 100.Configuration Data information can be, but not limited to include: data to be synchronized, the page iden-tity of the page to be synchronized for needing dynamic synchronization, each page The weighting weight in face, Data Synchronization Protocol, the data field and the method for synchronization that dynamic synchronization is needed in each page.Wherein synchronize Mode includes: deletion, increases the data field in the page to be synchronized or the content-data in replacement data field.By matching System is set, can accomplish that the specific data field in specific webpage in APP, specific protocol is accomplished to cover all around.Utilize page The weighting weight in face can more help electronic device 200 subsequent and carry out memory management for data to be synchronized, in time in release It deposits, reduces EMS memory occupation.
Data Synchronization Protocol sending system 220, for the request according to electric terminal or periodically or in the synchronous association of data When view has update, Data Synchronization Protocol is issued to electric terminal 100.
Data Synchronization Protocol is a global agreement, and synchronous data field, synchronization are needed in entire APP for obtaining Page etc..The page iden-tity, each page for needing the page to be synchronized of dynamic synchronization can be limited by Data Synchronization Protocol The data field and the method for synchronization of dynamic synchronization are needed in weighting weight, each page.In this present embodiment, it can be waited for for each Synchronization page configures a corresponding Data Synchronization Protocol, so that electronic device 100 is when carrying out page synchronization, according to corresponding Data Synchronization Protocol determines the data field for needing to synchronize in the page to be synchronized and the method for synchronization.
Server 200 can issue Data Synchronization Protocol when the APP in electronic device 100 starts according to the request of APP Electron device 100, alternatively, can also be handed down to Data Synchronization Protocol periodically or when Data Synchronization Protocol needs to update Electronic device 100.Optionally, to reduce the data volume issued, the increment agreement of Data Synchronization Protocol can also only be issued, that is, Only issue the Data Synchronization Protocol of update.
Referring to Fig. 4, Fig. 4 is the implementation process schematic diagram for the page data synchronous method that one embodiment of the application provides, It can be applied to the electronic device 100 in Fig. 1.As shown in figure 4, this method mainly comprises the steps that
401, all data to be synchronized are obtained;
Data to be synchronized refer to the business datum of the page, that is, the related data of content shown in the page, the tool such as thumbed up Body numerical value.Data to be synchronized are issued by server.The client end AP P for page presentation is preset in electronic device.APP is being opened When dynamic, request of data to be synchronized is sent to server, server gives all data distributings to be synchronized in response to the request APP.Alternatively, server is irregularly when there is new data to be synchronized to generate, by newly generated all data-pushings to be synchronized To APP, such as due to other electronic devices user thumb up operation caused by thumb up quantity increase when, thumb up quantity for newest It is handed down to the APP.
402, according to Data Synchronization Protocol, the respectively corresponding page to be synchronized of the data to be synchronized, the page to be synchronized are determined In the method for synchronization in the corresponding page to be synchronized of data field to be synchronized and the data to be synchronized;
Data Synchronization Protocol is configured in electronic device 100.It include the page of the page to be synchronized in the Data Synchronization Protocol Need to carry out the synchronous data field to be synchronized of data and the method for synchronization in mark, each page to be synchronized.
Data Synchronization Protocol is obtained from server.APP can obtain Data Synchronization Protocol from server on startup or periodically And it is buffered in the machine.Alternatively, Data Synchronization Protocol is periodically or non-periodically pushed to APP by server.Alternatively, server Data Synchronization Protocol can also be sent together when sending data to be synchronized.In practical applications, what is obtained from server can be with It is the Data Synchronization Protocol of full dose, i.e., the Data Synchronization Protocol of all pages is also possible to the Data Synchronization Protocol of increment, that is, counts According to the part for having update in synchronous protocol.
It should be understood that the content for including in the page can be using data field as carrier, the content number of the same data field It is shown in the different pages according to that can apply.It may include multiple display areas on the page, each display area is for opening up Show the content-data of one or more data fields, display area for example can be the card in the card form page.
The method of synchronization may include: to delete data field to be synchronized in the page to be synchronized, increase in the page to be synchronized New data field to be synchronized, and data to be synchronized are synchronized in the data field to be synchronized newly increased, and will be to be synchronized Data are synchronized in the data field to be synchronized in the page to be synchronized.
After getting all data to be synchronized, the Data Synchronization Protocol of caching is read, in conjunction in data to be synchronized Content-data to be synchronized and the corresponding relationship of its affiliated data field and the Data Synchronization Protocol of reading, it is synchronous according to the data The page iden-tity and data field specified in agreement, it is the page to be synchronized which page determines, which has, in each page to be synchronized Which data field is data field to be synchronized, and according in the Data Synchronization Protocol specify the method for synchronization, determine each to The method of synchronization of data field to be synchronized in synchronization page.
403, according to the method for synchronization, the data field to be synchronized is updated in the page to be synchronized, and this is to be synchronized Data are synchronized to the updated data field to be synchronized.
According to the method for synchronization is determined, increase or delete data field to be synchronized in each page to be synchronized, and based on update Data field to be synchronized afterwards, carries out the simultaneously operating of data to be synchronized.
Page data synchronous method provided in this embodiment, by when getting all data to be synchronized, according to clothes The Data Synchronization Protocol that issues of business device determines the corresponding page to be synchronized of each data to be synchronized, to be synchronized in the page to be synchronized The method of synchronization of data field and data to be synchronized in the corresponding page to be synchronized, then according to the method for synchronization, to same Data field to be synchronized is updated in the step page, and data to be synchronized are synchronized to updated data field to be synchronized, due to right It is the Data Synchronization Protocol issued based on server in the update of data field, therefore is realizing cross-page face data dynamic synchronization Meanwhile having broken data field contents data and having synchronized dependence to terminal versions, so that the synchronous spirit of page data can be improved Activity simplifies simultaneously operating, reduces client maintenance cost and shortens its development cycle.
Referring to Fig. 5, Fig. 5 is the implementation process signal for the page data synchronous method that another embodiment of the application provides Figure, can be applied to the electronic device 100 in Fig. 1.As shown in figure 5, this method mainly comprises the steps that
501, the Data Synchronization Protocol or the synchronous association of the data are obtained from server when client terminal start-up or periodically The increment agreement of view, and it is buffered in local;
502, all data to be synchronized are obtained;
503, according to Data Synchronization Protocol, the respectively corresponding page to be synchronized of the data to be synchronized, the page to be synchronized are determined In the method for synchronization in the corresponding page to be synchronized of data field to be synchronized and the data to be synchronized;
Data to be synchronized refer to the business datum of the page, that is, the related data of content shown in the page, the tool such as thumbed up Body numerical value.Data to be synchronized are issued by server.The client end AP P for page presentation is preset in electronic device.APP is being opened When dynamic, request of data to be synchronized is sent to server, server gives all data distributings to be synchronized in response to the request APP.Alternatively, server is irregularly when there is new data to be synchronized to generate, by newly generated all data-pushings to be synchronized To APP, such as due to other electronic devices user thumb up operation caused by thumb up quantity increase when, thumb up quantity for newest It is handed down to the APP.
Data Synchronization Protocol is configured in electronic device 100.It include the page of the page to be synchronized in the Data Synchronization Protocol Need to carry out the synchronous data field to be synchronized of data and the method for synchronization in mark, each page to be synchronized.
Data Synchronization Protocol is obtained from server.APP can obtain Data Synchronization Protocol from server on startup or periodically And it is buffered in the machine.Alternatively, Data Synchronization Protocol is periodically or non-periodically pushed to APP by server.Alternatively, server Data Synchronization Protocol can also be sent together when sending data to be synchronized.In practical applications, what is obtained from server can be with It is the Data Synchronization Protocol of full dose, i.e., the Data Synchronization Protocol of all pages is also possible to the Data Synchronization Protocol of increment, that is, counts According to the part for having update in synchronous protocol.
It should be understood that the content for including in the page can be using data field as carrier, the content number of the same data field It is shown in the different pages according to that can apply.It may include multiple display areas on the page, each display area is for opening up Show the content-data of one or more data fields, display area for example can be the card in the card form page.
The method of synchronization may include: to delete data field to be synchronized in the page to be synchronized, increase in the page to be synchronized New data field to be synchronized, and data to be synchronized are synchronized in the data field to be synchronized newly increased, and will be to be synchronized Data are synchronized in the data field to be synchronized in the page to be synchronized.
It in this present embodiment, is the corresponding Data Synchronization Protocol of each page configuration.When getting all numbers to be synchronized According to the corresponding Data Synchronization Protocol of each page for later, reading caching, in conjunction with content-data to be synchronized in data to be synchronized With the corresponding relationship of its affiliated data field and the Data Synchronization Protocol of reading, according in the Data Synchronization Protocol specify the page Mark and data field determine that have which page be the page to be synchronized, which data field in each page to be synchronized be to Synchrodata field, and according in the Data Synchronization Protocol specify the method for synchronization, determine in each page to be synchronized to same The method of synchronization of step data field.
504, according to the method for synchronization, the data field to be synchronized is updated in the page to be synchronized, and this is to be synchronized Data are synchronized to the updated data field to be synchronized;
According to the method for synchronization is determined, increase or delete data field to be synchronized in each page to be synchronized, and based on update Data field to be synchronized afterwards, carries out the simultaneously operating of data to be synchronized.
Specifically, deleting the data field to be synchronized in the page to be synchronized when the method for synchronization is to delete.Work as the method for synchronization When being newly-increased, increase data field to be synchronized in the page to be synchronized, and data to be synchronized are added to increased number to be synchronized According in field.When the method for synchronization is replacement, data to be synchronized are replaced with to the data field to be synchronized in the page to be synchronized In content-data.
505, monitor is registered for the target page to be synchronized, and with the data field to be synchronized in the target page to be synchronized The identification information of affiliated display area is search key, establishes and relies between the target page to be synchronized and its association page Relationship;
The target page to be synchronized is after data field updates still comprising the page to be synchronized of data field to be synchronized.Knot All data to be synchronized and Data Synchronization Protocol obtained are closed, when judging in a page comprising the corresponding data of the page In synchronous protocol specify data field to be synchronized, and the method for synchronization be non-delete mode when, which is determined as target and is waited for Synchronization page.Then, listener (or, observer) is registered for the target page to be synchronized, and constructs storing data structure, this is deposited The search key for storing up data structure is in the target page to be synchronized, for showing the content number in the data field to be synchronized According to region unique identity (ID), by the ID can the target page to be synchronized and its association the page between establish Dependence, so that the data of the different pages are associated with, such as: it will require to show that multiple pages of " comment number " are associated in one It rises.
506, when the content-data of the data field to be synchronized listened to by the monitor in the target page to be synchronized, When operation based on the target page to be synchronized changes, it is based on the dependence, notifies the association renewal of the page content The storage and displaying of data.
When user operates in the page, if being related to data field to be synchronized, monitor listens to dependent event, then The association page of the page is notified to carry out the update of data storage and the refreshing of displaying.
In a practical application example, registration monitor monitors data field to be synchronized, and same by monitor progress data Step is realized by KVO (Key-Value Observing, key assignments are monitored) mechanism.KVO mechanism mainly specified one observed Object is implemented to monitor, when some attribute changes in object, in callback method by registration observer (i.e. monitor) The variation of processing attribute.
It further, can also be by the institute after the identification information of the changed data field to be synchronized of content-data, variation The identification information for stating content-data and the target page to be synchronized is sent to server as data to be synchronized, to service It is synchronous that device sends it to other electronic devices progress page data.
In a practical application example, step 503 to step 506 can be realized by data management by synchronization module, and data are synchronous Management module realizes the basic principle of its function as shown in fig. 6, data management by synchronization module can be divided into UI (User Interface, user interface) three macroplate of layer, logical layer and data Layer.Wherein, UI layers for logical layer provide user's operation with The related data of the content of page presentation.In logical layer, issued using preset data model according to Data Synchronization Protocol in Hold, filter out monitoring data content (data field to be synchronized in the page i.e. to be synchronized), and carries out dynamic registration to it and add Power processing, determines the processing priority of the data cached in memory.In data Layer, one piece of region can be opened up and store number to be synchronized According to.On the one hand monitoring, refreshing to data fields certain in APP are realized by KVO, on the other hand establishes dynamic number in conjunction with backstage According to synchronization mechanism, the dynamic synchronization of the interior data of application is realized.
It should be understood that needing to open up one piece of region of memory again for the dynamic synchronization of page data in APP to carry out Monitoring, with the increase for opening page quantity in APP, occupied memory can linearly increase.It is therefore further, it is necessary to Any one or more of following three kinds of method kinds are taken, this partial memory occupancy is managed, to guarantee the good body of user EMS memory occupation control is avoided into the fluency of influence system in reasonable range while testing.
Method one, if the page destroyed is the page to be synchronized, releases the destruction when listening to page destruction event The monitor of page registration.
Page destruction event, such as page close event, when listening to page destruction event, if the destroyed page is deposited Synchronous in data, then the monitor of de-registration, discharges the field monitoring of respective page, to reduce EMS memory occupation.
Method two is greater than or equal to preset occupancy threshold value when being used for the synchronous EMS memory occupation of page data in client When, according to the weight of each page to be synchronized, according to the sequence that weight is ascending, the to be synchronized of each page to be synchronized is discharged step by step The memory that data occupy, until the EMS memory occupation is less than the occupancy threshold value.
In this present embodiment, it is individually for data to be synchronized in memory and distributes one piece of storage region, to be used for number to be synchronized According to storage.It also include the weighting weight and occupancy threshold value of each page in Data Synchronization Protocol.Optionally, 5 etc. can be divided The weighting weight of grade, respectively corresponds 5 priority 1~5, and the smaller priority of number is higher.The weight of the height of priority and the page Whether the property wanted rank needs resident content and shows that the height of the frequency is low related.Such as: need memory-resident and the display frequency The priority of the high page (the high page of the frequency is shown in such as first level pages) can be 1, need memory-resident and the display frequency The priority of the low page (the low page of some display frequencys in such as first level pages) can be 2, and so on.
EMS memory occupation situation synchronous for page data in client is obtained, when the occupied memory got is greater than Or when equal to the occupancy threshold value specified in Data Synchronization Protocol, according to the power for each page to be synchronized specified in Data Synchronization Protocol Weight, according to the sequence that weight is ascending, each page to be synchronized is ranked up, then according to ranking results, is sequentially released step by step The memory that the data to be synchronized of corresponding each page to be synchronized occupy is put, until EMS memory occupation is less than the occupancy threshold value.
Method three, when client receives internal storage warning notice, according to the weight of each page in the client, according to power The ascending sequence of weight, discharges the memory that respectively page occupies step by step.
Internal storage warning notifies the EMS memory occupation for being directed to entire client (APP).System would generally be each opening APP distribute memory headroom for caching ephemeral data, when the EMS memory occupation of the APP will be more than to distribute to the APP's When memory headroom, system can send internal storage warning notice as the APP.At this point, according to each in the specified APP of Data Synchronization Protocol Each page is ranked up by the weighting weight of the page according to the sequence that weight is ascending, then according to ranking results, sequentially The memory that each page occupies is discharged step by step, until EMS memory occupation is lower than the memory headroom for distributing to the APP.
Page data synchronous method provided in this embodiment, by when getting all data to be synchronized, according to clothes The Data Synchronization Protocol that issues of business device determines the corresponding page to be synchronized of each data to be synchronized, to be synchronized in the page to be synchronized The method of synchronization of data field and data to be synchronized in the corresponding page to be synchronized, then according to the method for synchronization, to same Data field to be synchronized is updated in the step page, and data to be synchronized are synchronized to updated data field to be synchronized, due to right It is the Data Synchronization Protocol issued based on server in the update of data field, therefore is realizing cross-page face data dynamic synchronization Meanwhile having broken data field contents data and having synchronized dependence to terminal versions, so that the synchronous spirit of page data can be improved Activity simplifies simultaneously operating, reduces client maintenance cost and shortens its development cycle.
Fig. 7 is the structural schematic diagram for the electronic device that one embodiment of the application provides.Electronic device provided in this embodiment It is the executing subject of the page data synchronous method in above-mentioned embodiment illustrated in fig. 4.As shown in fig. 7, electricity provided in this embodiment Sub-device specifically includes that synchrodata obtains module 501 and data management by synchronization module 702.
Synchrodata obtains module 701, for obtaining all data to be synchronized;
Data management by synchronization module 702, for according to Data Synchronization Protocol, determining that respectively the data to be synchronized are corresponding to same It is same in the corresponding page to be synchronized to walk the page, the data field to be synchronized in the page to be synchronized and the data to be synchronized Step mode;
Data management by synchronization module 702, is also used to according to the method for synchronization, and it is to be synchronized to update this in the page to be synchronized Data field, and the data to be synchronized are synchronized to the updated data field to be synchronized.
The detailed process of the respective function of each Implement of Function Module, refers in above-mentioned embodiment illustrated in fig. 4 in the present embodiment The particular content of description, details are not described herein again.
Page data synchronizing device provided in this embodiment, by when getting all data to be synchronized, according to clothes The Data Synchronization Protocol that issues of business device determines the corresponding page to be synchronized of each data to be synchronized, to be synchronized in the page to be synchronized The method of synchronization of data field and data to be synchronized in the corresponding page to be synchronized, then according to the method for synchronization, to same Data field to be synchronized is updated in the step page, and data to be synchronized are synchronized to updated data field to be synchronized, due to right It is the Data Synchronization Protocol issued based on server in the update of data field, therefore is realizing cross-page face data dynamic synchronization Meanwhile having broken data field contents data and having synchronized dependence to terminal versions, so that the synchronous spirit of page data can be improved Activity simplifies simultaneously operating, reduces client maintenance cost and shortens its development cycle.
Fig. 8 is the structural schematic diagram for the electronic device that another embodiment of the application provides.Electronics dress provided in this embodiment Set be page data synchronous method in above-mentioned Fig. 4 and embodiment illustrated in fig. 5 executing subject.As shown in figure 8, the present embodiment mentions The electronic device of confession specifically includes that synchrodata obtains module 801, data management by synchronization module 802, memory management module 803 And agreement obtains module.
In this present embodiment, synchrodata obtains module 801, for obtaining all data to be synchronized;
Data management by synchronization module 802, for according to Data Synchronization Protocol, determining that respectively the data to be synchronized are corresponding to same It is same in the corresponding page to be synchronized to walk the page, the data field to be synchronized in the page to be synchronized and the data to be synchronized Step mode;
Data management by synchronization module 802, is also used to according to the method for synchronization, and it is to be synchronized to update this in the page to be synchronized Data field, and the data to be synchronized are synchronized to the updated data field to be synchronized.
It should be understood that the electronic device further includes cache module, the data to be synchronized that will acquire by cache module are slow There are locals.
Further, data management by synchronization module 802 includes:
Management module 8021, for deleting the number to be synchronized in the page to be synchronized when the method for synchronization is to delete Increase the data field to be synchronized in the page to be synchronized, and this is to be synchronized when the method for synchronization is newly-increased according to field Data are added in increased data field to be synchronized, and when the method for synchronization is replacement, which is replaced In content-data for the data field to be synchronized in the page to be synchronized;
Registration module 8022, for registering monitor for the target page to be synchronized, and in the target page to be synchronized The identification information of the affiliated display area of data field to be synchronized is search key, in the target page to be synchronized and its association page Dependence is established between face, the target page to be synchronized is after data field updates comprising the data field to be synchronized The page to be synchronized;
Synchronization module 8023, for when the data word to be synchronized listened to by the monitor in the target page to be synchronized The content-data of section when the operation based on the target page to be synchronized changes, is based on the dependence, notifies the association page Face updates the storage and displaying of the content-data.
In this present embodiment, memory management module 803, for when listening to page destruction event, if the page destroyed For the page to be synchronized, then the monitor of the page registration of the destruction is released.
Further, memory management module 803 are also used to when EMS memory occupation synchronous for page data in client is big When preset occupancy threshold value, according to the weight of the respectively page to be synchronized, according to the sequence that weight is ascending, step by step The memory that the data to be synchronized of the respectively page to be synchronized occupy is discharged, until the EMS memory occupation is less than the occupancy threshold value.
Further, memory management module 803 are also used to when client receives internal storage warning notice, according to the visitor The weight of each page in the end of family discharges the memory that respectively page occupies according to the sequence that weight is ascending step by step.
In this present embodiment, agreement obtains module 804, for when client terminal start-up or periodically obtaining the number from server According to the increment agreement of synchronous protocol or the Data Synchronization Protocol, and it is buffered in local.
The detailed process of the respective function of each Implement of Function Module, refers to implementation shown in above-mentioned Fig. 4 to Fig. 7 in the present embodiment Particular content described in example, details are not described herein again.
Page data synchronizing device provided in this embodiment, by when getting all data to be synchronized, according to clothes The Data Synchronization Protocol that issues of business device determines the corresponding page to be synchronized of each data to be synchronized, to be synchronized in the page to be synchronized The method of synchronization of data field and data to be synchronized in the corresponding page to be synchronized, then according to the method for synchronization, to same Data field to be synchronized is updated in the step page, and data to be synchronized are synchronized to updated data field to be synchronized, due to right It is the Data Synchronization Protocol issued based on server in the update of data field, therefore is realizing cross-page face data dynamic synchronization Meanwhile having broken data field contents data and having synchronized dependence to terminal versions, so that the synchronous spirit of page data can be improved Activity simplifies simultaneously operating, reduces client maintenance cost and shortens its development cycle.
Referring to Fig. 9, Fig. 9 is the hardware structure diagram for the electronic device that one embodiment of the application provides.
Electronic device as described in this embodiment, comprising:
Memory 901, processor 902 and it is stored in the computer journey that can be run on memory 901 and on processor 902 Sequence when processor 902 executes the computer program, realizes that earlier figures 4 are synchronous to page data described in embodiment illustrated in fig. 6 Method.
Further, the electronic device further include:
At least one input equipment 903 and at least one output equipment 904.
Above-mentioned memory 901, processor 902, input equipment 903 and output equipment 904 are connected by bus 909.
Wherein, input equipment 903 concretely camera, touch panel, physical button or mouse etc..Output equipment 904 concretely display screens.
Memory 901 can be high random access memory body (RAM, Random Access Memory) memory, It can be non-labile memory (non-volatile memory), such as magnetic disk storage.Memory 901 is for storing one Group executable program code, processor 902 are coupled with memory 901.
Further, the embodiment of the present application also provides a kind of computer readable storage medium, the computer-readable storages Medium can be in the electronic device being set in the various embodiments described above, which can be earlier figures 9 Memory in illustrated embodiment, or the memory of configuration in the server.It is stored on the computer readable storage medium Computer program realizes earlier figures 4 to page number described in embodiment illustrated in fig. 6 when the computer program is executed by processor According to synchronous method.Further, the computer can storage medium can also be USB flash disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), RAM, the various media that can store program code such as magnetic or disk.
It should be noted that for the various method embodiments described above, describing for simplicity, therefore, it is stated as a series of Combination of actions, but those skilled in the art should understand that, the application is not limited by the described action sequence because According to the application, certain steps can use other sequences or carry out simultaneously.Secondly, those skilled in the art should also know It knows, the embodiments described in the specification are all preferred embodiments, and related actions and modules might not all be this Shen It please be necessary.
In the above-described embodiments, it all emphasizes particularly on different fields to the description of each embodiment, there is no the portion being described in detail in some embodiment Point, it may refer to the associated description of other embodiments.
Herein, relational terms such as first and second and the like be used merely to by an entity or operation with it is another One entity or operation distinguish, and without necessarily requiring or implying between these entities or operation, there are any this reality Relationship or sequence.Moreover, the terms "include", "comprise" or its any other variant are intended to the packet of nonexcludability Contain, so that the process, method, article or the device that include a series of elements not only include those elements, but also including Other elements that are not explicitly listed, or further include for this process, method, article or the intrinsic element of device. In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including the element Process, method, there is also other identical elements in article or device.
It will be appreciated by those skilled in the art that realizing that all or part of the steps of above-described embodiment can be by hardware come complete At relevant hardware can also being instructed to complete by program, the program can store in a kind of computer-readable storage In medium, storage medium mentioned above can be read-only memory, tape, disk or CD etc..

Claims (11)

1. a kind of page data synchronous method, which is characterized in that the described method includes:
Obtain all data to be synchronized;
According to Data Synchronization Protocol, the corresponding page to be synchronized of each data to be synchronized is determined, in the page to be synchronized The method of synchronization of data field to be synchronized and the data to be synchronized in the corresponding page to be synchronized;
According to the method for synchronization, the data field to be synchronized is updated in the page to be synchronized, and will be described to be synchronized Data are synchronized to the updated data field to be synchronized.
2. the method as described in claim 1, which is characterized in that it is described according to the method for synchronization, in the page to be synchronized It is middle to update the data field to be synchronized, and the data to be synchronized are synchronized to the updated data field to be synchronized, Include:
When the method for synchronization is to delete, the data field to be synchronized in the page to be synchronized is deleted;
When the method for synchronization is newly-increased, increase the data field to be synchronized in the page to be synchronized, and will be described Data to be synchronized are added in increased data field to be synchronized;
When the method for synchronization is replacement, the data to be synchronized are replaced with into the data to be synchronized in the page to be synchronized In the content-data of field.
3. the method as described in claim 1, which is characterized in that it is described according to the method for synchronization, in the page to be synchronized It is middle to update the data field to be synchronized, and by the data to be synchronized be synchronized to the updated data field to be synchronized it Afterwards, further includes:
Monitor is registered for the target page to be synchronized, and to open up belonging to the data field to be synchronized in the target page to be synchronized The identification information for showing region is search key, establishes to rely between the target page to be synchronized and its association page and close System, the target page to be synchronized are the page to be synchronized after data field updates comprising the data field to be synchronized Face;
When the content-data of the data field to be synchronized listened to by the monitor in the target page to be synchronized, it is based on When the operation of the target page to be synchronized changes, it is based on the dependence, is notified described in the association renewal of the page The storage and displaying of content-data.
4. method as claimed in claim 3, which is characterized in that after the page registration monitor to be synchronized for target, also Include:
When listening to page destruction event, if the page destroyed is the page to be synchronized, the page of the destruction is released The monitor of registration.
5. method as claimed in claim 3, which is characterized in that after all data to be synchronized of the acquisition, further includes:
When being used for the synchronous EMS memory occupation of page data in client more than or equal to preset occupancy threshold value, according to each described The weight of the page to be synchronized discharges the data to be synchronized of each page to be synchronized according to the sequence that weight is ascending step by step The memory of occupancy, until the EMS memory occupation is less than the occupancy threshold value.
6. the method as described in claim 1, which is characterized in that after all data to be synchronized of the acquisition, further includes:
When client receives internal storage warning notice, according to the weight of each page in the client, according to weight by it is small to Big sequence discharges the memory that each page occupies step by step.
7. such as method described in any one of claims 1 to 6, which is characterized in that the method also includes:
The increment of the Data Synchronization Protocol or the Data Synchronization Protocol when client terminal start-up or is periodically obtained from server Agreement.
8. a kind of electronic device, which is characterized in that the electronic device includes:
Synchrodata obtains module, for obtaining all data to be synchronized;
Data management by synchronization module, for according to Data Synchronization Protocol, determining the corresponding page to be synchronized of each data to be synchronized Face, the data field to be synchronized in the page to be synchronized and the data to be synchronized are same in the corresponding page to be synchronized Step mode;
The data management by synchronization module is also used to according to the method for synchronization, updated in the page to be synchronized it is described to Synchrodata field, and the data to be synchronized are synchronized to the updated data field to be synchronized.
9. electronic device as claimed in claim 8, which is characterized in that the data management by synchronization module includes:
Management module, for deleting the data to be synchronized in the page to be synchronized when the method for synchronization is to delete Field increases the data field to be synchronized, and will be described when the method for synchronization is newly-increased in the page to be synchronized Data to be synchronized are added in increased data field to be synchronized, and when the method for synchronization is replacement, will be described to same Step data replaces in the content-data of the data field to be synchronized in the page to be synchronized;
Registration module, for registering monitor for the target page to be synchronized, and with to be synchronized in the target page to be synchronized The identification information of the affiliated display area of data field be search key, the target page to be synchronized and its association the page it Between establish dependence, the target page to be synchronized is after data field updates comprising the data field to be synchronized The page to be synchronized;
Synchronization module, for when the data field to be synchronized listened to by the monitor in the target page to be synchronized Content-data when the operation based on the target page to be synchronized changes, is based on the dependence, notifies the association The storage and displaying of content-data described in renewal of the page.
10. electronic device as claimed in claim 8, which is characterized in that described device further include:
Memory management module, for if the page destroyed is the page to be synchronized, solving when listening to page destruction event Except the monitor of the page registration of the destruction;
The memory management module is also used to when EMS memory occupation synchronous for page data in client is more than or equal to default Occupancy threshold value when, according to the weight of each page to be synchronized, according to the sequence that weight is ascending, discharge step by step each described The memory that the data to be synchronized of the page to be synchronized occupy, until the EMS memory occupation is less than the occupancy threshold value;
The memory management module is also used to when client receives internal storage warning notice, according to each page in the client The weight in face discharges the memory that each page occupies according to the sequence that weight is ascending step by step;
Described device further include:
Agreement obtains module, for obtaining the Data Synchronization Protocol or the number when client terminal start-up or periodically from server According to the increment agreement of synchronous protocol.
11. a kind of computer readable storage medium, is stored thereon with computer program, which is characterized in that the computer program When being executed by processor, the page data synchronous method as described in any one in claim 1 to 7 is realized.
CN201810269741.8A 2018-03-29 2018-03-29 Page data synchronous method, electronic device and computer readable storage medium Pending CN110321227A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810269741.8A CN110321227A (en) 2018-03-29 2018-03-29 Page data synchronous method, electronic device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810269741.8A CN110321227A (en) 2018-03-29 2018-03-29 Page data synchronous method, electronic device and computer readable storage medium

Publications (1)

Publication Number Publication Date
CN110321227A true CN110321227A (en) 2019-10-11

Family

ID=68110739

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810269741.8A Pending CN110321227A (en) 2018-03-29 2018-03-29 Page data synchronous method, electronic device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110321227A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112422682A (en) * 2020-11-18 2021-02-26 青岛海尔科技有限公司 Data transmission method and device, storage medium, and electronic device
CN112860794A (en) * 2021-02-03 2021-05-28 百果园技术(新加坡)有限公司 Cache-based concurrency capability improving method, device, equipment and storage medium
CN114676190A (en) * 2022-05-27 2022-06-28 太平金融科技服务(上海)有限公司深圳分公司 Data display method and device, computer equipment and storage medium

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101459503A (en) * 2007-12-12 2009-06-17 华为技术有限公司 Method and device for implementing data synchronization
CN101930453A (en) * 2010-07-23 2010-12-29 百度在线网络技术(北京)有限公司 Method and equipment for realizing updating of embedded block of webpage
CN102289761A (en) * 2010-06-18 2011-12-21 微软公司 Metadata-enabled dynamic updates of online advertisements
CN104182241A (en) * 2013-05-24 2014-12-03 华为终端有限公司 Webpage application program (Web App) update method and communication device
CN104391725A (en) * 2014-12-08 2015-03-04 畅捷通信息技术股份有限公司 Page display method and page display device
CN106326137A (en) * 2015-07-02 2017-01-11 腾讯科技(深圳)有限公司 Memory optimization method and apparatus, and user equipment
CN106843828A (en) * 2016-12-07 2017-06-13 腾讯科技(深圳)有限公司 interface display, loading method and device
CN107784086A (en) * 2017-10-09 2018-03-09 中国平安人寿保险股份有限公司 A kind of loading method of webpage, terminal device and computer-readable recording medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101459503A (en) * 2007-12-12 2009-06-17 华为技术有限公司 Method and device for implementing data synchronization
CN102289761A (en) * 2010-06-18 2011-12-21 微软公司 Metadata-enabled dynamic updates of online advertisements
CN101930453A (en) * 2010-07-23 2010-12-29 百度在线网络技术(北京)有限公司 Method and equipment for realizing updating of embedded block of webpage
CN104182241A (en) * 2013-05-24 2014-12-03 华为终端有限公司 Webpage application program (Web App) update method and communication device
CN104391725A (en) * 2014-12-08 2015-03-04 畅捷通信息技术股份有限公司 Page display method and page display device
CN106326137A (en) * 2015-07-02 2017-01-11 腾讯科技(深圳)有限公司 Memory optimization method and apparatus, and user equipment
CN106843828A (en) * 2016-12-07 2017-06-13 腾讯科技(深圳)有限公司 interface display, loading method and device
CN107784086A (en) * 2017-10-09 2018-03-09 中国平安人寿保险股份有限公司 A kind of loading method of webpage, terminal device and computer-readable recording medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112422682A (en) * 2020-11-18 2021-02-26 青岛海尔科技有限公司 Data transmission method and device, storage medium, and electronic device
CN112860794A (en) * 2021-02-03 2021-05-28 百果园技术(新加坡)有限公司 Cache-based concurrency capability improving method, device, equipment and storage medium
CN114676190A (en) * 2022-05-27 2022-06-28 太平金融科技服务(上海)有限公司深圳分公司 Data display method and device, computer equipment and storage medium
CN114676190B (en) * 2022-05-27 2022-10-11 太平金融科技服务(上海)有限公司深圳分公司 Data display method and device, computer equipment and storage medium

Similar Documents

Publication Publication Date Title
US9830327B2 (en) Method, device, node and system for managing file in distributed data warehouse
KR102098414B1 (en) Tracking data usage under a schematized data plan
US9794135B2 (en) Managed service for acquisition, storage and consumption of large-scale data streams
CN103414748B (en) A kind of cloud platform monitoring framework and monitoring implementation method thereof
CN105897946A (en) Obtaining method and system of access address
CN110321227A (en) Page data synchronous method, electronic device and computer readable storage medium
CN105472002B (en) Based on the session synchronization method copied immediately between clustered node
US8301838B2 (en) Method and apparatus for providing an application-level cache with a locked region and a floating region
CN107908472A (en) Data synchronization unit, method and computer-readable recording medium
KR20110128846A (en) Programming model for synchronizing browser caches across devices and web services
CN111400334B (en) Data processing method, data processing device, storage medium and electronic device
CN111177144B (en) Table synchronization method, apparatus, device, storage medium and system
CN110933140B (en) CDN storage allocation method, system and electronic equipment
CN110222288A (en) Page display method, device and storage medium
CN104168335A (en) Data synchronization method and device
CN112085535A (en) Resource metering charging method, device, cluster and storage medium
US20220335071A1 (en) Storing and versioning hierarchical data in a binary format
CN107943423A (en) The management method and computer-readable recording medium of storage resource in cloud system
CN112559194A (en) Application data processing method, device and equipment
CN114945026A (en) Data processing method, device and system
CN115543202A (en) Cache management method, reading method, system, electronic device and storage medium
CN103218445A (en) Mobile terminal information pushing method and device
US20190090120A1 (en) Highly scalable home subscriber server
CN103237007A (en) Method and device for updating media files
CN113050890A (en) Data migration method and device

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