CN115964101A - Object acquisition method and device, electronic equipment and storage medium - Google Patents

Object acquisition method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN115964101A
CN115964101A CN202310007454.0A CN202310007454A CN115964101A CN 115964101 A CN115964101 A CN 115964101A CN 202310007454 A CN202310007454 A CN 202310007454A CN 115964101 A CN115964101 A CN 115964101A
Authority
CN
China
Prior art keywords
object list
list
client
configuration center
version
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
CN202310007454.0A
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.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information 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 Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202310007454.0A priority Critical patent/CN115964101A/en
Publication of CN115964101A publication Critical patent/CN115964101A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The present disclosure relates to an object acquisition method, an object acquisition apparatus, an electronic device, and a storage medium, wherein the method includes: receiving an object loading request sent by a client; under the condition that the object loading request carries a version identifier corresponding to the object list currently displayed by the client and an object identifier of the last object in the currently displayed object list, inquiring a preset configuration center based on the version identifier and the object identifier to obtain a target object list; the configuration center stores a history object list obtained by the server through timing screening and a version identifier corresponding to the history object list; and returning the target object list to the client. The method can avoid the phenomenon that the object returned to the client is repeated with the object displayed by the client, and the page is broken.

Description

Object acquisition method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a method and an apparatus for obtaining an object, an electronic device, a storage medium, and a program product.
Background
Data deduplication technology is a vital technology in internet applications. Data deduplication has been widely applied to various application systems, but since deduplication modes often adopted by different systems are also different, a deduplication mode meeting the service needs to be selected according to the service needs. For example, in the keying-out video template collection service, when a user pulls template contents in a paging manner, the user cannot see repeated contents, so that the content returned to the client needs to be deduplicated according to the template ID, and the user cannot see repeated data after deduplication is ensured.
The currently common data deduplication method is front-end or client deduplication, that is, the front-end or client records a data ID that has been returned by the server, and when a user acquires data again, deduplication is performed according to the recorded data. However, the method may cause a page break, for example, data returned by the current page is all present in the history page, and the page break may occur at this time.
Disclosure of Invention
The present disclosure provides an object acquisition method, an object acquisition apparatus, an electronic device, a storage medium, and a program product, which at least solve the problem that a page is easily broken in the conventional deduplication method. The technical scheme of the disclosure is as follows:
according to a first aspect of an embodiment of the present disclosure, there is provided an object acquisition method, including:
receiving an object loading request sent by a client;
under the condition that the object loading request carries a version identifier corresponding to the object list currently displayed by the client and an object identifier of the last object in the currently displayed object list, inquiring a preset configuration center based on the version identifier and the object identifier to obtain a target object list; the configuration center stores a history object list obtained by the server through timing screening and a version identifier corresponding to the history object list;
and returning the target object list to the client.
In an exemplary embodiment, each object in the history object list has a corresponding object identification; the querying a preset configuration center based on the version identifier and the object identifier to obtain a target object list includes:
determining a target historical object list corresponding to the object list currently displayed by the client from the historical object list stored in the configuration center based on the version identification;
screening out other objects behind the object corresponding to the object identifier from the target historical object list;
and obtaining the target object list according to the other objects.
In an exemplary embodiment, after receiving the object loading request sent by the client, the method further includes:
detecting carried information of the object loading request;
and under the condition that the object loading request does not carry the version identification corresponding to the object list currently displayed by the client and the object identification of the last object in the currently displayed object list, acquiring the object list of the version meeting the preset requirement from the configuration center as the target object list.
In an exemplary embodiment, the method further comprises:
and under the condition that the configuration center does not have the version identification corresponding to the object list currently displayed by the client, acquiring the object list of the version meeting the preset requirement from the configuration center as the target object list.
In an exemplary embodiment, the method further comprises:
regularly screening a screened object list meeting preset conditions from the candidate objects, and generating a version identifier aiming at the screened object list;
and writing the screened object list and the version identification of the screened object list into the configuration center, and correspondingly using the screened object list and the version identification corresponding to the history object list stored in the configuration center.
In an exemplary embodiment, the periodically screening a screened object list meeting a preset condition from candidate objects, and generating a version identifier for the screened object list includes:
aiming at the screened object list screened each time, determining the version identification of the screened object list screened last time;
and executing an adding operation on the version identification of the screened object list screened last time to obtain the version identification of the screened object list screened currently.
In an exemplary embodiment, the writing the filtered object list and the version identifier of the filtered object list into the configuration center includes:
acquiring a storage threshold value of the configuration center and the number of current storage lists of the configuration center;
and when the number of the current storage lists is equal to the storage threshold value, adding the screened object lists to the configuration center, and deleting the object list with the earliest storage time in the current storage lists.
According to a second aspect of the embodiments of the present disclosure, there is provided an object acquisition apparatus including:
a receiving unit configured to execute receiving an object loading request sent by a client;
the query unit is configured to query a preset configuration center based on the version identifier and the object identifier to obtain a target object list under the condition that the object loading request carries the version identifier corresponding to the object list currently displayed by the client and the object identifier of the last object in the currently displayed object list; the configuration center stores a history object list obtained by the server through timing screening and a version identifier corresponding to the history object list;
a returning unit configured to perform returning the target object list to the client.
In an exemplary embodiment, each object in the history object list has a corresponding object identification; the query unit is specifically configured to determine a target historical object list corresponding to an object list currently displayed by the client from historical object lists stored in the configuration center based on the version identifier; screening out other objects behind the object corresponding to the object identifier from the target historical object list; and obtaining the target object list according to the other objects.
In an exemplary embodiment, the querying unit is further configured to perform detecting carried information of the object loading request; and under the condition that the object loading request does not carry the version identification corresponding to the object list currently displayed by the client and the object identification of the last object in the currently displayed object list, acquiring the object list of the version meeting the preset requirement from the configuration center as the target object list.
In an exemplary embodiment, the query unit is further configured to, in a case that the configuration center does not have a version identifier corresponding to the object list currently presented by the client, obtain, from the configuration center, an object list of a version meeting preset requirements as the target object list.
In an exemplary embodiment, the apparatus further comprises:
the screening module is configured to screen a screened object list meeting preset conditions from the candidate objects at regular time and generate a version identifier aiming at the screened object list;
and the writing module is configured to write the filtered object list and the version identifier of the filtered object list into the configuration center, and correspondingly serve as the history object list stored in the configuration center and the version identifier corresponding to the history object list.
In an exemplary embodiment, the screening module is further configured to perform, for each screened object list, determining a version identifier of a previously screened object list; and executing an adding operation on the version identification of the screened object list screened last time to obtain the version identification of the screened object list screened currently.
In an exemplary embodiment, the writing module is further configured to perform obtaining a storage threshold of the configuration center and a current storage list number of the configuration center; and when the number of the current storage lists is equal to the storage threshold value, adding the screened object lists to the configuration center, and deleting the object list with the earliest storage time in the current storage lists.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method as described in any one of the above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, in which instructions, when executed by a processor of an electronic device, enable the electronic device to perform the method of any one of the above.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising instructions which, when executed by a processor of an electronic device, enable the electronic device to perform the method as defined in any one of the above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
the method comprises the steps that object lists obtained by the server through timing screening are recorded in a configuration center, corresponding version identifications are given to the object lists, when an object loading request sent by a client is received, the object list currently displayed by the client and the last object displayed in the object list currently can be determined according to the version identification of the object list currently displayed by the client and the object identification of the last object in the object list currently displayed, which are carried by the object loading request, so that objects which are not displayed in the object list currently displayed can be accurately determined from the configuration center, the object list formed by the objects which are not returned is used as a target object list and is returned to the client, a user can continuously browse the objects which are not displayed in the object list currently displayed, and the phenomenon that the objects returned to the client are repeated with the objects displayed by the client and pages are broken is avoided.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure and are not to be construed as limiting the disclosure.
FIG. 1 is a diagram illustrating an application environment for an object acquisition method in accordance with an illustrative embodiment.
Fig. 2 is a flowchart illustrating an object acquisition method according to an example embodiment.
FIG. 3 is a flowchart illustrating a target history object list determination step according to an exemplary embodiment.
FIG. 4.1 is a schematic flow diagram illustrating the writing of an object to a configuration center, according to an example embodiment.
Fig. 4.2 is a schematic flow chart illustrating writing of a video template to a configuration center according to an application example.
Fig. 5.1 is a schematic flow diagram illustrating the reading of an object from a configuration center according to an exemplary embodiment.
Fig. 5.2 is a schematic flow chart illustrating a process of reading a video template from a configuration center according to an application example.
Fig. 6 is a block diagram illustrating a structure of an object acquisition apparatus according to an exemplary embodiment.
FIG. 7 is a block diagram illustrating an electronic device in accordance with an example embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims. It should also be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for presentation, analyzed data, etc.) referred to in the present disclosure are both information and data that are authorized by the user or sufficiently authorized by various parties.
The data deduplication technology is widely applied to the current internet application system. Currently, common data deduplication includes front-end or client deduplication, deduplication based on a distributed cache Redis (Remote Dictionary Server, an open-source database), and the like. The method for removing the duplicate of the front end or the client is used in a plurality of business systems, and is realized by recording a data ID returned by the server by the front end or the client, and removing the duplicate according to the recorded data when the user acquires the data again. However, the method has the disadvantage that the page breaking may occur, for example, the data returned by the current page is all present in the history page, and the page breaking may occur at this time.
The common duplication removing method based on the distributed cache Redis comprises the following steps: and the Redis record is used for recording the data ID list returned for each equipment ID, and when a user sends a data acquisition request next time, the data ID returned to the front end or the client is filtered out through the Redis record, so that the returned data is ensured to be not seen by the user. The disadvantages of this solution are: (1) Depending on Redis, if the Redis service is unstable, such as network jitter, the front end or the client may still have repeated data; (2) Redis is required to record data returned by each device ID, and if the Query Per Second (QPS) of the request is large, a large amount of memory is required to store the data already received by the user.
Yet another deduplication method based on Redis is to perform deduplication by using a Bitmap (Bitmap, a data structure used for recording a large number of 0-1 states) of Redis, and the implementation principle is that a data ID which is returned to a front end or a client is converted into a bit format and stored in a Bitmap set of Redis, and before a data list is returned to the front end or the client each time, deduplication is performed by using the Bitmap set, and data which is returned to the client or the front end is filtered. The scheme can efficiently and accurately screen the repeated data in the big data, and reduce the storage cost of Redis. However, the disadvantages of this solution are: depending on the Redis, if the Redis service is unstable, such as network jitter, the front end or the client may still have duplicate data.
In order to solve the above problems, the present disclosure provides a data deduplication method based on multi-version control, in which an object list obtained by a server through regular screening is recorded in a configuration center, and a corresponding version identifier is assigned to each object list, so that when an object loading request sent by a client is received, according to a version identifier of an object list currently displayed by the client and an object identifier of a last object in the currently displayed object list, which are carried by the object loading request, the currently displayed object list of the client and the displayed last object are determined, and thus an object list formed by unreturned objects can be accurately determined from the configuration center, and an object list formed by unreturned objects is returned to the client as a target object list, so that a user can continue to browse the unrepresented objects in the currently displayed object list, and thus the phenomenon that the objects returned to the client are repeated with the objects displayed by the client and a page break is avoided. Meanwhile, the method does not need to record the issued object list for each equipment ID, and does not need to use distributed cache Redis, thereby reducing network overhead and avoiding the problem that repeated objects appear on a client due to unstable Redis service.
The object acquisition method provided by the embodiment of the disclosure can be applied to the application environment shown in fig. 1. Wherein the client 102 communicates with the server 104 over a network. The data storage system may store data that the server 104 needs to process. The data storage system may be integrated on the server 104, or may be located on the cloud or other network server. In the application scenario of the present disclosure, a user using the client 102 may send an object loading request to the server 104 during a process of browsing a page, and after receiving the object loading request, the server 104 may determine a target object list returned to the client 102 according to information carried in the object loading request. Specifically, if the object loading request sent by the client 102 carries the version identifier corresponding to the object list currently displayed by the client 102 and the object identifier of the last object in the currently displayed object list, the server 104 may query the preset configuration center 106 according to the version identifier and the object identifier carried by the object loading request to obtain a target object list, and then return the target object list to the client 102, so that a user of the client 102 can browse the objects in the target object list.
The client 102 may be installed in various personal computers, notebook computers, smart phones, tablet computers, internet of things devices and portable wearable devices, and the internet of things devices may be smart speakers, smart televisions, smart air conditioners, smart car-mounted devices, and the like. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, and the like. The server 104 may be implemented as a stand-alone server or a server cluster comprised of multiple servers.
Fig. 2 is a flowchart illustrating an object obtaining method according to an exemplary embodiment, and as shown in fig. 2, the method is described as being applied to the server 104 in fig. 1, and includes the following steps:
in step S210, an object loading request sent by the client is received.
The object loading request may be understood as a request that a user of the client 102 needs to obtain an object displayed in a page in the process of browsing the page.
The object may be video, picture, audio, text, and the like.
In step S220, under the condition that the object loading request carries the version identifier corresponding to the object list currently displayed by the client and the object identifier of the last object in the currently displayed object list, querying a preset configuration center based on the version identifier and the object identifier to obtain a target object list; the configuration center stores a history object list obtained by the server through timing screening and a version identification corresponding to the history object list.
The version identification is the unique identification for representing the object list.
The object identifier is an identifier representing uniqueness of the object, and each object in the object list has a corresponding object identifier, for example, when the object is a video, the object identifier may be a video ID; when the object is a video template, the object identification may be a video template ID.
The configuration center can be understood as a basic service component for uniformly managing various application configurations.
In another exemplary embodiment, after receiving the object loading request sent by the client in step S210, the method further includes: detecting carried information of an object loading request; and under the condition that the object loading request does not carry the version identification corresponding to the object list currently displayed by the client and the object identification of the last object in the currently displayed object list, acquiring the object list of the version meeting the preset requirement from the configuration center as a target object list.
The version meeting the preset requirement may be the latest version.
In a specific implementation, the generation of the object collection requires that the server 104 periodically screen the screened objects meeting the preset conditions from a large number of object candidate sets, each time the screened objects obtained by screening can form a screened object list, each time one screened object list is obtained, the screened object list can be written into the configuration center, a version identifier is given to the screened object list, and different screened object lists obtained each time are marked by the version identifier, so that the configuration center storing the history object list and the version identifiers of the history object list is obtained.
Further, after receiving the object loading request sent by the client 102, the server 104 may detect information carried by the object loading request, that is, detect whether the object loading request carries a version identifier corresponding to the object list currently displayed by the client 102 and an object identifier of a last object in the object list currently displayed, thereby determining whether the client 102 is an object loading request sent for continuing browsing in the process of browsing a page or an object loading request sent by entering the current page for the first time.
More specifically, if the object loading request carries the version identifier corresponding to the object list currently displayed by the client 102 and the object identifier of the last object in the currently displayed object list, which indicate that the client 102 is an object loading request sent for continuing browsing in the page browsing process, at this time, the configuration center 106 of the stored history object list may be queried based on the version identifier and the object identifier, and the target history object list corresponding to the object list currently displayed by the client 102 and the position of the last object in the target history object list are determined, so as to determine the target object list to be returned to the client 102.
If the object loading request does not carry the version identifier corresponding to the object list currently displayed by the client 102 and the object identifier of the last object in the currently displayed object list, indicating that the client 102 is the object loading request sent for entering the current page for the first time, the object list of the latest version is obtained from the configuration center 106 at this time as the target object list.
In step S230, the target object list is returned to the client.
In a specific implementation, after the server 104 determines the target object list from the configuration center 106, the target object list may be sent to the client 102, so that the client 102 displays the target object list for the user to view.
In the object obtaining method, the server is recorded in the configuration center to obtain the object lists through regular screening, the corresponding version identification is given to each object list, and then when an object loading request sent by the client is received, the object list currently displayed by the client and the last object displayed in the object list can be determined according to the version identification of the object list currently displayed by the client and the object identification of the last object in the currently displayed object list carried by the object loading request, so that objects which are not displayed in the currently displayed object list can be accurately determined from the configuration center, the object list formed by the objects which are not returned is used as the target object list and is returned to the client, a user can continuously browse the objects which are not displayed in the currently displayed object list, and the phenomenon that the objects returned to the client are repeated with the objects displayed by the client and the page breaking is avoided.
In an exemplary embodiment, as shown in fig. 3, in step S220, a preset configuration center is queried based on the version identifier and the object identifier to obtain a target object list, which may specifically be implemented by the following steps:
step S221, based on the version identification, determining a target historical object list corresponding to the object list currently displayed by the client from the historical object lists stored in the configuration center;
step S222, screening out other objects behind the object corresponding to the object identifier from the target historical object list;
step S223, obtaining a target object list according to other objects.
In a specific implementation, the objects displayed by the client each time are from the configuration center, and therefore, a history object list corresponding to the object list currently displayed by the client can be determined from the configuration center based on the version identifier of the object list currently displayed by the client, and is used as a target history object list, that is, a history object list in the configuration center, in which the version identifier is the same as the version identifier of the object list currently displayed by the client, is used as the target history object list. Then, other objects behind the object corresponding to the object identification are screened out from the target history object list, and the other objects are formed into a target object list.
For example, if 30 objects are set to be returned to the client each time, 30 objects from the previous to the next in the target history object list need to be screened out to form the target object list.
It should be noted that, when the object identifier of the last object in the object list currently displayed by the client carried in the object loading request is the same as the object identifier of the last object in the target history object list, it indicates that all the objects in the target history object list have been displayed at the client, that is, other objects are zero, and at this time, the object list of the latest version in the configuration center may be obtained, and returned to the client as the target object list.
In this embodiment, a target history object list corresponding to the object list currently displayed by the client is determined from the configuration center according to the version identifier, and then a corresponding position of the last object displayed by the client in the target history object list is determined, so that objects not displayed in the object list currently displayed by the client can be accurately determined from the configuration center, and an object list formed by objects not returned is used as the target object list and returned to the client, so that a user can continue to browse the objects not displayed in the object list currently displayed, thereby avoiding the phenomenon that the objects returned to the client are repeated with the objects displayed by the client and a page is broken.
In an exemplary embodiment, the object obtaining method further includes: and under the condition that the configuration center does not have the version identification corresponding to the object list currently displayed by the client, acquiring the object list of the version meeting the preset requirement from the configuration center as a target object list.
In a specific implementation, after the object loading request carries the version identifier corresponding to the object list currently displayed by the client, if the configuration center does not have the version identifier corresponding to the object list currently displayed by the client, that is, when the historical object list corresponding to the object list currently displayed by the client is not found from the configuration center, the object list of the latest version can be obtained from the configuration center, and is used as the target object list and returned to the client.
In this embodiment, in consideration of the situation that the object loading request carries the version identifier corresponding to the object list currently displayed by the client but no corresponding historical object list exists in the configuration center, a solution is provided in which the object list of the latest version is used as the target object list and returned to the client, so as to avoid the situation that the client has no object to display.
In an exemplary embodiment, the object obtaining method further includes:
step S310, regularly screening a screened object list meeting preset conditions from the candidate objects, and generating a version identifier aiming at the screened object list;
step S320, writing the filtered object list and the version identifier of the filtered object list into the configuration center, and using the filtered object list and the version identifier corresponding to the history object list stored in the configuration center as the configuration center.
In a specific implementation, the candidate objects may be continuously updated, so that, to ensure that the latest objects meeting the preset condition can be returned to the client, a timing task (for example, timing for 1 time in 10 minutes) may be set to enable the server to periodically screen the screened objects meeting the preset condition from the candidate objects, and the screened objects obtained each time may form a screened object list, and when one screened object list is obtained each time, the screened object list may be written into the configuration center, and a version is generated, the screened object list is given, and different screened object lists obtained each time are marked by the version identifier, so as to obtain the configuration center storing the version identifiers of the history object list and the history object list.
In this embodiment, the filtered object list obtained by the timing filtering and the version identifier of the filtered object list are written into the configuration center, and thus, sending a non-repetitive target object list to each client can be realized without using Mysql (a relational database) to perform separate storage and recording which objects are issued for each client, and consumption of storage resources is reduced.
Further, in an exemplary embodiment, the step S310 of periodically screening a filtered object list meeting a preset condition from the candidate objects, and generating a version identifier for the filtered object list includes:
step S3101, determining, for each screened object list screened, a version identification of the previously screened object list;
step S3102, an operation is performed on the version id of the filtered object list that was filtered last time to obtain the version id of the filtered object list that is currently filtered.
In a specific implementation, the version identifier may be named by a serial number, for example, if the version identifier of the filtered object list that is filtered last time is set to 2.0, when the version identifier of the filtered object list that is currently filtered is determined, the version identifier of the filtered object list that is filtered last time may be incremented by one to obtain 3.0, which is used as the version identifier of the filtered object list that is currently filtered.
In this embodiment, an operation of adding one to the version identifier of the filtered object list that was filtered last time is performed to obtain
The version identifications of the object lists after being screened at present are different from 5 version identifications of the object lists obtained by screening each time, so that different object lists can be marked, and one adding operation is convenient for determining the most stored version identifications in the configuration center
When the object list of the new version is available, the object list with the largest version identification can be used as the object list of the latest version.
In an exemplary embodiment, the filtered object list and the version identifier of the filtered object list are identified in step S320
A write configuration center comprising:
step S3201, obtaining a storage threshold value of the configuration center and the number of current storage lists of the configuration center;
in step S3202, when the number of current storage lists is equal to the storage threshold, the filtered object list is added to the configuration center, and the object list with the earliest storage time in the current storage list is deleted.
In the concrete implementation, in order to reduce the occupation of the object list to the storage resource of the configuration center, a storage threshold value can be set,
and controlling the number of the object lists stored by the configuration center within a storage threshold value range. More specifically, after each new version of the filtered object list of 5 copies is obtained, the number of current storage lists of the configuration center may be determined, and if the number of current storage lists is equal to the number of current storage lists
And storing the threshold value, if the new version of the filtered object list is stored in the configuration center, the object list stored in the configuration center exceeds the storage threshold value, so that the object list with the earliest storage time, namely the lowest version, in the object list currently stored in the configuration center can be deleted while the new version of the filtered object list is stored in the configuration center, so that the number of the object lists stored in the configuration center is maintained within the range of the storage threshold value.
In this embodiment, when the number of object lists currently stored in the configuration center is equal to the storage threshold, the filtering is performed
And when the rear object list is added to the configuration center, deleting the object list with the earliest storage time in the current storage list, so that the number of the object lists stored in the configuration center is maintained within a storage threshold range, and the object lists stored in the configuration center are kept to be the latest versions while the occupation of the object lists on the storage resources of the configuration center is reduced.
In an exemplary embodiment, to facilitate an understanding of the disclosed embodiments by those of ordinary skill in the art, reference will now be made to the specific examples illustrated in the drawings.
Referring to fig. 4.1, a schematic flowchart of writing an object to a configuration center in an embodiment includes the following steps:
step S410, regularly screening a screened object list meeting preset conditions from the candidate objects;
step S420, aiming at the screened object list screened each time, determining the version identification of the screened object list screened last time;
step S430, adding one to the version identification of the screened object list screened last time to obtain the version identification of the screened object list screened currently;
step S440, acquiring a storage threshold value of a configuration center and the number of current storage lists of the configuration center;
and step S450, when the number of the current storage lists is equal to the storage threshold value, adding the screened object lists to the configuration center, and deleting the object list with the earliest storage time in the current storage lists.
For example, as shown in fig. 4.2, taking the candidate object as the video template as an example, the process of writing the video template into the configuration center is as follows: and according to a timing task, screening the candidate set of the video template IDs once every 10 minutes to obtain legal video template IDs, using the legal video template IDs as a screened template ID list, generating a version identifier for the screened template ID list, and storing the screened template ID list and the version identifier of the screened template ID list to a configuration center.
Referring to fig. 5.1, a schematic flowchart of an embodiment of a process for reading an object from a configuration center includes the following steps:
step S510, receiving an object loading request sent by a client, and detecting information carried by the object loading request;
step S520, under the condition that the object loading request does not carry the version identification corresponding to the object list currently displayed by the client and the object identification of the last object in the currently displayed object list, acquiring the object list of the version meeting the preset requirement from the configuration center as a target object list;
step S530, under the condition that the object loading request carries the version identification corresponding to the object list currently displayed by the client and the object identification of the last object in the currently displayed object list, inquiring a preset configuration center based on the version identification and the object identification to obtain a target object list;
step S540, under the condition that the configuration center does not have the version identification corresponding to the object list currently displayed by the client, acquiring the object list of the version meeting the preset requirement from the configuration center as a target object list;
step S550 returns the target object list to the client.
For example, as shown in fig. 5.2, still taking the candidate object as the video template as an example, the process of reading the target template list from the configuration center is as follows: when a template loading request sent by a client is received, analyzing the carried information of the template loading request, acquiring a version identifier corresponding to a template list currently displayed by the client and a template ID of the last template in the template list currently displayed, and inquiring a configuration center according to the version identifier. If the configuration center does not have the version identifier or the template loading request does not carry the version identifier (namely the client sends the template loading request for the first time), the template ID list of the latest version is obtained, a return result is constructed and returned to the client. If the version identification exists in the configuration center, determining the position of the last template in the template list currently displayed by the client in a target historical template ID list corresponding to the configuration center and the target historical template ID list, screening unreturned template IDs from the target historical template ID list to form a target template ID list, constructing a return result, and returning the return result to the client. The constructed return result comprises the version identification of the target template ID list and the template ID of each template in the target template ID list.
The method provided by the embodiment has the following beneficial effects: (1) A multi-version data deduplication mode is used, and a template list issued for each equipment id is not required to be recorded; (2) The duplication removal of the scheme is simple to realize, the phenomenon of page breaking can not occur, meanwhile, the distributed cache Redis is not needed, and the network overhead and the storage of the Redis are reduced; (3) The data is stored in the configuration center without using Mysql separate storage.
It should be understood that, although the steps in the flowcharts related to the embodiments as described above are sequentially displayed as indicated by arrows, the steps are not necessarily performed sequentially as indicated by the arrows. The steps are not limited to being performed in the exact order illustrated and, unless explicitly stated herein, may be performed in other orders. Moreover, at least a part of the steps in the flowcharts related to the embodiments described above may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, and the execution order of the steps or stages is not necessarily sequential, but may be rotated or alternated with other steps or at least a part of the steps or stages in other steps.
It is understood that the same/similar parts among the various embodiments of the method described above in this specification can be referred to each other, and each embodiment focuses on the differences from the other embodiments, and where relevant, reference may be made to the description of the other method embodiments.
Based on the same inventive concept, the embodiment of the present disclosure further provides an object obtaining apparatus for implementing the object obtaining method.
Fig. 6 is a block diagram illustrating a structure of an object acquisition apparatus according to an exemplary embodiment. Referring to fig. 6, the apparatus includes:
a receiving unit 610 configured to perform receiving an object loading request sent by a client;
the query unit 620 is configured to query a preset configuration center based on a version identifier and an object identifier to obtain a target object list when the object loading request carries the version identifier corresponding to the object list currently displayed by the client and the object identifier of the last object in the currently displayed object list; the configuration center stores a history object list obtained by the server through timing screening and a version identifier corresponding to the history object list;
a returning unit 630 configured to perform returning the target object list to the client.
In an exemplary embodiment, each object in the history object list has a corresponding object identification; the query unit 620 is specifically configured to determine, based on the version identifier, a target history object list corresponding to an object list currently displayed by the client from history object lists stored in the configuration center; screening out other objects behind the object corresponding to the object identifier from the target historical object list; and obtaining a target object list according to other objects.
In an exemplary embodiment, the querying unit 620 is further configured to perform detecting carried information of the object loading request; and under the condition that the object loading request does not carry the version identification corresponding to the object list currently displayed by the client and the object identification of the last object in the currently displayed object list, acquiring the object list of the version meeting the preset requirement from the configuration center as a target object list.
In an exemplary embodiment, the querying unit 620 is further configured to, in a case that the configuration center does not have a version identifier corresponding to the object list currently presented by the client, obtain, from the configuration center, an object list of a version meeting preset requirements as the target object list.
In an exemplary embodiment, the apparatus further comprises:
the screening unit is configured to screen a screened object list meeting preset conditions from the candidate objects at regular time and generate a version identifier for the screened object list;
and the writing unit is configured to write the filtered object list and the version identification of the filtered object list into the configuration center, and the filtered object list and the version identification correspond to the history object list and the version identification corresponding to the history object list stored as the configuration center.
In an exemplary embodiment, the screening unit is further configured to perform determining, for each screened object list screened, a version identification of a previously screened object list; and executing an adding operation on the version identification of the screened object list screened last time to obtain the version identification of the screened object list screened currently.
In an exemplary embodiment, the writing unit is further configured to perform obtaining a storage threshold of the configuration center and a current storage list number of the configuration center; and when the number of the current storage lists is equal to the storage threshold value, adding the screened object lists to the configuration center, and deleting the object list with the earliest storage time in the current storage list.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Fig. 7 is a block diagram illustrating an electronic device 700 for implementing an object acquisition method according to an example embodiment. For example, the electronic device 700 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a gaming console, a tablet device, a medical device, an exercise device, a personal digital assistant, and so forth.
Referring to fig. 7, electronic device 700 may include one or more of the following components: processing component 702, memory 704, power component 706, multimedia component 708, audio component 710, input/output (I/O) interface 712, sensor component 714, and communication component 716.
The processing component 702 generally controls overall operation of the electronic device 700, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing component 702 may include one or more processors 720 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 702 may include one or more modules that facilitate interaction between the processing component 702 and other components. For example, the processing component 702 may include a multimedia module to facilitate interaction between the multimedia component 708 and the processing component 702.
The memory 704 is configured to store various types of data to support operations at the electronic device 700. Examples of such data include instructions for any application or method operating on the electronic device 700, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 704 may be implemented by any type or combination of volatile or non-volatile storage devices, such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, optical disk, or graphene memory.
The power supply component 706 provides power to the various components of the electronic device 700. The power components 706 may include a power management system, one or more power sources, and other components associated with generating, managing, and distributing power for the electronic device 700.
The multimedia component 708 includes a screen providing an output interface between the electronic device 700 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 708 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 700 is in an operation mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 710 is configured to output and/or input audio signals. For example, the audio component 710 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 700 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signal may further be stored in the memory 704 or transmitted via the communication component 716. In some embodiments, audio component 710 also includes a speaker for outputting audio signals.
The I/O interface 712 provides an interface between the processing component 702 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 714 includes one or more sensors for providing various aspects of status assessment for the electronic device 700. For example, the sensor assembly 714 may detect an open/closed state of the electronic device 700, the relative positioning of components, such as a display and keypad of the electronic device 700, the sensor assembly 714 may also detect a change in position of the electronic device 700 or components of the electronic device 700, the presence or absence of user contact with the electronic device 700, the device 700
Orientation or acceleration/deceleration and temperature changes of the electronic device 700. The sensor assembly 714 may include a proximity sensor configured 5 to detect the presence of a nearby object without any physical contact. The sensor assembly 714 may also include optical transmission
Sensors, such as CMOS or CCD image sensors, are used in imaging applications. In some embodiments, the sensor assembly 714 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor. The communication component 716 is configured to facilitate wired or wireless communication between the electronic device 700 and other devices. Electric power
The kid device 700 may access a wireless network based on a communication standard, such as WiFi, an operator network (such as 2G, 3G, 4G, or 0 5G), or a combination thereof. In an exemplary embodiment, the communication component 716 receives information from outside via a broadcast channel
Broadcast signals or broadcast related information of a broadcast management system. In an exemplary embodiment, the communication component 716 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 700 may be implemented as one or more Application Specific Integrated Circuits (ASICs), arrays, or the like
A Digital Signal Processor (DSP), digital Signal Processing Device (DSPD), programmable Logic Device (PLD), field Programmable Gate Array (FPGA), controller, microcontroller, microprocessor or other electronic component implementation to perform the above-described methods.
In an exemplary embodiment, a computer-readable storage medium comprising instructions, such as the memory 704 comprising instructions 0, executable by the processor 720 of the electronic device 700 to perform the above-described method is also provided. For example, meters
The computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
In an exemplary embodiment, a computer program product is also provided that includes instructions executable by the processor 720 of the electronic device 700 to perform the above-described method.
It should be noted that the descriptions of the above-mentioned apparatus, the electronic device, the computer-readable storage medium, the computer program product, and the like according to the method embodiments may also include other embodiments, and specific implementations may refer to the descriptions of the related method embodiments, which are not described in detail herein.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. An object acquisition method, comprising:
receiving an object loading request sent by a client;
under the condition that the object loading request carries a version identifier corresponding to the object list currently displayed by the client and an object identifier of the last object in the currently displayed object list, inquiring a preset configuration center based on the version identifier and the object identifier to obtain a target object list; the configuration center stores a history object list obtained by the server through timing screening and a version identifier corresponding to the history object list;
and returning the target object list to the client.
2. The method of claim 1, wherein each object in the list of historical objects has a corresponding object identification; querying a preset configuration center based on the version identifier and the object identifier to obtain a target object list, including:
determining a target historical object list corresponding to the object list currently displayed by the client from the historical object list stored in the configuration center based on the version identification;
screening out other objects behind the object corresponding to the object identifier from the target historical object list;
and obtaining the target object list according to the other objects.
3. The method according to claim 1, wherein after receiving the object loading request sent by the client, the method further comprises:
detecting carried information of the object loading request;
and under the condition that the object loading request does not carry the version identification corresponding to the object list currently displayed by the client and the object identification of the last object in the currently displayed object list, acquiring the object list of the version meeting the preset requirement from the configuration center as the target object list.
4. The method of claim 1, further comprising:
and under the condition that the configuration center does not have the version identification corresponding to the object list currently displayed by the client, acquiring the object list of the version meeting the preset requirement from the configuration center as the target object list.
5. The method of claim 1, further comprising:
regularly screening a screened object list meeting preset conditions from the candidate objects, and generating a version identifier aiming at the screened object list;
and writing the screened object list and the version identification of the screened object list into the configuration center, and correspondingly serving as the historical object list stored by the configuration center and the version identification corresponding to the historical object list.
6. The method of claim 5, wherein the timing is to screen a filtered object list meeting a preset condition from the candidate objects, and generate a version identifier for the filtered object list, and includes:
aiming at the screened object list screened each time, determining the version identification of the screened object list screened last time;
and executing an operation of adding one to the version identification of the screened object list screened last time to obtain the version identification of the screened object list screened currently.
7. The method of claim 5, wherein writing the filtered object list and the version identifier of the filtered object list to the configuration center comprises:
acquiring a storage threshold value of the configuration center and the number of current storage lists of the configuration center;
and when the number of the current storage lists is equal to the storage threshold value, adding the screened object lists to the configuration center, and deleting the object list with the earliest storage time in the current storage lists.
8. An object acquisition apparatus, comprising:
the receiving unit is configured to execute the object loading request sent by the receiving client;
the query unit is configured to query a preset configuration center based on the version identifier and the object identifier to obtain a target object list under the condition that the object loading request carries the version identifier corresponding to the object list currently displayed by the client and the object identifier of the last object in the currently displayed object list; the configuration center stores a history object list obtained by the server through timing screening and a version identifier corresponding to the history object list;
a returning unit configured to perform returning the target object list to the client.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the object acquisition method of any one of claims 1 to 7.
10. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the object acquisition method of any of claims 1-7.
CN202310007454.0A 2023-01-04 2023-01-04 Object acquisition method and device, electronic equipment and storage medium Pending CN115964101A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310007454.0A CN115964101A (en) 2023-01-04 2023-01-04 Object acquisition method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310007454.0A CN115964101A (en) 2023-01-04 2023-01-04 Object acquisition method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115964101A true CN115964101A (en) 2023-04-14

Family

ID=87352955

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310007454.0A Pending CN115964101A (en) 2023-01-04 2023-01-04 Object acquisition method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115964101A (en)

Similar Documents

Publication Publication Date Title
CN112272302A (en) Multimedia resource display method, device, system and storage medium
CN111405302B (en) Live broadcast room attention reminding method and device, electronic equipment and storage medium
CN106919629B (en) Method and device for realizing information screening in group chat
CN104462296B (en) File management method and device and terminal
CN109388625B (en) Method and device for processing configuration file in multi-distributed file system
CN113259226B (en) Information synchronization method and device, electronic equipment and storage medium
CN111246278B (en) Video playing method and device, electronic equipment and storage medium
CN113254784A (en) Information display method and device, electronic equipment and storage medium
CN107402767B (en) Method and device for displaying push message
US11797218B2 (en) Method and device for detecting slow node and computer-readable storage medium
CN113901241A (en) Page display method and device, electronic equipment and storage medium
CN114666175B (en) Message processing method, device, electronic equipment and storage medium
CN107463419B (en) Application restarting method and device and computer readable storage medium
CN115422203A (en) Data management method, device, equipment and medium for block chain distributed system
CN115964101A (en) Object acquisition method and device, electronic equipment and storage medium
CN114239531A (en) Template recommendation method and device, electronic equipment and storage medium
CN113992923A (en) Live broadcast list issuing method and device
CN112102009A (en) Advertisement display method, device, equipment and storage medium
CN111241134B (en) Data processing method and device
CN112182455B (en) Page display method, device, electronic equipment and storage medium
CN113110814B (en) Screen display data processing method, device and storage medium
CN111241097B (en) Method for processing object, device for processing object and storage medium
CN111625536B (en) Data access method and device
CN114238728B (en) Vehicle data processing method, device and equipment
CN109710146B (en) Document display 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