WO2021087981A1 - 标签数据的更新方法、装置、电子设备及存储介质 - Google Patents

标签数据的更新方法、装置、电子设备及存储介质 Download PDF

Info

Publication number
WO2021087981A1
WO2021087981A1 PCT/CN2019/116700 CN2019116700W WO2021087981A1 WO 2021087981 A1 WO2021087981 A1 WO 2021087981A1 CN 2019116700 W CN2019116700 W CN 2019116700W WO 2021087981 A1 WO2021087981 A1 WO 2021087981A1
Authority
WO
WIPO (PCT)
Prior art keywords
tag data
data
updated
priority
tag
Prior art date
Application number
PCT/CN2019/116700
Other languages
English (en)
French (fr)
Inventor
黄江伟
Original Assignee
深圳市欢太科技有限公司
Oppo广东移动通信有限公司
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 深圳市欢太科技有限公司, Oppo广东移动通信有限公司 filed Critical 深圳市欢太科技有限公司
Priority to CN201980100128.6A priority Critical patent/CN114365112A/zh
Priority to PCT/CN2019/116700 priority patent/WO2021087981A1/zh
Publication of WO2021087981A1 publication Critical patent/WO2021087981A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating

Definitions

  • This application relates to the field of data processing technology, and more specifically, to a method, device, electronic device, and storage medium for updating tag data.
  • Information recommendation technology uses user tags to recommend related information.
  • the accuracy of user tags affects the accuracy of information recommendation. Therefore, the update of tag data of user tags has become the key to the information recommendation technology.
  • this application proposes a method, device, electronic device and storage medium for updating tag data.
  • an embodiment of the present application provides a method for updating label data.
  • the method includes: when updating label data, obtaining the priority corresponding to each label data among the plurality of label data to be updated.
  • the level is determined according to the real-time level of the tag data when it is updated; the order of updating the multiple tag data is determined according to the priority corresponding to each tag data;
  • the label data is updated.
  • an embodiment of the present application provides a device for updating tag data.
  • the device includes: a priority acquiring module, a sequence acquiring module, and a data updating module.
  • the priority acquiring module is used to update the tag data.
  • the priority level corresponding to each tag data in the multiple tag data to be updated is acquired, and the priority level is determined according to the real-time level of the tag data when the tag data is updated;
  • the priority corresponding to the tag data determines the update sequence of the multiple tag data;
  • the data update module is configured to update each tag data according to the update sequence.
  • an embodiment of the present application provides an electronic device, including: one or more processors; a memory; one or more application programs, wherein the one or more application programs are stored in the memory and It is configured to be executed by the one or more processors, and the one or more programs are configured to execute the method for updating tag data provided in the first aspect described above.
  • an embodiment of the present application provides a computer-readable storage medium.
  • the computer-readable storage medium stores program code, and the program code can be called by a processor to execute the tag provided in the first aspect. How to update the data.
  • the solution provided by this application obtains the priority corresponding to each tag data among the multiple tag data to be updated when the tag data is updated.
  • the priority is determined according to the real-time level of the tag data when the tag data is updated, and according to each tag data
  • Corresponding priority determine the update order of multiple tag data, update each tag data according to the update order, so that the order of tag data update corresponds to its priority, so that the tag with a higher real-time level Data can be updated first, and the update speed of tag data with higher real-time level can be accelerated.
  • Fig. 1 shows a flowchart of a method for updating tag data according to an embodiment of the present application.
  • Fig. 2 shows a flowchart of a method for updating tag data according to another embodiment of the present application.
  • FIG. 3 shows a flowchart of step S210 in the method for updating tag data provided by another embodiment of the present application.
  • FIG. 4 shows another flowchart of step S210 in the method for updating tag data provided by another embodiment of the present application.
  • Fig. 5 shows a flowchart of a method for updating tag data according to another embodiment of the present application.
  • Fig. 6 shows a flowchart of a method for updating tag data according to another embodiment of the present application.
  • FIG. 7 shows a flowchart of step S420 in the method for updating tag data in another embodiment provided by the present application.
  • Fig. 8 shows a block diagram of a device for updating tag data according to an embodiment of the present application.
  • Fig. 9 shows a block diagram of the priority acquiring module in the device for updating tag data according to an embodiment of the present application.
  • Fig. 10 is a block diagram of an electronic device for executing the method for updating tag data according to an embodiment of the present application according to an embodiment of the present application.
  • Fig. 11 is a storage unit for storing or carrying program code implementing the method for updating tag data according to the embodiment of the present application according to an embodiment of the present application.
  • information recommendation technology based on big data technology can recommend content that people need, which can better meet the needs of users.
  • people can use the Internet to shop, entertain, and publish personal status information (for example, Weibo), etc.
  • Merchants can obtain people’s consumption, entertainment, and personal status information through the Internet, which can provide a more comprehensive understanding of the public’s information.
  • User tags are mainly data used to reflect information such as users' social attributes, living habits, and consumption behaviors, and user tags are feature identifiers obtained by analyzing user information. User tags can ensure accuracy of user tags by continuously updating tag data.
  • the tag data is mainly stored in the database.
  • the tag data will be regularly written, and the full data will be written into the database during the update, so as to ensure that the user's tag data can have the latest data, and the user's tag system can be updated and updated. Optimization makes the user portrait closer to the real situation of the user.
  • the inventors proposed the method, device, electronic device, and storage medium for updating tag data provided by the embodiments of the present application.
  • the priority of each tag data among the plurality of tag data to be updated according to the priority Sort the update order of the tag data, and finally update each tag data according to the sorted update order to ensure that the tag data with high priority can be updated first, so that the tag data with high real-time level can be updated as soon as possible.
  • the timeliness of label data Among them, the specific method for updating the tag data will be described in detail in the subsequent embodiments.
  • FIG. 1 shows a schematic flowchart of a method for updating tag data provided by an embodiment of the present application.
  • the method for updating label data is used to sort the update sequence of the label data according to the priority of each label data in the plurality of label data to be updated, and finally sort each label data according to the sorted update sequence.
  • Each tag data is updated to ensure that the tag data with high priority can be updated first, so that the tag data with high real-time level can be updated as soon as possible to ensure the timeliness of the tag data.
  • the tag data updating method is applied to the tag data updating device 400 as shown in FIG. 8 and the electronic device 100 configured with the tag data updating device 400 (FIG. 10 ).
  • the electronic device applied in this embodiment may be a server, a mobile terminal, etc., which is not limited herein.
  • the process shown in FIG. 1 will be described in detail below, and the method for updating label data may specifically include the following steps:
  • Step S110 When updating the tag data, obtain the priority corresponding to each tag data among the multiple tag data to be updated, the priority being determined according to the real-time level of the tag data when the tag data is updated.
  • tag data refers to data corresponding to the tag, and specifically may be user data corresponding to the tag.
  • the occupation of user A at the first moment is a student
  • the occupation at the second moment is a teacher.
  • the data corresponding to the occupation in the label of user A is student.
  • the label of user A The data corresponding to the middle occupation is teachers. Since the user’s label data is changing over time, it is necessary to continuously update the user’s label data so that the user’s label data can match the user’s latest status, so as to provide users with the ability to meet their needs based on the label data. Service.
  • the electronic device may update the tag data regularly or irregularly. For example, the electronic device may update the tag data every day.
  • the electronic device can obtain the tag data to be updated from one or more data sources.
  • the data source can be a server or a user's mobile terminal, which is not limited here. It is understandable that the electronic device can actively obtain the tag data to be updated from the data source, and the data source can also actively send the tag data to be updated to the electronic device, which is not limited here.
  • the label data to be updated refers to the obtained label data that needs to be written into the label data database, and can also be understood as the label data used to update the user label.
  • the electronic device when the electronic device is updating the tag data, it can determine the priority corresponding to each tag data among the multiple tag data to be updated, so that the tag can be subsequently adjusted according to the priority corresponding to each tag data.
  • the data is updated in the order of update.
  • the priority corresponding to each tag data can be determined according to the real-time level of the tag data when it is updated.
  • the real-time level of tag data when it is updated may refer to the level of real-time demand for tag data when it is updated. The higher the real-time level, the more real-time the tag data needs to be updated. It is understandable that the electronic device can identify the real-time level of the tag data when it is updated, so as to determine the priority corresponding to the tag data according to the real-time level corresponding to the tag data.
  • the real-time level of the tag data when it is updated is proportional to the priority corresponding to the tag data, that is, the higher the real-time level of the tag data when it is updated, the priority corresponding to the tag data Higher.
  • the real-time level of tag data when it is updated includes level 1, level 2, and level 3.
  • the real-time level of level 1, level 2, and level 3 are sequentially reduced, and the priority levels include priority 1, priority 2, and priority 3.
  • Priority 1, Priority 2, and Priority 3 are the descending order of priority, then level 1 corresponds to priority 1, level 2 corresponds to priority 2, and level 3 corresponds to priority 3.
  • the above are only examples, and do not represent a limitation on the relationship between specific real-time levels and priorities.
  • the higher the real-time level of the tag data when it is updated the higher the real-time demand of the tag data when it is updated, which can also be understood as the higher the timeliness.
  • the location tag data is used to update
  • the real-time requirements of the user’s age are high, and the label data of the user’s age and the label data of the user’s gender are updated in real-time. Therefore, the real-time level of the label data of the user’s location is greater than the real-time level of the label data of the user’s age.
  • the real-time level of the tag data of the user's gender the real-time level of the tag data of the user's gender.
  • the real-time level of different tag data when it is updated can be stored in the electronic device in advance.
  • the electronic device can determine the tag by identifying the type of tag data, the data source of the tag data, the user identification corresponding to the tag data, etc.
  • the real-time level of the data when it is updated can be stored in the electronic device in advance.
  • Step S120 Determine the update sequence of the multiple tag data according to the priority corresponding to each tag data.
  • the electronic device after the electronic device obtains the priority corresponding to each tag data among the plurality of tag data to be updated, it can perform processing on the multiple tag data to be updated according to the priority corresponding to each tag data.
  • the order of the update sequence is sorted so that the update sequence of the tag data when it is updated can correspond to the priority.
  • the electronic device can sort the multiple tag data in sequence in the order of priority from high to low, so as to obtain the update sequence of the multiple tag data to be updated in progress. It is understandable that the higher the priority of the tag data, the higher the tag data is in the update sequence, so as to ensure that when multiple tag data is updated, the earlier the tag with the higher priority can be updated. The data is updated.
  • Step S130 Update each tag data according to the update sequence.
  • the electronic device may update each tag data among the plurality of tag data to be updated according to the determined update sequence.
  • the electronic device can sequentially write the tag data into the tag data database according to the update sequence.
  • the electronic device when the electronic device updates the tag data, it can compare the tag data with all tag data corresponding to the user identification currently stored according to the user identification corresponding to the tag data, so as to determine to write the tag data.
  • the tag data Into the label data corresponding to the user identification, or when writing the label data into the label data corresponding to the user identification, part of the label data is deleted, that is, the label data is replaced with part of the label data.
  • the method for updating tag data obtains the priority corresponding to each tag data among the plurality of tag data to be updated when the tag data is updated, and the priority is determined according to the real-time level of the tag data when the tag data is updated. , According to the priority corresponding to each tag data, determine the update sequence of multiple tag data, and update each tag data according to the update sequence, thereby ensuring that the tag data with high priority can be updated first, so that real-time The label data with high sex level can be updated as soon as possible to ensure the timeliness of the label data.
  • FIG. 2 shows a schematic flowchart of a method for updating tag data provided by another embodiment of the present application.
  • the process shown in FIG. 2 will be described in detail below, and the method for updating label data may specifically include the following steps:
  • Step S210 When updating the tag data, obtain the priority corresponding to each tag data among the plurality of tag data to be updated, and the priority is determined according to the real-time level of the tag data when the tag data is updated.
  • the real-time level of tag data during update may correspond to the type of tag data, and the real-time level of tag data during update may also correspond to the user identification.
  • the electronic device determines the priority corresponding to the tag data, since the priority corresponding to the tag data is determined by the real-time level when the tag data is updated, it can be determined according to the type of the tag data or the user identification corresponding to the tag data.
  • step S210 may include:
  • Step S211A Obtain the type of each tag data in the plurality of tag data to be updated, and different types of tag data have different real-time levels when they are updated.
  • the type of tag data corresponds to the real-time level of the tag data when it is updated, and different types of tag data have different real-time levels when it is updated.
  • the types of label data can be divided into types with high real-time requirements and types with low real-time requirements.
  • the user’s real-time location, payment amount, and last active time can be used as the types with high real-time requirements, such as user age, user occupation, User gender etc. may not be regarded as types with low real-time demand.
  • the type of tag data is C1
  • its corresponding real-time level is D1
  • the type of tag data is C2
  • its corresponding real-time level is D2. If C1 is different from C2, D1 and D2 are also different.
  • the electronic device can obtain the type of each tag data in the plurality of tag data to be updated to determine the real-time level of the tag data when the tag data is updated according to the type of the tag data.
  • the type of each tag data can be pre-processed, and the tag data can be classified and stored.
  • the electronic device updates the tag data it can read the tag data and identify it to obtain the type of the tag data.
  • the electronic device updates the tag data periodically.
  • the electronic device can update the tag data every preset time interval. For example, the electronic device updates the tag data every 24 hours. Of course, the specific preset time duration may not be a limitation.
  • the electronic device regularly updates the label data. When the electronic device does not update the label data, the electronic device can obtain the label data to be updated from the data source and store the label data to be updated.
  • step S211A may include:
  • each tag data in the plurality of tag data Obtain the storage location of each tag data in the plurality of tag data to be updated; determine the type of each tag data according to the corresponding relationship between the storage location and the type of tag data, and the storage location of each tag data.
  • the electronic device when the electronic device does not update the tag data, the acquired tag data to be performed can be stored in the local disk of the electronic device, and different types of tag data can be correspondingly stored in different storage locations. Therefore, when the electronic device updates the tag data to be updated, it can determine the type of tag data according to the storage location of each tag data.
  • step S211A may include:
  • the tag data may include a type identification, and the type identification is in a setting field of the label data.
  • the electronic device can obtain the type identification of the label data by obtaining the data of the setting field in the label data. After the electronic device obtains the type identification of the tag data, it can determine the type of the tag data according to the type identification.
  • Step S212A Determine the priority corresponding to each tag data according to the type of each tag data.
  • the electronic device can determine the priority corresponding to the tag data according to the type of the tag data.
  • the types of tag data include type 1 and type 2.
  • the real-time level of tag data of type 1 when updated is higher than the real-time level of tag data of type 2 when updated, then type 1 corresponds to priority 1, type 2 Corresponds to priority 2, and priority 1 is higher than priority 2.
  • step S210 may include:
  • Step S211B Obtain a user identifier corresponding to each tag data in the plurality of tag data to be updated.
  • the real-time level of tag data corresponding to different users can be different when it is updated.
  • a newly registered user needs a large amount of user data as the basis for constructing user tags in order to serve users, so it needs to be timely.
  • the identity level of different users is different, and the real-time level of the tag data corresponding to the user is also different when it is updated.
  • the identity information corresponding to the user may be in the tag data in the form of user identification, and the electronic device may obtain the user identification corresponding to the tag data.
  • the user identifier may be International Mobile Equipment Identity (IMEI), user account OPENID, etc., which are not limited here.
  • Step S212B Determine the priority corresponding to each tag data according to the user identifier corresponding to each tag data.
  • step S22B may include: according to the user identification corresponding to each tag data, determining the real-time level of tag update corresponding to the user identification; and determining the real-time level according to the real-time level The priority of each tag data.
  • the user identification determines the priority corresponding to the tag data, so that when the real-time level of the tag data when the tag data is updated is related to the user identity, the obtained priority accuracy is high.
  • Step S220 Determine the update sequence of the multiple tag data according to the priority corresponding to each tag data.
  • step S220 may refer to the content of the foregoing embodiment, and details are not described herein again.
  • Step S230 Buffer each tag data in a buffer queue in sequence according to the update sequence, and the buffer queue is used to buffer the tag data currently being updated.
  • the electronic device can determine the update sequence, and when each tag data among the multiple tag data to be updated is updated, it can sequentially buffer each tag data in the buffer queue according to the update sequence.
  • the buffer queue may be a buffer queue established in the memory of the electronic device, and the buffer queue is used to buffer the tag data currently being updated. It is understandable that the principle of first-in, first-out and last-in-last-out is adopted in the buffer queue, so that the sequence of tag data entering the buffer queue when it is subsequently taken out for update can be compared with the sequence of buffering in the buffer queue (ie update Priority order) corresponding.
  • Step S240 Read each tag data according to the arrangement order of each tag data in the buffer queue, and update each tag data.
  • the electronic device can read each tag data in turn according to the arrangement order of the tag data in the buffer queue, and update each tag data, that is, the buffer queue is first-in, first-out, and last-in.
  • the last-out principle is to take out the tag data in sequence according to the arrangement order of the tag data in the buffer queue, and update the tag data, so that the update order of the tag data can correspond to the update sequence.
  • step S230 and step S240 in the embodiment of the present application can also be applied to other embodiments.
  • the tag data update method determines the priority of tag data according to the type of tag data or the user identifier corresponding to the tag data when multiple tag data to be updated are updated, and corresponds to each tag data
  • the priority of multiple tag data is determined, and each tag data is buffered into the buffer queue in turn according to the update order, and then the tag data is taken out from the buffer queue in turn, and the tag data is updated, thus ensuring
  • the tag data with high priority can be updated first, so that the tag data with high real-time level can be updated as soon as possible to ensure the timeliness of the tag data.
  • FIG. 5 shows a schematic flowchart of a method for updating tag data provided by another embodiment of the present application.
  • the following will elaborate on the process shown in FIG. 5, and the method for updating tag data may specifically include the following steps:
  • Step S310 When updating the tag data, obtain the priority corresponding to each tag data among the plurality of tag data to be updated, and the priority is determined according to the real-time level of the tag data when the tag data is updated.
  • step S310 can refer to the content of the foregoing embodiment, which will not be repeated here.
  • Step S320 Perform a difference comparison between the tag data corresponding to each user identifier in the plurality of tag data and the currently stored tag data corresponding to each user identifier to obtain a difference comparison result.
  • the electronic device may also preprocess the multiple tag data before the update sequence of the multiple tag data to be updated, so as to reduce the amount of data that is subsequently sorted and updated.
  • the obtained tag data to be updated may be the tag data that already exists in the tag database, that is, the tag data to be updated has the same tag data as the existing tag data. . Therefore, the electronic device can determine the user identification corresponding to each tag data in the plurality of tag data to be updated, and then compare the tag data corresponding to each user identification in the plurality of tag data with the tag corresponding to each user identification in the tag database. Data are compared for difference, and the result of difference comparison is obtained.
  • each tag data in the tag data to be updated can be compared with the currently stored tag data one by one, Determine whether each tag data is the same as the currently stored tag data.
  • the tag data already exists in the stored tag data; if it is different from the currently stored tag data, you can go further Compare whether there is label data of the category of label data to be updated in the currently stored label data corresponding to the user. For example, if the category of label data to be updated is an occupation category, it can be determined whether there is an occupation category; The label data of the category of the label data indicates that the label data to be updated is the label data used to update the label data of the category; if there is no label data of the category of the label data to be updated, it indicates that the label data to be updated The updated label data is the label data that needs to be added.
  • Step S330 According to the difference comparison result, determine the data change type of the tag data of each user relative to the currently stored tag data corresponding to each user identification.
  • the electronic device compares the tag data to be updated with the stored tag data, it can determine whether the tag data to be updated exists in the stored tag data according to the difference comparison result. If the tag data to be updated exists in the stored tag data, it means that the tag data has no change relative to the stored tag data, and the tag data to be updated needs to be deleted. If the label data to be updated does not exist in the stored label data, determine whether the label data to be updated is data that needs to be added, and whether the label data to be updated needs to be replaced with part of the stored label data In other words, the label data to be updated may be label data that needs to be added directly to the database, or it may be used to replace a certain label data in the database.
  • the currently stored label data of user A includes: gender is male, age is 36 years old, and the current location is in Shanghai, and the multiple label data to be updated this time include user A’s label data, and the label data is: occupation Is a lawyer, gender is male, and the current location is in Beijing, then "occupation is a lawyer” is the label data that needs to be added (added) to the database, "sex is male” is the label data that needs to be deleted, and "current location is in Beijing” is Replace the label data of "The current location is in Shanghai”.
  • Step S340 When there is first target tag data whose data change type is a deletion type, delete the first target tag data from the plurality of tag data.
  • the electronic device after the electronic device compares the tag data to be updated with the stored tag data, and determines the data change type of the tag data to be updated based on the difference comparison, it can, according to the data change type, Determine whether to delete the label data from the label data to be updated. Specifically, it can be determined whether the data change type of each label data is the deletion type. If there is a first target label whose data change type is the deletion type in multiple label data Data, the first target label data can be deleted from the multiple label data. It is understandable that after deleting the first target tag data from the plurality of tag data to be updated, the processing amount of the tag data to be subsequently processed can be reduced, and the update speed and efficiency can be improved.
  • Step S350 Determine an update sequence of the multiple tag data according to the priority corresponding to each tag data.
  • step S350 can refer to the content of the foregoing embodiment, and will not be repeated here.
  • Step S360 Update each tag data according to the update sequence.
  • the electronic device when the electronic device updates each tag data, it can directly update the tag data according to the data change type obtained in step S330.
  • step S360 may include: when each tag data is updated according to the update sequence, obtaining the target user identifier corresponding to the current tag data currently being updated; and according to the data change type, The current tag data is added to the currently stored tag data of the target user identification, or at least part of the tag data in the tag data of the target user identification is replaced with the tag data.
  • the data change type of the current label data is a new type
  • the current label data can be added to the currently stored label data of the target user identification
  • the data change type of the current label data is a replacement type, you can The current label data is replaced with at least part of the label data currently stored in the label data of the target user identification.
  • the current tag data currently being updated may refer to the tag data being processed by the electronic device in the process of updating the tag data. Therefore, the difference between the tag data to be updated and the stored tag data in step S320 and step S330 can be compared, which not only reduces the processing amount of the electronic device, but also facilitates the processing when the tag data is updated.
  • step S320, step S330, and step S360 in the embodiment of the present application can also be applied to other embodiments.
  • the method for updating label data determines the priority of label data according to the real-time level of label data when updating multiple label data to be updated, and determines the priority of label data according to the corresponding value of each label data. Priority, then compare the label data to be updated with the stored label data, and filter the label data to be updated according to the difference comparison result, reduce the amount of label data to be updated, and improve the processing efficiency of electronic equipment . Then determine the update order of multiple tag data, and update the tag data according to the update order, so as to ensure that the tag data with high priority can be updated first, so that the tag data with high real-time level can be updated as soon as possible to ensure Timeliness of label data.
  • FIG. 6 shows a schematic flowchart of a method for updating tag data provided by another embodiment of the present application.
  • the process shown in FIG. 6 will be described in detail below, and the method for updating label data may specifically include the following steps:
  • Step S410 When updating the tag data, obtain the priority corresponding to each tag data among the plurality of tag data to be updated, and the priority is determined according to the real-time level of the tag data when the tag data is updated.
  • step S410 may refer to the content of the foregoing embodiment, which will not be repeated here.
  • the high and low order of the priority corresponds to the high and low order of the real-time level of the tag data when it is updated. It can be understood that the higher the real-time level of the tag data when it is updated, the higher the priority corresponding to the tag data.
  • Step S420 Compress the tag data of the same user identification in the multiple tag data.
  • the electronic device may also preprocess the multiple tag data before the update sequence of the multiple tag data to be updated, so as to reduce the amount of data that is subsequently sorted and updated.
  • the electronic device may perform a compression operation on at least part of the tag data among the plurality of tag data to be updated, so as to reduce the processing amount of subsequent processing of the tag data.
  • step S420 may include:
  • S421 Obtain tag data of the same user identifier in the multiple tag data.
  • the obtained tag data to be updated may store a user ID corresponding to multiple tag data, and if there are tag data with the same priority in the multiple tag data corresponding to the user ID, and the tag data is updated in the order of updating The order corresponds to the priority, so the label data of the same user ID can be obtained, so as to aggregate the label data of the same user ID.
  • S422 Aggregate the tag data of the same priority in the tag data of the same user identification into the same tag data according to the priority corresponding to each tag data.
  • the electronic device may aggregate the tag data of the same priority in the tag data of the same user identification, so as to aggregate into the same tag data.
  • the tag data of the same priority in the tag data of the same user identification is aggregated, and the content of the tag data can be spliced to form a piece of tag data.
  • step S422 may include: filtering out the second target tag data from the tag data of the same user identification according to the priority corresponding to each tag data, and the priority of the second target tag data is lower than the priority of the second target tag data. Prioritize; aggregate the tag data of the same priority in the second target tag data into the same tag data.
  • a set priority may be preset in the electronic device, and the set priority is used to indicate that the set real-time level is higher than the set level. If the priority of the tag data is higher than or equal to the set priority, it means that the tag data cannot be aggregated, and the tag data with a priority lower than the set priority can be aggregated, so according to this condition, the same user ID
  • the second target label data is filtered out from the label data, that is, label data with a priority lower than the set priority is filtered out, and then the label data with the same priority in the second target label data is aggregated into the same label data.
  • the electronic device may also compress the same tag data after aggregation.
  • the compression processing includes, but is not limited to, the compression of label data in a manner such as lossless compression and lossy compression.
  • compressing the same tag data after aggregation may include: processing all target fields in the same tag data after aggregation to retain only one target field, and the target field is a field that characterizes a user identification.
  • the tag data of the same priority in the tag data of the user ID D1 includes: "D1's current location is in Shenzhen” and "D1 is currently sick”, then the aggregated tag data is "D1's current location is in Shenzhen and D1 Currently in a sick state", the processed tag data is "D1's current location is in Shenzhen and is in a sick state”.
  • Step S430 Determine the update sequence of the multiple tag data according to the high and low order of the priority corresponding to each tag data.
  • step S430 may include: sorting the tag data of different priorities in the plurality of tag data according to the priority order corresponding to each tag data to obtain the first ranking; According to the user identification corresponding to the tag data, the tag data in the same order in the first sorting is sorted to obtain the second sorting, and the second sorting is used as the update sequence of the plurality of tag data.
  • the tag data of the same order in the first sorting may be There are multiple, so the tag data in the same order in the first sorting can be sorted according to the user identification to obtain the second sorting, so that each tag data corresponds to a different order in the second sorting.
  • sorting the tag data in the same order in the second sorting according to the user identification corresponding to the tag data may be sorting according to the level of the identity level corresponding to the user identification.
  • step S420 and step S430 in the embodiment of the present application are also applicable to other embodiments.
  • Step S440 Update each tag data according to the update sequence.
  • step S440 can refer to the content of the foregoing embodiment, and will not be repeated here.
  • the tag data update device determines the priority of tag data according to the real-time level of tag data when updating multiple tag data to be updated, and determines the priority of tag data according to the corresponding value of each tag data. Priority, and then compress the label data to be updated, reduce the data volume of the label data to be updated, and improve the processing efficiency of the electronic device. Then determine the update order of multiple tag data, and update the tag data according to the update order, so as to ensure that the tag data with high priority can be updated first, so that the tag data with high real-time level can be updated as soon as possible to ensure Timeliness of label data.
  • the device 400 for updating tag data includes: a priority acquiring module 410, a sequence acquiring module 420, and a data updating module 430.
  • the priority obtaining module 410 is configured to obtain the priority corresponding to each tag data among the plurality of tag data to be updated when the tag data is updated, and the priority is based on the real-time performance of the tag data when the tag data is updated. Level determination; the sequence acquisition module 420 is configured to determine the update sequence of the multiple tag data according to the priority corresponding to each tag data; the data update module 430 is configured to follow the update sequence, The data of each tag is updated.
  • the priority acquiring module 410 may include: a type acquiring unit 411 and a priority determining unit 412.
  • the type obtaining unit 411 is configured to obtain the type of each tag data in the plurality of tag data to be updated, and different types correspond to different real-time levels of the tag data when the tag data is updated; the priority determining unit 412 uses According to the type of each tag data, the priority corresponding to each tag data is determined.
  • the type obtaining unit 411 may be specifically configured to: obtain the storage location of each tag data in the plurality of tag data to be updated; according to the corresponding relationship between the storage location and the type of the tag data, and the each tag data The storage location of each tag determines the type of each tag data.
  • the type obtaining unit 411 may be specifically configured to: obtain the type identification of each tag data in the plurality of tag data to be updated; determine the type identification of each tag data according to the type identification of each tag data type.
  • the priority acquiring module 410 may also include: an identification acquiring unit and a priority determining unit.
  • the identification acquiring unit is used to acquire the user identification corresponding to each tag data among the plurality of tag data to be updated; the priority determining unit is used to determine the corresponding user identification of each tag data according to the user identification corresponding to each tag data priority.
  • the priority determining unit may be specifically configured to: determine, according to the user identifier corresponding to each tag data, the real-time level of tag update corresponding to the user identifier; and determine the real-time level according to the real-time level. Describe the priority corresponding to each tag data.
  • the data update module 430 may include: a data cache unit and an update execution unit.
  • the data buffer unit is used to sequentially buffer each tag data to a buffer queue according to the update sequence, and the buffer queue is used to buffer the currently updated tag data;
  • the update execution unit is used to store the data in the buffer queue according to the The arrangement order of each tag data is read, and each tag data is updated.
  • the device 400 for updating tag data may further include: a difference comparison module, a change determination module, and a data deletion module.
  • the difference comparison module is configured to compare the tag data corresponding to each user identifier in the plurality of tag data with the currently stored tag data before determining the update sequence of the plurality of tag data according to the priority corresponding to each tag data The tag data corresponding to each user identifier is compared to obtain a difference comparison result;
  • the change determination module is configured to determine, according to the difference comparison result, that the tag data of each user is relative to the currently stored tag data of each user Identifies the data change type of the corresponding tag data, where the data change type includes a new type, an update type, or a deletion type;
  • the data deletion module is used for when there is first target tag data whose data change type is a deletion type The first target tag data is deleted from the plurality of tag data.
  • the data update module 430 may be specifically configured to: when each tag data is updated according to the update sequence, obtain the target user identifier corresponding to the current tag data currently being updated; Change type, adding the current tag data to the currently stored tag data of the target user identification, or replacing at least part of the tag data in the tag data of the target user identification with the tag data.
  • the multiple tag data are tag data to be updated stored within a preset time period.
  • the tag data updating device 400 may also include a compression processing module.
  • the compression processing module is configured to compress the tag data of the same user identification in the plurality of tag data before determining the update sequence of the plurality of tag data according to the priority corresponding to each tag data.
  • the compression processing module may be specifically configured to: obtain the tag data of the same user identification in the multiple tag data; according to the priority corresponding to each tag data, combine the tag data of the same user identification The tag data of the same priority in the same tag data is aggregated into the same tag data; the same tag data after aggregation is compressed.
  • the compression processing module aggregating the tag data of the same priority in the tag data of the same user identification into the same tag data according to the priority corresponding to each tag data may include: corresponding to each tag data
  • the priority of the second target tag data is filtered from the tag data of the same user identification, and the priority of the second target tag data is lower than the set priority; the second target tag data is given the same priority
  • the label data of the level is aggregated into the same label data.
  • the compression processing module performing the compression processing on the same label data after aggregation may include: processing all target fields in the same label data after aggregation until only one target field is retained, and the target field is a field that characterizes a user identification.
  • the device 400 for updating tag data may further include a data acquisition module and a data removal module.
  • the data obtaining module is used to obtain all the currently stored tag data to be updated before obtaining the priority corresponding to each tag data in the plurality of tag data to be updated; the data clearing module is used to remove all the tags The label data that exists repeatedly in the data is deleted.
  • the high and low order of the priority corresponds to the high and low order of the real-time level of the tag data when it is updated.
  • the sequence acquisition module 420 may be specifically configured to determine the update sequence of the multiple tag data according to the priority order of each tag data.
  • the sequence obtaining module 420 determines the update sequence of the multiple tag data according to the priority order corresponding to each tag data, which may include: according to the priority corresponding to each tag data Sort the tag data with different priorities in the multiple tag data to obtain the first order; according to the user identification corresponding to the tag data, the tag data in the same order in the first order are sorted The sorting is performed to obtain the second sorting, and the second sorting is used as the update sequence of the multiple tag data.
  • the coupling between the modules may be electrical, mechanical or other forms of coupling.
  • each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software function modules.
  • the priority corresponding to each tag data among the multiple tag data to be updated is obtained.
  • the priority is determined according to the real-time level of the tag data when the tag data is updated.
  • the priority of multiple tag data is determined, and each tag data is updated according to the update order, so that the order of tag data update corresponds to its priority, so that the tag with higher real-time level can be updated.
  • the data is updated first to speed up the update speed of label data with a higher real-time level.
  • the electronic device 100 may be an electronic device capable of running application programs, such as a server, a PC computer, or a mobile terminal.
  • the electronic device 100 in this application may include one or more of the following components: a processor 110, a memory 120, and one or more application programs.
  • One or more application programs may be stored in the memory 120 and configured to be Or multiple processors 110 execute, and one or more programs are configured to execute the method described in the foregoing method embodiment.
  • the processor 110 may include one or more processing cores.
  • the processor 110 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes by running or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and calling data stored in the memory 120.
  • Various functions and processing data of the electronic device 100 may adopt at least one of Digital Signal Processing (DSP), Field-Programmable Gate Array (FPGA), and Programmable Logic Array (PLA).
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PDA Programmable Logic Array
  • the processor 110 may be integrated with one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a modem, and the like.
  • the CPU mainly processes the operating system, user interface, and application programs; the GPU is used for rendering and drawing of display content; the modem is used for processing wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented by a communication chip alone.
  • the memory 120 may include random access memory (RAM) or read-only memory (Read-Only Memory).
  • the memory 120 may be used to store instructions, programs, codes, code sets or instruction sets.
  • the memory 120 may include a program storage area and a data storage area, where the program storage area may store instructions for implementing the operating system and instructions for implementing at least one function (such as touch function, sound playback function, image playback function, etc.) , Instructions used to implement the following various method embodiments, etc.
  • the data storage area can also store data (such as phone book, audio and video data, chat record data) created by the terminal 100 during use.
  • FIG. 11 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • the computer-readable medium 800 stores program code, and the program code can be invoked by a processor to execute the method described in the foregoing method embodiment.
  • the computer-readable storage medium 800 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the computer-readable storage medium 800 includes a non-transitory computer-readable storage medium.
  • the computer-readable storage medium 800 has storage space for the program code 810 for executing any method steps in the above-mentioned methods. These program codes can be read from or written into one or more computer program products.
  • the program code 810 may be compressed in a suitable form, for example.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

一种标签数据的更新方法、装置、电子设备及存储介质。该标签数据的更新方法包括:在更新标签数据时,获取待更新的多个标签数据中每个标签数据对应的优先级,所述优先级根据所述标签数据在更新时的实时性级别确定(S110);根据所述每个标签数据对应的优先级,确定所述多个标签数据的更新先后顺序(S120);按照所述更新先后顺序,对所述每个标签数据进行更新(S130);本更新方法可以加快时效性高的标签数据的更新。

Description

标签数据的更新方法、装置、电子设备及存储介质 技术领域
本申请涉及数据处理技术领域,更具体地,涉及一种标签数据的更新方法、装置、电子设备及存储介质。
背景技术
随着网络信息技术的快速发展,基于大数据技术的信息推荐技术也应运而生。信息推荐技术中利用用户标签而进行相关信息的推荐,用户标签的准确性影响着信息推荐的准确性,因此用户标签的标签数据更新成为了信息推荐技术的关键。
发明内容
鉴于上述问题,本申请提出了一种标签数据的更新方法、装置、电子设备及存储介质。
第一方面,本申请实施例提供了一种标签数据的更新方法,所述方法包括:在更新标签数据时,获取待更新的多个标签数据中每个标签数据对应的优先级,所述优先级根据所述标签数据在更新时的实时性级别确定;根据所述每个标签数据对应的优先级,确定所述多个标签数据的更新先后顺序;按照所述更新先后顺序,对所述每个标签数据进行更新。
第二方面,本申请实施例提供了一种标签数据的更新装置,所述装置包括:优先级获取模块、顺序获取模块以及数据更新模块,其中,所述优先级获取模块用于在更新标签数据时,获取待更新的多个标签数据中每个标签数据对应的优先级,所述优先级根据所述标签数据在更新时的实时性级别确定;所述顺序获取模块用于根据所述每个标签数据对应的优先级,确定所述多个标签数据的更新先后顺序;所述数据更新模块用于按照所述更新先后顺序,对所述每个标签数据进行更新。
第三方面,本申请实施例提供了一种电子设备,包括:一个或多个处理器;存储器;一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行上述第一方面提供的标签数据的更新方法。
第四方面,本申请实施例提供了一种计算机可读取存储介质,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行上述第一方面提供的标签数据的更新方法。
本申请提供的方案,通过在更新标签数据时,获取待更新的多个标签数据中每个标签数据对应的优先级,优先级根据标签数据在更新时的实时性级别确定,根据每个标签数据对应的优先级,确定多个标签数据的更新先后顺序,按照更新先后顺序,对每个标签数据进行更新,从而实现标签数据更新时的先后顺序与其优先级对应,使实时性级别较高的标签能数据优先进行更新,加快实时性级别较高的标签数据的更新速度。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1示出了根据本申请一个实施例的标签数据的更新方法流程图。
图2示出了根据本申请另一个实施例的标签数据的更新方法流程图。
图3示出了本申请另一个实施例提供的标签数据的更新方法中步骤S210的一种流程图。
图4示出了本申请另一个实施例提供的标签数据的更新方法中步骤S210的另一种流程图。
图5示出了根据本申请又一个实施例的标签数据的更新方法流程图。
图6示出了根据本申请再一个实施例的标签数据的更新方法流程图。
图7示出了本申请提供的再一个实施例的标签数据的更新方法中步骤S420的流程图。
图8示出了根据本申请一个实施例的标签数据的更新装置的一种框图。
图9示出了根据本申请一个实施例的标签数据的更新装置中优先级获取模块的框图。
图10是本申请实施例的用于执行根据本申请实施例的标签数据的更新方法的电子设备的框图。
图11是本申请实施例的用于保存或者携带实现根据本申请实施例的标签数据的更新方法的程序代码的存储单元。
具体实施方式
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。
随着信息技术的快速发展,互联网给人们的生活和工作带来了越来越多的便利。其中,基于大数据技术的信息推荐技术能推荐人们需求的内容,可以较好的满足用的需求。例如,人们可以通过互联网进行购物、娱乐以及发布个人状态信息(例如,发微博)等,商家通过互联网可获取到人们的消费、娱乐以及个人状态信息等内容,可以更为全面的了解大众的需求,进而根据大众的需求为人们提供推荐服务。在商家为人们提供推荐服务的同时,商家也得到了盈利。
在信息推荐的技术中,其主要应用了用户标签,使推荐内容能满足用户的需求。用户标签主要为用于反映用户的社会属性、生活习惯和消费行为等信息的数据,用户标签为通过对用户信息进行分析而得到的特征标识。用户标签通过不断的更新标签数据,从而使用户标签能保证精准性。
在传统的技术中,标签数据主要存储在数据库中,标签数据会定时,更新时会进行全量数据写入数据库,从而保证用户的标签数据能有最新的数据,能对用户的标签体系进行更新和优化,使得用户画像更贴近用户的真实情况。
发明人经过长期研究发现,随着用户量的持续增长,且需要构建的标签越来也多,定时更新时需要写入标签的数据库中的数据量持续增长,增长到千亿级别,这样庞大的数据量没有办法快速的写入,导致数据延迟和排队的情况越来越严重,同时因为数据写入缓慢,会占用大量的资源,造成资源利用率十分低下,无法高效利用已有计算资源。在标签数据的写入会耗时大量时间的情况下,对于一些时效性要求比较高的标签,如果写入的时间太晚,会导致业务不可用。
针对上述问题,发明人提出了本申请实施例提供的标签数据的更新方法、装置、电子设备以及存储介质,通过根据待更新的多个标签数据中每个标签数据的优先级,再根据优先级对标签数据的更新先后顺序进行排序,最后按照排序的更新先后顺序对每个标签数据进行更新,保证优先级高的标签数据能优先进行更新,使实时性级别高的标签数据能尽早进行更新,保证标签数据的时效性。其中,具体的标签数据的更新方法在后续的实施例中进行详细的说明。
请参阅图1,图1示出了本申请一个实施例提供的标签数据的更新方法的流程示意图。所述标签数据的更新方法用于通过根据待更新的多个标签数据中每个标签数据的优先级,再根据优先级对标签数据的更新先后顺序进行排序,最后按照排序的更新先后顺序对每个标签数据进行更新,保证优先级高的标签数据能优先进行更新,使实时性级别高的标签数据能尽早进行更新,保证标签数据的时效性。在具体的实施例中,所述标签数据的更新方法应用于如图8所示的标签数据的更新装置400以及配置有所述标签数据的更新装置400的电子设备100(图10)。下面将以电子设备为例,说明本实施例的具体流程,当然,可以理解的,本实施例所应用的电子设备可以为服务器、移动终端等,在此不做限定。下面将针对图1所示的流程进行详细的阐述,所述标签数据的更新方法具体可以包括以下步骤:
步骤S110:在更新标签数据时,获取待更新的多个标签数据中每个标签数据对应的优先级,所述优先级根据所述标签数据在更新时的实时性级别确定。
在本申请实施例中,标签数据指标签对应的数据,具体可以为标签对应的用户数据。例如,用户A在第一时刻的职业为学生,在第二时刻的职业为教师,则在第一时刻,用户A的标签中职业对应的数据则为学生,在第二时刻,用户A的标签中职业对应的数据为教师。由于用户的标签数据随着时间推移是在发生变化的,因此需要对用户的标签数据不断进行更新,以使用户的标签数据能与用户最新的状态匹配,从而能根据标签数据为用户提供满足需求的服务。
在本申请实施例中,电子设备可以定时或者不定时的进行标签数据的更新,例如,电子设备可以每天对标签数据进行更新。电子设备可以从一个或多个数据源获取待更新的标签数据,数据源可以为服务器,也可以为用户的移动终端,在此不做限定。可以理解的,电子设备可以主动的从数据源获取待更新的标签数据,数据源也可以主动向电子设备发送待更新的标签数据,在此不做限定。待更新的标签数据指获得的需要写入到标签数据的数据库中的标签数据,也可以理解为用于对用户标签进行更新的标签数据。
在一些实施方式中,电子设备在进行标签数据的更新时,可以对待更新的多个标签数据中每个标签数据对应的优先级进行确定,以便后续根据每个标签数据对应的优先级,对标签数据进行更新的更新先后顺序进行排序。其中,每个标签数据对应的优先级可以根据该标签数据在更新时的实时性级别确定。标签数据在更新时的实时性级别,可以指标签数据在更新时对于实时性的需求级别,实时性级别越高,则该标签数据则越需要实时的更新。可以理解的,电子设备可以识别标签数据在更新时的实时性级别,以根据标签数据对应的实时性级别确定标签数据对应的优先级。
作为一种具体的实施方式,标签数据在更新时的实时性级别与标签数据对应的优先级成正比,也就是说,标签数据在更新时的实时性级别越高,则标签数据对应的优先级越高。例如,标签数据在更新时的实时性级别包括级别1、级别2以及级别3,级别1、级别2以及级别3的实时性级别依次降低,优先级包括优先级1、优先级2以及优先级3,优先级1、优先级2以及优先级3为优先级依次降低的顺序,则级别1对应优先级1,级别2对应优先级2,级别3对应优先级3。当然,以上仅为举例,并不代表对具体的实时性级别与优先级的关系的限定。
在一些实施方式中,标签数据在更新时的实时性级别越高,则该标签数据在更新时的实时性需求越高,也可以理解为时效性越高。例如,对于用户位置的标签数据、用户年龄的标签数据、用户性别的标签数据,由于用户位置的变化频率较快,而用户年龄以及用户性别的变化频率较慢,则用位置的标签数据在更新时的实时性需求较高,而用户年龄的标签数据以及用户性别的标签数据在更新时的实时性较低,因此用户位置的标签数据的实时性级别大于用户年龄的标签数据的实时性级别以及用户性别的标签数据的实时性级别。
在一些实施方式中,不同标签数据在更新时的实时性级别可以预先存储于电子设备,电子设备可以通过识别标签数据的类型、标签数据的数据源、标签数据对应的用户标识等,以确定标签数据在更新时的实时性级别。
步骤S120:根据所述每个标签数据对应的优先级,确定所述多个标签数据的更新先后顺序。
在本申请实施例中,电子设备在获取到待更新的多个标签数据中每个标签数据对应的优先级之后,则可以根据每个标签数据对应的优先级,对待更新的多个标签数据进行更新先后顺序的排序,以使标签数据在更新时的更新先后顺序能与优先级对应。
在一些实施方式中,电子设备可以按照优先级从高到低的顺序,依次多个标签数据进行排序,从而获得待更新的多个标签数据在进行时的更新先后顺序。可以理解的,标签数据的优先级越高,则该标签数据在更新先后顺序中处于越靠前的位置,从而保证在对多个标签数据进行更新时,能越早的对优先级高的标签数据进行更新。
步骤S130:按照所述更新先后顺序,对所述每个标签数据进行更新。
在本申请实施例中,电子设备可以按照确定更新先后顺序,对待更新的多个标签数据中每个标签数据进行更新。其中,电子设备可以按照更新先后顺序,依次将标签数据写入到标签数据的数据库中。
在一些实施方式中,电子设备在对标签数据进行更新时,可以根据标签数据对应的用户标识,将标签数据与当前存储的该用户标识对应的所有标签数据进行比较,从而确定将该标签数据写入到该用户标识对应的标签数据中,或者将该标签数据写入到该用户标识对应的标签数据中的同时,将部分标签数据删除,即将该标签数据替换部分标签数据。
本申请实施例提供的标签数据的更新方法,通过在更新标签数据时,获取待更新的多个标签数据中每个标签数据对应的优先级,优先级根据标签数据在更新时的实时性级别确定,根据每个标签数据对应的优先级,确定多个标签数据的更新先后顺序,按照更新先后顺序,对每个标签数据进行更新,从而保证了优先级高的标签数据能优先进行更新,使实时性级别高的标签数据能尽早进行更新,保证标签数据的时效性。
请参阅图2,图2示出了本申请另一个实施例提供的标签数据的更新方法的流程示意图。下面将针对图2所示的流程进行详细的阐述,所述标签数据的更新方法具体可以包括以下步骤:
步骤S210:在更新标签数据时,获取待更新的多个标签数据中每个标签数据对应的优先级,所述优先级根据所述标签数据在更新时的实时性级别确定。
在本申请实施例中,标签数据在更新时的实时性级别可以与标签数据的类型对应,标签数据在更新时的实时性级别也可以与用户标识对应。电子设备在确定标签数据对应的优先级时,由于标签数据对应的优先级由标签数据更新时的实时性级别确定,因此可以根据标签数据的类型或者标签数据对应的用户标识确定。
在一些实施方式中,请参阅图3,步骤S210可以包括:
步骤S211A:获取待更新的多个标签数据中每个标签数据的类型,不同类型的标签数据在更新时的实时性级别不同。
在一些实施方式中,标签数据的类型与标签数据在更新时的实时性级别对应,并且不同类型的标签数据在更新时的实时性级别不同。标签数据的类型可以分为实时性需求高的类型以及实时性需求低的类型,例如,用户的实时位置、付费金额、最后活跃时间等可以作为实时性需求高的类型,用户年龄、用户职业、用户性别等可以不作为实时性需求低的类型。例如,标签数据的类型为C1,其对应的实时性级别为D1,标签数据的类型为C2,其对应的实时性级别为D2,C1与C2不同,则D1与D2也不同。因此,电子设备可以通过获取待更新的多个标签数据中每个标签数据的类型,以根据标签数据的类型确定标签数据在更新时的实时性级别。其中,每个标签数据的类 型可以经过预先处理,对标签数据进行分类后进行存储,电子设备在进行标签数据的更新时,可以读取标签数据并进行识别,从而获得标签数据的类型。
在一些实施方式中,电子设备为定时对标签数据进行更新。在一种具体的实施方式中,电子设备可以每间隔预设时长对标签数据进行更新,例如,电子设备每间隔24小时对标签数据进行更新,当然,具体的预设时长可以不作为限定。电子设备定时对标签数据进行更新,在电子设备未进行标签数据的更新时,电子设备可以从数据源获得待更新的标签数据,并将这些待更新的标签数据进行存储。
作为一种具体的实施方式,步骤S211A可以包括:
获取待更新的多个标签数据中每个标签数据的存储位置;根据存储位置与标签数据的类型的对应关系,以及所述每个标签数据的存储位置,确定所述每个标签数据的类型。
可以理解的,电子设备在未进行标签数据的更新时,获取的待进行的标签数据可以存储于电子设备的本地磁盘中,并且不同类型的标签数据可以对应存储到不同的存储位置。因此,电子设备在对待更新的标签数据进行更新时,可以根据每个标签数据的存储位置,确定标签数据的类型。
作为另一种具体的实施方式,步骤S211A可以包括:
获取待更新的多个标签数据中每个标签数据的类型标识;根据所述每个标签数据的类型标识,确定所述每个标签数据的类型。
可以理解的,标签数据中可以包括类型标识,类型标识处于标签数据的设定字段,电子设备可以通过获取标签数据中设定字段的数据,从而获得标签数据的类型标识。电子设备在获取到标签数据的类型标识后,则可以根据类型标识,确定标签数据的类型。
步骤S212A:根据所述每个标签数据的类型,确定所述每个标签数据对应的优先级。
电子设备在获取到每个标签数据的类型后,则可以根据标签数据的类型,确定标签数据对应的优先级。例如,标签数据的类型包括类型1和类型2,类型1的标签数据在更新时的实时性级别高于类型2的标签数据在更新时的实时性级别,则类型1对应优先级1,类型2对应优先级2,且优先级1高于优先级2。通过确定标签数据的类型,
在另一些实施方式中,请参阅图4,步骤S210可以包括:
步骤S211B:获取待更新的多个标签数据中每个标签数据对应的用户标识。
在该实施方式下,不同用户对应的标签数据在更新时的实时性级别可以不同,例如,刚注册的用户由于需要大量的用户数据作为构建用户标签的基础,以便对用户进行服务,所以需要及时的更新标签数据,又例如,不同用户的身份级别不同,用户对应的标签数据在更新时的实时性级别也不同。用户对应的身份信息可以以用户标识的形式处于标签数据中,电子设备可以获取标签数据对应的用户标识。其中,用户标识可以为国际移动设备识别码(International Mobile Equipment Identity,IMEI)、用户帐号OPENID等,在此不做限定。
步骤S212B:根据所述每个标签数据对应的用户标识,确定所述每个标签数据对应的优先级。
电子设备在获取到每个标签数据对应的用户标识后,则可以根据用户标识获取每个标签数据对应的用户标识,确定每个标签数据对应的优先级。作为一种具体的实施方式,步骤S22B可以包括:根据所述每个标签数据对应的用户标识,确定所述用户标识对应的对标签更新的实时性级别;根据所述实时性级别,确定所述每个标签数据对应的优先级。通过用户标识确定标签数据对应的优先级,可以使得标签数据在更新时的实时性级别与用户身份相关时,获得的优先级准确性高。
当然,获取待更新的多个标签数据中每个标签数据对应的优先级的具体方式可以 不作为限定。
需要说明的是,本申请实施例提供的标签数据的优先级的确定方式也可以适用于其他实施例中。
步骤S220:根据所述每个标签数据对应的优先级,确定所述多个标签数据的更新先后顺序。
在本申请实施例中,步骤S220可以参阅前述实施例的内容,在此不再赘述。
步骤S230:按照所述更新先后顺序,依次将所述每个标签数据缓存至缓冲队列,所述缓冲队列用于缓存当前进行更新的标签数据。
在本申请实施例中,电子设备可以按照确定更新先后顺序,对待更新的多个标签数据中每个标签数据进行更新时,可以按照该更新先后顺序,依次将每个标签数据缓存至缓冲队列中。该缓冲队列可以为电子设备的内存中建立的缓存队列,该缓冲队列用于缓存当前进行更新标签数据。可以理解的,缓冲队列中采用先进先出、后进后出的原则,从而进入到缓冲队列的标签数据在被后续取出进行更新时的先后顺序,能与缓存至缓冲队列中的先后顺序(即更新先后顺序)对应。
步骤S240:根据所述缓冲队列中所述每个标签数据的排布顺序,读取所述每个标签数据,并对所述每个标签数据进行更新。
在本申请实施例中,电子设备可以根据缓冲队列中标签数据的排布顺序,依次读取每个标签数据,并对每个标签数据进行更新,也就是说,缓冲队列为先进先出、后进后出的原则,按照缓冲队列中标签数据的排布顺序依次取出标签数据,并对标签数据进行更新,即可使得对标签数据的更新顺序能与该更新先后顺序对应。
需要说明的是,本申请实施例中步骤S230和步骤S240中进行标签数据更新的方式也可以适用于其他实施例中。
本申请实施例提供的标签数据的更新方法,通过在对待更新的多个标签数据进行更新时,根据标签数据的类型或者标签数据对应的用户标识确定标签数据的优先级,根据每个标签数据对应的优先级,确定多个标签数据的更新先后顺序,按照更新先后顺序将每个标签数据依次缓冲到缓冲队列中,然后从缓冲队列中依次取出标签数据,并对标签数据进行更新,从而保证了优先级高的标签数据能优先进行更新,使实时性级别高的标签数据能尽早进行更新,保证标签数据的时效性。
请参阅图5,图5示出了本申请又一个实施例提供的标签数据的更新方法的流程示意图。下面将针对图5所示的流程进行详细的阐述,所述标签数据的更新方法具体可以包括以下步骤:
步骤S310:在更新标签数据时,获取待更新的多个标签数据中每个标签数据对应的优先级,所述优先级根据所述标签数据在更新时的实时性级别确定。
在本申请实施例中,步骤S310可以参阅前述实施例的内容,在此不再赘述。
步骤S320:将所述多个标签数据中每个用户标识对应的标签数据与当前存储的所述每个用户标识对应的标签数据进行差异比较,获得差异比较结果。
在本申请实施例中,电子设备在对待更新的多个标签数据的更新先后顺序之前,还可以对多个标签数据进行预处理,以减少后续进行排序和更新的数据量。
在一些实施方式中,由于获取的待更新的标签数据可能为标签的数据库中已存在的标签数据,也就是说,待更新的多个标签数据中存在与已存在的标签数据中相同的标签数据。因此,电子设备可以确定待更新的多个标签数据中每个标签数据对应的用户标识,再将多个标签数据中每个用户标识对应的标签数据与标签的数据库中每个用户标识对应的标签数据进行差异比较,获得差异比较结果。
其中,多个标签数据中每个用户标识对应的标签数据可能为一个,也可能为多个。待进行的标签数据与当前存储的标签数据进行比较时,可以将标签数据的所有字段内容进行比较,从而可以确定出待更新的标签数据与已存储的标签数据之间的差异。具 体地,在对同一用户标识对应的待更新的标签数据与当前存储的标签数据进行差异比较时,可以将待更新的标签数据中每个标签数据与当前存储的标签数据进行一一比对,确定每个标签数据是否与当前存储的标签数据相同,如果相对当前存储的标签数据相同,则表示该标签数据已经存在于已存储的标签数据中;如果相对当前存储的标签数据不同,则可以进一步比较该用户对应的当前存储的标签数据中是否存在待更新的标签数据的类别的标签数据,例如,待更新的标签数据的类别为职业类别,则可以确定是否已存在职业类别;如果存在待更新的标签数据的类别的标签数据,则表示该待更新的标签数据是用于对该类别的标签数据进行更新的标签数据;如果不存在待更新的标签数据的类别的标签数据,则表示该待更新的标签数据为需要新增的标签数据。
步骤S330:根据所述差异比较结果,确定所述每个用户的标签数据相对当前存储的所述每个用户标识对应的标签数据的数据变化类型。
在一些实施方式中,电子设备在将待更新的标签数据与已存储的标签数据进行差异比较后,可以根据差异比较结果,确定出待更新的标签数据是否存在于已存储的标签数据中。如果待更新的标签数据存在于已存储的标签数据中时,则表示该标签数据相对已存储的标签数据无变化,则该待更新的标签数据需要删除。如果待更新的标签数据不存在于已存储的标签数据中时,则确定待更新的标签数据是否为需要新增的数据,并且确定待更新的标签数据是否为需要替换掉已存储的部分标签数据,也就是说,待更新的标签数据可能为需要直接添加到数据库中的标签数据,也可能为用于替换掉数据库中某个标签数据。例如,当前已存储的用户A的标签数据包括:性别为男、年龄36岁以及当前位置处于上海,而本次待更新的多个标签数据中包括用户A的标签数据,且标签数据为:职业为律师、性别为男以及当前位置处于北京,则“职业为律师”为需要添加(新增)到数据库的标签数据,“性别为男”为需要删除的标签数据,“当前位置处于北京”为替换“当前位置处于上海”的标签数据。
步骤S340:当存在所述数据变化类型为删除类型的第一目标标签数据时,将所述第一目标标签数据从所述多个标签数据中删除。
在本申请实施例中,电子设备在将待更新的标签数据与已存储的标签数据进行差异比较,并根据差异比较确定出待更新的标签数据的数据变化类型之后,则可以根据数据变化类型,确定是否将标签数据从待更新的标签数据中删除,具体可以为将确定每个标签数据的数据变化类型是否为删除类型,如果多个标签数据中存在数据变化类型为删除类型的第一目标标签数据,则可以将第一目标标签数据从多个标签数据中删除。可以理解的,在将第一目标标签数据从待更新的多个标签数据中删除后,则可以减少后续进行处理的标签数据的处理量,提升更新速度及效率。
步骤S350:根据所述每个标签数据对应的优先级,确定所述多个标签数据的更新先后顺序。
在本申请实施例中,步骤S350可以参阅前述实施例的内容,在此不再赘述。
步骤S360:按照所述更新先后顺序,对所述每个标签数据进行更新。
在本申请实施例中,电子设备可以在对每个标签数据进行更新时,可以直接根据步骤S330中获得的数据变化类型,对标签数据进行更新。
在一些实施方式中,步骤S360可以包括:按照所述更新先后顺序对所述每个标签数据进行更新时,获取当前进行更新的当前标签数据对应的目标用户标识;根据所述数据变化类型,将所述当前标签数据添加至当前存储的所述目标用户标识的标签数据、或者将所述目标用户标识的标签数据中的至少部分标签数据替换为所述标签数据。其中,如果当前标签数据的数据变化类型为新增类型时,则可以将当前标签数据添加至当前存储的目标用户标识的标签数据中,如果当前标签数据的数据变化类型为替换类型时,则可以将该当前标签数据对当前存储的目标用户标识的标签数据中至少部分标签数据进行替换。当前进行更新的当前标签数据可以指,电子设备在对标签数据进行 更新的过程中正在处理的标签数据。从而可以步骤S320以及步骤S330中的将待更新的标签数据与已存储的标签数据进行差异比较,不仅可以减少电子设备的处理量,还可以方便对标签数据进行更新时的处理。
需要说明的是,本申请实施例中的步骤S320、步骤S330以及步骤S360中的处理方式也可以适用于其他实施例中。
本申请实施例提供的标签数据的更新方法,通过在对待更新的多个标签数据进行更新时,根据标签数据在更新时的实时性级别,确定标签数据的优先级,根据每个标签数据对应的优先级,然后对待更新的标签数据与已存储的标签数据进行差异比对,并根据差异比对结果对待更新的标签数据进行筛选,减少待更新的标签数据的数据量,提升电子设备的处理效率。然后再确定多个标签数据的更新先后顺序,按照更新先后顺序对标签数据进行更新,从而保证了优先级高的标签数据能优先进行更新,使实时性级别高的标签数据能尽早进行更新,保证标签数据的时效性。
请参阅图6,图6示出了本申请再一个实施例提供的标签数据的更新方法的流程示意图。下面将针对图6所示的流程进行详细的阐述,所述标签数据的更新方法具体可以包括以下步骤:
步骤S410:在更新标签数据时,获取待更新的多个标签数据中每个标签数据对应的优先级,所述优先级根据所述标签数据在更新时的实时性级别确定。
在本申请实施例中,步骤S410可以参阅前述实施例的内容,在此不再赘述。
在一些实施方式中,所述优先级的高低顺序与标签数据在更新时的实时性级别的高低顺序对应。可以理解的,标签数据在更新时的实时性级别越高,则标签数据对应的优先级越高。
步骤S420:将所述多个标签数据中相同用户标识的标签数据进行压缩处理。
在本申请实施例中,电子设备在对待更新的多个标签数据的更新先后顺序之前,还可以对多个标签数据进行预处理,以减少后续进行排序和更新的数据量。在一些实施方式中,电子设备可以对待更新的多个标签数据中的至少部分标签数据进行压缩操作,以减少后续对标签数据进行处理的处理量。
在一些实施方式中,请参见图7,步骤S420可以包括:
S421:获取所述多个标签数据中相同用户标识的标签数据。
由于获取的待更新的标签数据中可能存储一个用户标识对应有多个标签数据的情况,而如果用户标识对应的多个标签数据中存在相同优先级的标签数据,且标签数据进行更新的更新先后顺序与优先级对应,因此可以获取相同用户标识的标签数据,以便对相同用户标识的标签数据进行聚合。
S422:根据所述每个标签数据对应的优先级,将所述相同用户标识的标签数据中相同优先级的标签数据聚合为同一标签数据。
在一些实施方式中,电子设备在获得多个标签数据中相同用户标识的标签数据后,则可以将相同用户标识的标签数据中相同优先级的标签数据进行聚合,从而聚合为同一标签数据。其中,将相同用户标识的标签数据中相同优先级的标签数据进行聚合,可以为将这些标签数据的数据进行内容的拼接从而形成一条标签数据。
在一些实施方式中,由于多条标签数据聚合后会相对此前一条标签数据的数据量增大,而一些标签数据的实时性级别高,如果将此类标签数据也进行聚合,会影响更新时的实时性。因此,步骤S422可以包括:根据所述每个标签数据对应的优先级,从所述相同用户标识的标签数据中筛选出第二目标标签数据,所述第二目标标签数据的优先级低于设定优先级;将所述第二目标标签数据中相同优先级的标签数据聚合为同一标签数据。
可以理解的,电子设备中可以预先设置有设定优先级,该设定优先级用于表征设置的实时性级别高于设定级别。如果标签数据的优先级高于或者等于设定优先级,则 表示该标签数据不能进行聚合,而优先级低于设定优先级的标签数据则可以进行聚合,因此根据此条件,从而相同用户标识的标签数据中筛选出第二目标标签数据,即筛选出优先级低于设定优先级的标签数据,然后再从第二目标标签数据中相同优先级的标签数据聚合为同一标签数据。
S423:对聚合后的同一标签数据进行压缩处理。
在一些实施方式中,电子设备还可以对聚合后的同一标签数据进行压缩处理。其中,压缩处理包括但不限于无损压缩、有损压缩等方式进行标签数据的压缩。
在一些实施方式中,对聚合后的同一标签数据进行压缩处理,可以包括:将聚合后的同一标签数据中所有目标字段处理至仅保留一目标字段,所述目标字段为表征用户标识的字段。例如,用户标识D1的标签数据中相同优先级的标签数据包括:“D1当前位置处于深圳”,以及“D1当前处于生病状态”,则进行聚合后的标签数据为“D1当前位置处于深圳且D1当前处于生病状态”,处理后的标签数据则为“D1当前位置处于深圳且处于生病状态”。通过如上处理,可以减少聚合后的标签数据中的用户标识所占的数据量,从而减少电子设备后续处理标签数据的处理量,提升电子设备的处理效率。
步骤S430:根据所述每个标签数据对应的优先级的高低顺序,确定所述多个标签数据的更新先后顺序。
在一些实施例中,步骤S430可以包括:根据所述每个标签数据对应的优先级的高低顺序,对所述多个标签数据中不同优先级的标签数据进行排序,获得第一排序;根据所述标签数据对应的用户标识,对所述第一排序中处于相同顺序的标签数据进行排序,获得第二排序,并将所述第二排序作为多个标签数据的更新先后顺序。可以理解的,在按照标签数据对应的优先级的高低顺序,对不同优先级的标签数据进行排序后,由于可能相同优先级对应有多个标签数据,从而第一排序中同一顺序的标签数据可能存在多个,因此可以再根据用户标识,对第一排序中同一顺序的标签数据进行排序,获得第二排序,使得每个标签数据在第二排序中对应不同的顺序。其中,根据标签数据对应的用户标识,对第二排序中处于相同顺序的标签数据进行排序,可以是根据用户标识对应的身份级别的高低进行排序。
需要说明的是,本申请实施例中的步骤S420以及步骤S430的处理方式也适用于其他实施例。
步骤S440:按照所述更新先后顺序,对所述每个标签数据进行更新。
在本申请实施例中,步骤S440可以参阅前述实施例的内容,在此不再赘述。
本申请实施例提供的标签数据的更新装置,通过在对待更新的多个标签数据进行更新时,根据标签数据在更新时的实时性级别,确定标签数据的优先级,根据每个标签数据对应的优先级,然后对待更新的标签数据进行压缩处理,减少待更新的标签数据的数据量,提升电子设备的处理效率。然后再确定多个标签数据的更新先后顺序,按照更新先后顺序对标签数据进行更新,从而保证了优先级高的标签数据能优先进行更新,使实时性级别高的标签数据能尽早进行更新,保证标签数据的时效性。
请参阅图8,其示出了本申请实施例提供的一种标签数据的更新装置400的结构框图。该标签数据的更新装置400包括:优先级获取模块410、顺序获取模块420以及数据更新模块430。其中,所述优先级获取模块410用于在更新标签数据时,获取待更新的多个标签数据中每个标签数据对应的优先级,所述优先级根据所述标签数据在更新时的实时性级别确定;所述顺序获取模块420用于根据所述每个标签数据对应的优先级,确定所述多个标签数据的更新先后顺序;所述数据更新模块430用于按照所述更新先后顺序,对所述每个标签数据进行更新。
在一些实施方式中,请参见图9,优先级获取模块410可以包括:类型获取单元411以及优先级确定单元412。其中,所述类型获取单元411用于获取待更新的多个标 签数据中每个标签数据的类型,不同类型对应所述标签数据在更新时的不同实时性级别;所述优先级确定单元412用于根据所述每个标签数据的类型,确定所述每个标签数据对应的优先级。
作为一种方式,类型获取单元411可以具体用于:获取待更新的多个标签数据中每个标签数据的存储位置;根据存储位置与标签数据的类型的对应关系,以及所述每个标签数据的存储位置,确定所述每个标签数据的类型。
作为另一种方式,类型获取单元411可以具体用于:获取待更新的多个标签数据中每个标签数据的类型标识;根据所述每个标签数据的类型标识,确定所述每个标签数据的类型。
在一些实施方式中,优先级获取模块410也可以包括:标识获取单元以及优先级确定单元。标识获取单元用于获取待更新的多个标签数据中每个标签数据对应的用户标识;优先级确定单元用于根据所述每个标签数据对应的用户标识,确定所述每个标签数据对应的优先级。
在该方式下,优先级确定单元可以具体用于:根据所述每个标签数据对应的用户标识,确定所述用户标识对应的对标签更新的实时性级别;根据所述实时性级别,确定所述每个标签数据对应的优先级。
在一些实施方式中,数据更新模块430可以包括:数据缓存单元以及更新执行单元。数据缓存单元用于按照所述更新先后顺序,依次将所述每个标签数据缓存至缓冲队列,所述缓冲队列用于缓存当前进行更新的标签数据;更新执行单元用于根据所述缓冲队列中所述每个标签数据的排布顺序,读取所述每个标签数据,并对所述每个标签数据进行更新。
在一些实施方式中,该标签数据的更新装置400还可以包括:差异比较模块、变化确定模块以及数据删除模块。差异比较模块用于在根据所述每个标签数据对应的优先级,确定所述多个标签数据的更新先后顺序之前,将所述多个标签数据中每个用户标识对应的标签数据与当前存储的所述每个用户标识对应的标签数据进行差异比较,获得差异比较结果;变化确定模块用于根据所述差异比较结果,确定所述每个用户的标签数据相对当前存储的所述每个用户标识对应的标签数据的数据变化类型,所述数据变化类型包括新增类型、更新类型或者删除类型;数据删除模块用于当存在所述数据变化类型为删除类型的第一目标标签数据时,将所述第一目标标签数据从所述多个标签数据中删除。
在该实施方式下,数据更新模块430可以具体用于:按照所述更新先后顺序对所述每个标签数据进行更新时,获取当前进行更新的当前标签数据对应的目标用户标识;根据所述数据变化类型,将所述当前标签数据添加至当前存储的所述目标用户标识的标签数据、或者将所述目标用户标识的标签数据中的至少部分标签数据替换为所述标签数据。
在一些实施方式中,所述多个标签数据为预设时长内存储的待更新的标签数据。标签数据的更新装置400还可以包括压缩处理模块。压缩处理模块用于在根据所述每个标签数据对应的优先级,确定所述多个标签数据的更新先后顺序之前,将所述多个标签数据中相同用户标识的标签数据进行压缩处理。
在该实施方式下,压缩处理模块可以具体用于:获取所述多个标签数据中相同用户标识的标签数据;根据所述每个标签数据对应的优先级,将所述相同用户标识的标签数据中相同优先级的标签数据聚合为同一标签数据;对聚合后的同一标签数据进行压缩处理。
进一步的,压缩处理模块根据所述每个标签数据对应的优先级,将所述相同用户标识的标签数据中相同优先级的标签数据聚合为同一标签数据可以包括:根据所述每个标签数据对应的优先级,从所述相同用户标识的标签数据中筛选出第二目标标签数 据,所述第二目标标签数据的优先级低于设定优先级;将所述第二目标标签数据中相同优先级的标签数据聚合为同一标签数据。
进一步的,压缩处理模块对聚合后的同一标签数据进行压缩处理可以包括:将聚合后的同一标签数据中所有目标字段处理至仅保留一目标字段,所述目标字段为表征用户标识的字段。
在一些实施方式中,该标签数据的更新装置400还可以包括数据获取模块以及数据清除模块。数据获取模块用于在所述获取待更新的多个标签数据中每个标签数据对应的优先级之前,获取当前存储的所述待更新的所有标签数据;数据清除模块用于将所述所有标签数据中重复存在的标签数据进行删除。
在一些实施方式中,所述优先级的高低顺序与标签数据在更新时的实时性级别的高低顺序对应。顺序获取模块420可以具体用于根据所述每个标签数据对应的优先级的高低顺序,确定所述多个标签数据的更新先后顺序。
在该实施方式下,顺序获取模块420根据所述每个标签数据对应的优先级的高低顺序,确定所述多个标签数据的更新先后顺序,可以包括:根据所述每个标签数据对应的优先级的高低顺序,对所述多个标签数据中不同优先级的标签数据进行排序,获得第一排序;根据所述标签数据对应的用户标识,对所述第一排序中处于相同顺序的标签数据进行排序,获得第二排序,并将所述第二排序作为多个标签数据的更新先后顺序。
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。
在本申请所提供的几个实施例中,模块相互之间的耦合可以是电性,机械或其它形式的耦合。
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。
综上所述,通过在更新标签数据时,获取待更新的多个标签数据中每个标签数据对应的优先级,优先级根据标签数据在更新时的实时性级别确定,根据每个标签数据对应的优先级,确定多个标签数据的更新先后顺序,按照更新先后顺序,对每个标签数据进行更新,从而实现标签数据更新时的先后顺序与其优先级对应,使实时性级别较高的标签能数据优先进行更新,加快实时性级别较高的标签数据的更新速度。
请参考图10,其示出了本申请实施例提供的一种电子设备的结构框图。该电子设备100可以是服务器、PC电脑、移动终端等能够运行应用程序的电子设备。本申请中的电子设备100可以包括一个或多个如下部件:处理器110、存储器120以及一个或多个应用程序,其中一个或多个应用程序可以被存储在存储器120中并被配置为由一个或多个处理器110执行,一个或多个程序配置用于执行如前述方法实施例所描述的方法。
处理器110可以包括一个或者多个处理核。处理器110利用各种接口和线路连接整个电子设备100内的各个部分,通过运行或执行存储在存储器120内的指令、程序、代码集或指令集,以及调用存储在存储器120内的数据,执行电子设备100的各种功能和处理数据。可选地,处理器110可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器110可集成中央处理器(Central Processing Unit,CPU)、图像处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作系统、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器110中,单独通过 一块通信芯片进行实现。
存储器120可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器120可用于存储指令、程序、代码、代码集或指令集。存储器120可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作系统的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。存储数据区还可以存储终端100在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。
请参考图11,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读介质800中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。
计算机可读存储介质800可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质800包括非易失性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读存储介质800具有执行上述方法中的任何方法步骤的程序代码810的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码810可以例如以适当形式进行压缩。
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。

Claims (20)

  1. 一种标签数据的更新方法,其特征在于,所述方法包括:
    在更新标签数据时,获取待更新的多个标签数据中每个标签数据对应的优先级,所述优先级根据所述标签数据在更新时的实时性级别确定;
    根据所述每个标签数据对应的优先级,确定所述多个标签数据的更新先后顺序;
    按照所述更新先后顺序,对所述每个标签数据进行更新。
  2. 根据权利要求1所述的方法,其特征在于,所述获取待更新的多个标签数据中每个标签数据对应的优先级,包括:
    获取待更新的多个标签数据中每个标签数据的类型,不同类型的标签数据在更新时的实时性级别不同;
    根据所述每个标签数据的类型,确定所述每个标签数据对应的优先级。
  3. 根据权利要求2所述的方法,其特征在于,所述获取待更新的多个标签数据中每个标签数据的类型,包括:
    获取待更新的多个标签数据中每个标签数据的存储位置;
    根据存储位置与标签数据的类型的对应关系,以及所述每个标签数据的存储位置,确定所述每个标签数据的类型。
  4. 根据权利要求2所述的方法,其特征在于,所述获取待更新的多个标签数据中每个标签数据的类型,包括:
    获取待更新的多个标签数据中每个标签数据的类型标识;
    根据所述每个标签数据的类型标识,确定所述每个标签数据的类型。
  5. 根据权利要求1所述的方法,其特征在于,所述获取待更新的多个标签数据中每个标签数据对应的优先级,包括:
    获取待更新的多个标签数据中每个标签数据对应的用户标识;
    根据所述每个标签数据对应的用户标识,确定所述用户标识对应的对标签更新的实时性级别;
    根据所述实时性级别,确定所述每个标签数据对应的优先级。
  6. 根据权利要求1-5任一项所述的方法,其特征在于,所述按照所述更新先后顺序依次对所述每个标签数据进行更新,包括:
    按照所述更新先后顺序,依次将所述每个标签数据缓存至缓冲队列,所述缓冲队列用于缓存当前进行更新的标签数据;
    根据所述缓冲队列中所述每个标签数据的排布顺序,读取所述每个标签数据,并对所述每个标签数据进行更新。
  7. 根据权利要求1-6任一项所述的方法,其特征在于,在根据所述每个标签数据对应的优先级,确定所述多个标签数据的更新先后顺序之前,所述方法还包括:
    将所述多个标签数据中每个用户标识对应的标签数据与当前存储的所述每个用户标识对应的标签数据进行差异比较,获得差异比较结果;
    根据所述差异比较结果,确定所述每个用户的标签数据相对当前存储的所述每个用户标识对应的标签数据的数据变化类型;
    当存在所述数据变化类型为删除类型的第一目标标签数据时,将所述第一目标标签数据从所述多个标签数据中删除。
  8. 根据权利要求7所述的方法,其特征在于,所述数据变化类型还包括新增类型以及更新类型,所述按照所述更新先后顺序,对所述每个标签数据进行更新,包括:
    按照所述更新先后顺序对所述每个标签数据进行更新时,获取当前进行更新的当 前标签数据对应的目标用户标识;
    根据所述数据变化类型,将所述当前标签数据添加至当前存储的所述目标用户标识的标签数据、或者将所述目标用户标识的标签数据中的至少部分标签数据替换为所述标签数据。
  9. 根据权利要求1-8任一项所述的方法,其特征在于,所述多个标签数据为预设时长内存储的待更新的标签数据,所述在根据所述每个标签数据对应的优先级,确定所述多个标签数据的更新先后顺序之前,所述方法还包括:
    将所述多个标签数据中相同用户标识的标签数据进行压缩处理。
  10. 根据权利要求9所述的方法,其特征在于,所述将所述多个标签数据中相同用户标识的标签数据进行压缩处理,包括:
    获取所述多个标签数据中相同用户标识的标签数据;
    根据所述每个标签数据对应的优先级,将所述相同用户标识的标签数据中相同优先级的标签数据聚合为同一标签数据;
    对聚合后的同一标签数据进行压缩处理。
  11. 根据权利要求10所述的方法,其特征在于,所述根据所述每个标签数据对应的优先级,将所述相同用户标识的标签数据中相同优先级的标签数据聚合为同一标签数据,包括:
    根据所述每个标签数据对应的优先级,从所述相同用户标识的标签数据中筛选出第二目标标签数据,所述第二目标标签数据的优先级低于设定优先级;
    将所述第二目标标签数据中相同优先级的标签数据聚合为同一标签数据。
  12. 根据权利要求10所述的方法,其特征在于,所述对聚合后的同一标签数据进行压缩处理,包括:
    将聚合后的同一标签数据中所有目标字段处理至仅保留一目标字段,所述目标字段为表征用户标识的字段。
  13. 根据权利要求1-12任一项所述的方法,其特征在于,在所述获取待更新的多个标签数据中每个标签数据对应的优先级之前,所述方法还包括:
    获取当前存储的所述待更新的所有标签数据;
    将所述所有标签数据中重复存在的标签数据进行删除。
  14. 根据权利要求1-13任一项所述的方法,其特征在于,所述优先级的高低顺序与标签数据在更新时的实时性级别的高低顺序对应;
    所述根据所述每个标签数据对应的优先级,确定所述多个标签数据的更新先后顺序,包括:
    根据所述每个标签数据对应的优先级的高低顺序,确定所述多个标签数据的更新先后顺序。
  15. 根据权利要求14所述的方法,其特征在于,所述根据所述每个标签数据对应的优先级的高低顺序,确定所述多个标签数据的更新先后顺序,包括:
    根据所述每个标签数据对应的优先级的高低顺序,对所述多个标签数据中不同优先级的标签数据进行排序,获得第一排序;
    根据所述标签数据对应的用户标识,对所述第一排序中处于相同顺序的标签数据进行排序,获得第二排序,并将所述第二排序作为多个标签数据的更新先后顺序。
  16. 一种标签数据的更新装置,其特征在于,所述装置包括:优先级获取模块、顺序获取模块以及数据更新模块,其中,
    所述优先级获取模块用于在更新标签数据时,获取待更新的多个标签数据中每个标签数据对应的优先级,所述优先级根据所述标签数据在更新时的实时性级别确定;
    所述顺序获取模块用于根据所述每个标签数据对应的优先级,确定所述多个标签数据的更新先后顺序;
    所述数据更新模块用于按照所述更新先后顺序,对所述每个标签数据进行更新。
  17. 根据权利要求16所述的装置,其特征在于,所述优先级获取模块包括类型获取单元以及优先级确定单元,其中,
    所述类型获取单元用于获取待更新的多个标签数据中每个标签数据的类型,不同类型对应所述标签数据在更新时的不同实时性级别;
    所述优先级确定单元用于根据所述每个标签数据的类型,确定所述每个标签数据对应的优先级。
  18. 根据权利要求17所述的装置,其特征在于,所述类型获取单元具体用于:
    获取待更新的多个标签数据中每个标签数据的存储位置;
    根据存储位置与标签数据的类型的对应关系,以及所述每个标签数据的存储位置,确定所述每个标签数据的类型。
  19. 一种电子设备,其特征在于,包括:
    一个或多个处理器;
    存储器;
    一个或多个应用程序,其中所述一个或多个应用程序被存储在所述存储器中并被配置为由所述一个或多个处理器执行,所述一个或多个程序配置用于执行如权利要求1-15任一项所述的方法。
  20. 一种计算机可读取存储介质,其特征在于,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行如权利要求1-15任一项所述的方法。
PCT/CN2019/116700 2019-11-08 2019-11-08 标签数据的更新方法、装置、电子设备及存储介质 WO2021087981A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201980100128.6A CN114365112A (zh) 2019-11-08 2019-11-08 标签数据的更新方法、装置、电子设备及存储介质
PCT/CN2019/116700 WO2021087981A1 (zh) 2019-11-08 2019-11-08 标签数据的更新方法、装置、电子设备及存储介质

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/116700 WO2021087981A1 (zh) 2019-11-08 2019-11-08 标签数据的更新方法、装置、电子设备及存储介质

Publications (1)

Publication Number Publication Date
WO2021087981A1 true WO2021087981A1 (zh) 2021-05-14

Family

ID=75849241

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/116700 WO2021087981A1 (zh) 2019-11-08 2019-11-08 标签数据的更新方法、装置、电子设备及存储介质

Country Status (2)

Country Link
CN (1) CN114365112A (zh)
WO (1) WO2021087981A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117806815B (zh) * 2023-11-27 2024-07-09 本原数据(北京)信息技术有限公司 数据处理方法、系统、电子设备及存储介质

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005228126A (ja) * 2004-02-13 2005-08-25 Nippon Telegr & Teleph Corp <Ntt> 情報通知方法/プログラム/プログラム記録媒体/装置、サービス管理装置、サービスシステム
CN105574051A (zh) * 2014-11-06 2016-05-11 阿里巴巴集团控股有限公司 更新用户所满足的规则的方法及处理系统
CN108415978A (zh) * 2018-02-09 2018-08-17 北京腾云天下科技有限公司 用户标签存储方法、用户画像计算方法及计算设备
CN108959580A (zh) * 2018-07-06 2018-12-07 深圳市彬讯科技有限公司 一种标签数据的优化方法及系统
CN109254812A (zh) * 2018-08-08 2019-01-22 连尚(新昌)网络科技有限公司 一种更新标签页的方法、系统、终端及服务器
CN109376161A (zh) * 2018-08-22 2019-02-22 中国平安人寿保险股份有限公司 基于大数据的标签数据更新方法、装置、介质及电子设备

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109446443B (zh) * 2018-10-18 2021-11-09 武汉斗鱼网络科技有限公司 一种标签更新方法、装置、设备和存储介质
CN110362332B (zh) * 2019-06-25 2023-04-07 上海淇馥信息技术有限公司 一种控制程序增量更新的方法、装置、电子设备

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005228126A (ja) * 2004-02-13 2005-08-25 Nippon Telegr & Teleph Corp <Ntt> 情報通知方法/プログラム/プログラム記録媒体/装置、サービス管理装置、サービスシステム
CN105574051A (zh) * 2014-11-06 2016-05-11 阿里巴巴集团控股有限公司 更新用户所满足的规则的方法及处理系统
CN108415978A (zh) * 2018-02-09 2018-08-17 北京腾云天下科技有限公司 用户标签存储方法、用户画像计算方法及计算设备
CN108959580A (zh) * 2018-07-06 2018-12-07 深圳市彬讯科技有限公司 一种标签数据的优化方法及系统
CN109254812A (zh) * 2018-08-08 2019-01-22 连尚(新昌)网络科技有限公司 一种更新标签页的方法、系统、终端及服务器
CN109376161A (zh) * 2018-08-22 2019-02-22 中国平安人寿保险股份有限公司 基于大数据的标签数据更新方法、装置、介质及电子设备

Also Published As

Publication number Publication date
CN114365112A (zh) 2022-04-15

Similar Documents

Publication Publication Date Title
CN109947668B (zh) 存储数据的方法和装置
CN105205014A (zh) 一种数据存储方法和装置
CN111274256B (zh) 基于时序数据库的资源管控方法、装置、设备及存储介质
CN110221901A (zh) 容器资源创建方法、装置、设备及计算机可读存储介质
WO2021068113A1 (zh) 时长统计方法、装置、电子设备和计算机可读介质
CN112464034A (zh) 用户数据提取方法、装置、电子设备及计算机可读介质
WO2022062184A1 (zh) 高并发查询方法、智能终端及存储介质
WO2021179170A1 (zh) 数据推送方法、装置、服务器及存储介质
CN114706867A (zh) 数据同步方法、装置、电子设备及存储介质
CN112328592A (zh) 数据存储方法、电子设备及计算机可读存储介质
CN115729687A (zh) 任务调度方法、装置、计算机设备、存储介质
WO2021087970A1 (zh) 标签数据的更新方法、装置、电子设备及存储介质
CN115016735A (zh) 一种分布式缓存系统的控制方法、装置及介质
WO2021087981A1 (zh) 标签数据的更新方法、装置、电子设备及存储介质
JP6507263B2 (ja) ユーザ・モバイルネットワークおよびデータプランに基づくコンテンツのフィルタリング
WO2021000411A1 (zh) 基于神经网络的文档分类方法、装置、设备及存储介质
WO2021087990A1 (zh) 标签更新方法、装置、电子设备及存储介质
CN117369731A (zh) 一种数据的缩减处理方法、装置、设备及介质
CN113297267A (zh) 数据缓存和任务处理方法、装置、设备以及存储介质
WO2023124135A1 (zh) 特征检索方法、装置、电子设备、计算机存储介质和程序
WO2019153546A1 (zh) 万级维度数据生成方法、装置、设备以及存储介质
CN107741940B (zh) 一种数据储存方法及存储系统
CN112506875B (zh) 文件存储方法、相关装置及文件存储系统
CN109299112B (zh) 用于处理数据的方法和装置
CN110908958B (zh) 一种文件处理方法、装置、终端及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19951375

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19951375

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 19951375

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 28.10.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 19951375

Country of ref document: EP

Kind code of ref document: A1