WO2016116020A1 - 一种实现对象过期操作的方法、装置和设备 - Google Patents

一种实现对象过期操作的方法、装置和设备 Download PDF

Info

Publication number
WO2016116020A1
WO2016116020A1 PCT/CN2016/071174 CN2016071174W WO2016116020A1 WO 2016116020 A1 WO2016116020 A1 WO 2016116020A1 CN 2016071174 W CN2016071174 W CN 2016071174W WO 2016116020 A1 WO2016116020 A1 WO 2016116020A1
Authority
WO
WIPO (PCT)
Prior art keywords
record
expiration
module
implementing
task information
Prior art date
Application number
PCT/CN2016/071174
Other languages
English (en)
French (fr)
Inventor
郑涔
周帅
Original Assignee
阿里巴巴集团控股有限公司
郑涔
周帅
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 阿里巴巴集团控股有限公司, 郑涔, 周帅 filed Critical 阿里巴巴集团控股有限公司
Publication of WO2016116020A1 publication Critical patent/WO2016116020A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor

Definitions

  • the present application relates to the field of computer data processing technologies, and in particular, to a method, apparatus, and device for implementing an object expiration operation.
  • Object storage systems can often be used to save, read, or delete objects for users.
  • Objects saved for the user in the object storage system may be temporary objects that need to be deleted after a preset time. This deletion of an expired object is an expiration of the object.
  • An existing method for implementing an object expiration operation includes: setting a life cycle associated with an object for each object, saving the life cycle of the object in the metadata of the object, by setting one or more background threads, at a predetermined time The time can scan the metadata of all objects in the object storage system, determine whether the life cycle in each object metadata has expired, and if it has expired, delete the object.
  • an object that needs to perform an expired operation may be a small part
  • an existing method for implementing an object expiration operation needs to set a thread.
  • the metadata of all objects in the object storage system is scanned, so that the cost of implementing the object expiration operation is high.
  • the purpose of embodiments of the present application is to provide a method, apparatus, and device for implementing an object expiration operation to reduce the cost of implementing an object expiration operation.
  • a method for implementing an object expiration operation comprising: acquiring a request for setting an object life cycle, generating a first record corresponding to the object according to the request, storing the first record; and determining an expired task at a preset time And selecting a candidate first record in the first record according to the task information, determining a target object corresponding to the candidate first record, and performing an expiration operation on the target object.
  • the method before the storing the first record, the method further includes: generating a second record according to the request; and the second record is in one-to-one correspondence with the first record.
  • the first record includes: an object name, an automatic expiration time, and an automatic expiration date; and the automatic expiration date is determined according to the automatic expiration time.
  • the first record further includes: a first attribute value.
  • the first record further includes: a user number.
  • An apparatus for implementing an object expiration operation comprising: a first recording module, a task information module, and an expired operation execution module; wherein the first recording module is configured to acquire a request for setting an object life cycle, and generate and The first record corresponding to the object, the first record is stored; the task information module is configured to determine task information of the expired task at a preset time, and send the task information to the expired operation execution module; An expired operation execution module, configured to filter, according to the task information determined by the task information module, a candidate first record in the first record generated in the first record module, and determine a target object corresponding to the candidate first record , performing an expiration operation on the target object.
  • An apparatus for implementing an object expiration operation comprising: a processor and a memory; the processor, configured to acquire a request for setting an object life cycle, generate a first record corresponding to the object according to the request, and store the first a record; the processor is further configured to determine task information of the expired task at a preset time, filter out the candidate first record in the memory according to the task information, and determine a target object corresponding to the candidate first record Performing an expiration operation on the target object; the memory is configured to store an object and a first record corresponding to the object.
  • the method, device, and device for implementing an object expiration operation disclosed in the embodiment of the present application can generate a first record corresponding to the object, where the object with the automatic expiration time is set, first.
  • the record includes an automatic expiration time and an automatic expiration date.
  • the target object may be determined according to the current time in the task information and the automatic expiration date and the automatic expiration time in the first record, and the determined target object is expired.
  • the solution of the embodiment of the present application can quickly filter out an object that needs to perform an expired operation by filtering the first record associated with the object, avoiding scanning all objects in the object storage system, and saving the object expiration operation. cost.
  • adding the user number in the first record may facilitate recording the user information of the automatic expiration time of the setting object. Further, adding the first attribute value in the first record and adding the task number in the task information may implement a function of automatically allocating the expired operation task when there are multiple modules that perform the object expiration operation. Further, generating the second record with the first record, it may be determined whether the automatic expiration time has been set for the object, and if it has been set, the automatic expiration time of the object that has been set to the life cycle may be changed.
  • the method, device, and device for realizing automatic expiration of an object disclosed in the embodiment of the present application can be well coupled with an existing object storage system, so that an automatic expiration operation can be implemented on an object in an existing object storage system.
  • FIG. 1 is a flow chart of an embodiment of a method for implementing an object expiration operation of the present application
  • FIG. 2 is a block diagram of an embodiment of an apparatus for implementing an object expiration operation of the present application
  • FIG. 3 is a block diagram of a first recording module in an apparatus embodiment for implementing an object expiration operation according to the present application
  • FIG. 4 is a block diagram of an expired operation execution module in an apparatus embodiment for implementing an object expiration operation of the present application
  • FIG. 5 is a schematic diagram of the composition of an apparatus for implementing an object expiration operation according to the present application.
  • Embodiments of the present application provide a method, apparatus, and device for implementing an object expiration operation.
  • FIG. 1 is a flow chart of an embodiment of a method for implementing an object expiration operation of the present application. As shown in FIG. 1, the method for implementing an object expiration operation may include:
  • S101 Acquire a request for setting an object life cycle, generate a first record corresponding to the object according to the request, and store the first record in a database.
  • a device that implements an object expiration operation can obtain a request to set an object life cycle.
  • the request may be preset in the object expiration operation device, or may be a request for setting the object life cycle sent by the user received by the object expiration operation device.
  • the request may include: an object name and an automatic expiration time. If the request is sent by a user, the request may further include: a user number. The user number can be used to identify a user who sets the lifecycle of the object.
  • the automatic expiration time can be expressed in an absolute time manner.
  • the automatic expiration time may be the number of seconds elapsed since 0:00 on January 1, 1970.
  • the automatic expiration time can also be expressed by the time mode of the year, month, and day.
  • a first record corresponding to the object may be generated according to the request to set an object life cycle, and the first record may be stored in a database.
  • the first record may include: an object name, an automatic expiration date, and an automatic expiration time.
  • the automatic expiration date may be determined according to the automatic expiration time, and the automatic expiration date may be a date of the day when the automatic expiration time arrives. For example, the automatic expiration time is 172,810 seconds (ie, 2 days and 10 seconds), and the date of automatic expiration may be January 3, 1970.
  • the first record may further include: a record type of the first record. Recording class The type can be used to represent the data type of the first record.
  • the first record may further include: a user number.
  • the first record may further include: a first attribute value.
  • the first attribute value is determined according to the first preset value, and specifically includes: performing a hash operation on the object name to obtain an integer, and performing a remainder operation on the first preset value by using the integer The value as the first attribute.
  • the first record described in this application may be implemented in the form of a key-value pair, and the key value in the key-value pair may include an automatic expiration date.
  • the automatic expiration date can be used as the key value in the key value pair
  • the object name is used as the value value in the key value pair.
  • the first record includes: a user number, a record type, an automatic expiration date, an automatic expiration time, and an object name
  • the record type, the automatic expiration date, the automatic expiration time, and the object name may be used as the key value in the key value pair. Use the user number as the value of the key-value pair.
  • the key value of the key value pair may further include: a first attribute value.
  • the first record includes: a user number, a record type, an automatic expiration date, a first attribute value, an automatic expiration time, and an object name
  • the record type, the automatic expiration date, the first attribute value, and the automatic expiration time may be And the object name as the key value in the key-value pair, and the user number as the value value in the key-value pair.
  • the method can also include generating a second record based on the request.
  • the second record may include: an object name and an automatic expiration time.
  • the second record may be in one-to-one correspondence with the first record.
  • the second record may be implemented in the form of a key-value pair, the object name in the second record may be used as the key value of the key-value pair, and the automatic expiration time in the second record may be used as the value of the key-value pair.
  • the method may further include: writing the second record in the database, and writing the second record if the second record is successfully written Enter the first record corresponding to the second record.
  • the method may further include: determining whether there is a third record in the database with the same object name and the second record object name; if not, outputting the write The reason why the second record is unsuccessful; if present, reading the third record, searching for the fourth record corresponding to the third record in the database, deleting the fourth record and the third record, and writing the first record in the database Two records.
  • the record type of the fourth record may be the same as the record type of the first record.
  • S102 Determine task information of the expired task at a preset time.
  • the task information of the expired task can be determined at the preset time.
  • the preset time may be the time of the first time interval every interval from the first time. For example, from 0:00 on January 1, 2010, every hour of the interval, that is, 0 o'clock, 1 o'clock, 2 o'clock, and the like.
  • the task information may include: a current time.
  • the current time is 02:00:00 on January 01, 2015, and the task information may be "current time: 01:01, 01:00:0:00,".
  • the task information may further include a task number and a total number of tasks.
  • the determining the expired task information at the preset time may further include: determining the total number of expired tasks at the preset time; determining according to the total number of expired tasks The task number of the expired task; the task information of the expired task; the task information of the expired task includes: a task number, a total number of tasks, and a current time.
  • the total number of the tasks may be determined according to the number of tasks that the current server can process.
  • the first signal sent by the module for performing the expired operation may be received, and may be determined according to the number of the received first signals.
  • the total number of expired tasks For example, a heartbeat thread sent by a module for performing an expired operation at a preset time interval may be received, and receiving a heartbeat thread may indicate that the module performing the expired operation can currently process an expired task, assuming the number of received first signals At 5, the total number of expired tasks is 5.
  • the task number of the expired task can be determined. For example, the total number of expired tasks is 5, and it can be determined that the task numbers of the five expired tasks are: 0, 1, 2, 3, 4.
  • the task information may include: a task number, a total number of tasks, and a current time.
  • the task information of the expired task with task number 1 can be “task number: 1, total number of tasks: 5, current time: January 01, 2015, 02:00:0”.
  • a device that implements automatic expiration of an object includes a plurality of modules that perform an expired operation, by determining the total number of tasks and numbering the tasks, an automatic task assignment function for each automatic expiration operation module can be realized.
  • S103 Filter out a candidate first record in the first record according to the task information, determine a target object corresponding to the candidate first record, and perform an expiration operation on the target object.
  • the candidate first record in the database may be filtered out. Specifically, determining a current date according to a current time in the task information, and filtering out a first record in the database that has an automatic expiration date and the current date, and determining an automatic expiration time in the filtered first record. Whether it has arrived, and if so, it can be determined that the filtered first record is a candidate first record.
  • the target object may be determined according to the object name in the candidate first record. Specifically, the object corresponding to the object name in the candidate first record may be a target object.
  • the task information is: current time: January 01, 2015, 02:00:00, then the current date may be January 01, 2015.
  • the candidate first record hypothesis that the queried automatic expiration date is the same as the current date and the automatic expiration time has arrived includes: "record type: first record, automatic expiration date: January 01, 2015 Day, automatic expiration time: 01:01, 01:01:10:00, object name: A" and "record type: first record, automatic expiration date: January 01, 2015, automatic expiration time: 2015 01:15:00, 01:01, object name: B", according to the object name A and the object name B in the candidate first record, the target object can be determined as object A and object B.
  • the method for filtering out the candidate first record may include: The task number, the total number of tasks, and the first preset value in the task information are obtained by using a second preset rule to obtain a first range of the first attribute, determining a current date according to the current time in the task information, and filtering out the database. Determining whether the automatic expiration time in the filtered first record has arrived, if the value of the first attribute belongs to the first range and the first expiration date is the same as the current date, and if so, determining the selected One record is the candidate first record.
  • the second preset rule may be specifically expressed by the following formula:
  • the range formed between start_bucket_no and end_bucket_no may be the first range; es_no represents the task number; es_count represents the total number of tasks; and bucket_count represents the first preset value.
  • the task information is “task number: 1, total number of tasks: 5, current date: January 01, 2015”. Assume that the current time is 02:00:00 on January 01, 2015, the first preset value is 1024, and the first range can be calculated as: 204.8 ⁇ 409.6, then the value of the first attribute can be selected to belong to the first range.
  • the automatic expiration date is the first record of January 01, 2015, determining whether the automatic expiration time in the filtered first record has arrived, and if so, determining the filtered first record
  • the candidate first record may include: “record type: first record, automatic expiration date: January 01, 2015, first attribute value: 230, automatic expiration time: January 01, 2015 01:10:00, object name: A" and "record type: first record, automatic expiration date: January 01, 2015, first attribute value: 260, automatic expiration time: January 01, 2015 01 Time 15 minutes and 0 seconds, object name: B".
  • each of the modules for performing the object expiration operation may determine the target object that the module needs to process by the above steps.
  • the method for implementing an object expiration operation disclosed in the above embodiment generates a first record corresponding to the object only for an object with an automatic expiration time set, and the first record includes an automatic expiration time and an automatic expiration date, and the object expiration operation is performed.
  • the target object may be determined according to the current time in the task information and the automatic expiration date and the automatic expiration time in the first record, and the expiration operation is performed on the determined target object, and the method disclosed in the embodiment of the present application filters the object associated with the object.
  • a record method can quickly filter out the objects that need to perform the expired operation, avoiding all the objects in the object storage system. Object scanning saves the cost of implementing object expiration.
  • adding the user number in the first record may facilitate recording the user information of the automatic expiration time of the setting object. Further, adding the first attribute value to the first record and adding the task number to the task information may implement a function of automatically allocating the expired operation task in a module having a plurality of execution object expiration operations. Further, generating the second record with the first record, it may be determined whether the automatic expiration time has been set for the object, and if it has been set, the automatic expiration time of the object that has been set to the life cycle may be changed.
  • the following describes an apparatus embodiment of the present application for implementing an object expiration operation.
  • the apparatus for implementing an object expiration operation may include: a first recording module 210, a task information module 220, and an expired operation execution module 230.
  • the first recording module 210 may be configured to acquire a request for setting an object life cycle, generate a first record corresponding to the object according to the request, and store the first record.
  • the first recording module 210 is further configured to generate a second record corresponding to the first record according to the request.
  • FIG. 3 is a block diagram of a first recording module in an apparatus embodiment for implementing an object expiration operation according to the present application.
  • the first recording module 210 may include a request obtaining module 211, a first record generating module 212, and a storage module 213. among them,
  • the request obtaining module 211 can be configured to acquire a request for setting an object life cycle.
  • the request may include: an object name and an automatic expiration time.
  • the first record generating module 212 may be configured to generate a first record corresponding to the object according to the request acquired by the request obtaining module 211.
  • the first record may include: an object name, an automatic expiration time, and an automatic expiration date.
  • the storage module 213 can be configured to store the first record generated by the first record generating module 212.
  • the first recording module 210 may further include: a second record generating module 214.
  • the second record generating module 214 can be configured to generate a second record corresponding to the first record according to the request.
  • the storage module 213 is further configured to store the second record generated by the second record generation module 214.
  • the second record may include: an object name and an automatic expiration time.
  • the task information module 220 may be configured to determine task information of the expired task at a preset time, and send the task information to the expired operation execution module 230.
  • the expiration operation execution module 230 may be configured to filter, according to the task information determined by the task information module 220, the candidate first record in the first record generated in the first recording module 210, and determine the candidate number. A corresponding target object is recorded, and an expired operation is performed on the target object.
  • one or more expired operations may be performed.
  • the plurality of expired operation execution modules 230 may simultaneously receive the task information allocated by the task information module 220, determine the target object according to the received task information, and perform an object expiration operation on the target object.
  • the expired operation execution module 230 may include: a task information receiving module 231, a candidate first recording module 232, a target object determining module 233, and a target object expiration module 234. among them,
  • the task information receiving module 231 can be configured to receive task information sent by the task information module 220.
  • the candidate first recording module 232 may be configured to filter the candidate first record in the first record according to the task information received by the task information receiving module 231.
  • the target object determining module 233 can be configured to determine a target object corresponding to the candidate first record selected by the candidate first recording module 232.
  • the target object expiration module 234 can be configured to perform an expiration operation on the target object determined by the target object determining module 233.
  • the device for implementing the object expiration operation may be integrated in the server, or may be a device that is independent of the server and can perform data interaction with the server, which is not limited in this application.
  • the device for implementing the object expiration operation disclosed in the foregoing embodiment corresponds to the method embodiment for implementing the object expiration operation of the present application, and the technical effects of the method embodiment of the present application can be implemented.
  • FIG. 5 is a schematic diagram of the composition of an apparatus for implementing an object expiration operation according to the present application.
  • the device may include a processor 501 and a memory 502. among them,
  • the processor 501 may be configured to acquire a request for setting an object life cycle, generate a first record corresponding to the object according to the request, and store the first record; and may also be used to determine an expired task at a preset time. And the task information is used to filter the candidate first record in the memory according to the task information, determine a target object corresponding to the candidate first record, and perform an expiration operation on the target object.
  • the memory 502 can be used to store an object and a first record corresponding to the object.
  • the processor 501 is further configured to generate a second record corresponding to the first record.
  • the memory 502 can also be used to store a second record.
  • the device that implements the object expiration operation disclosed in the foregoing embodiment corresponds to the method embodiment and the device embodiment in which the object expiration operation is implemented in the present application, and the technical effects of the method embodiment and the device embodiment of the present application can be implemented.
  • the method, apparatus, and device for implementing automatic expiration of an object disclosed in the foregoing embodiments can be well coupled with an existing object storage system, so that an automatic expiration operation can be implemented on an object in an existing object storage system.
  • PLD Programmable Logic Device
  • FPGA Field Programmable Gate Array
  • HDL Hardware Description Language
  • the controller can be implemented in any suitable manner, for example, the controller can take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (eg, software or firmware) executable by the (micro)processor.
  • computer readable program code eg, software or firmware
  • examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, The Microchip PIC18F26K20 and the Silicone Labs C8051F320, the memory controller can also be implemented as part of the memory's control logic.
  • the controller can be logically programmed by means of logic gates, switches, ASICs, programmable logic controllers, and embedding.
  • Such a controller can therefore be considered a hardware component, and the means for implementing various functions included therein can also be considered as a structure within the hardware component.
  • a device for implementing various functions can be regarded as a software module that can be both a method and a hardware component. Structure.
  • the system, device, module or unit illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product having a certain function.
  • the present application can be implemented by means of software plus a necessary general hardware platform. Based on such understanding, portions of the technical solution of the present application that contribute substantially or to the prior art may be embodied in the form of a software product.
  • the computing device includes one or more processors (CPU ), input / output interface, network interface and memory.
  • the computer software product can include instructions for causing a computer device (which can be a personal computer, server, or network device, etc.) to perform the methods described in various embodiments of the present application or portions of the embodiments.
  • the computer software product can be stored in a memory, which may include non-persistent memory, random access memory (RAM), and/or nonvolatile memory in a computer readable medium, such as read only memory (ROM) or Flash memory.
  • RAM random access memory
  • ROM read only memory
  • Memory is an example of a computer readable medium.
  • Computer readable media includes both permanent and non-persistent, removable and non-removable media.
  • Information storage can be implemented by any method or technology.
  • the information can be computer readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read only memory.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • ROM read only memory
  • EEPROM electrically erasable programmable read only memory
  • flash memory or other memory technology
  • compact disk read only memory CD-ROM
  • DVD digital versatile disk
  • Magnetic tape cartridges magnetic tape storage or other magnetic storage devices or any other non-transportable media can be used to store information that can be accessed by a computing device.
  • computer readable media does not include transitory computer readable media, such as modulated data signals and carrier waves.
  • This application can be used in a variety of general purpose or special purpose computer system environments or configurations.
  • the application can be described in the general context of computer-executable instructions executed by a computer, such as a program module.
  • program modules include routines, programs, objects, components that perform particular tasks or implement particular abstract data types, Data structure and more.
  • the present application can also be practiced in distributed computing environments where tasks are performed by remote processing devices that are connected through a communication network.
  • program modules can be located in both local and remote computer storage media including storage devices.

Abstract

一种实现对象过期操作的方法、装置和设备,所述方法包括:获取设置对象生命周期的请求,根据所述请求生成与所述对象对应的第一记录,存储所述第一记录(S101);在预设时间,确定过期任务的任务信息(S102);根据所述任务信息筛选出所述第一记录中的候选第一记录,确定与所述候选第一记录对应的目标对象,对所述目标对象执行过期操作(S103)。该实现对象过期操作的方法、装置和设备可以降低实现对象过期操作的成本。

Description

一种实现对象过期操作的方法、装置和设备 技术领域
本申请涉及计算机数据处理技术领域,特别涉及一种实现对象过期操作的方法、装置和设备。
背景技术
计算机领域中,文件、键值对数据或数据库记录等都可以被称为对象。对象存储系统通常可以用于为用户保存、读取或删除对象。
对象存储系统中为用户保存的对象可能为临时对象,所述临时对象需要在预设的时间后进行删除。这种对过期的对象进行删除即是对对象进行过期操作。
现有的实现对象过期操作的方法包括:为每一对象设置与对象相关联的生命周期,将所述对象的生命周期保存在对象的元数据中,通过设置一个或多个后台线程,在预定的时间可以对对象存储系统中所有对象的元数据进行扫描,判断每一对象元数据中的生命周期是否已过期,若已过期,删除所述对象。
在实现本申请过程中,发明人发现现有技术中至少存在如下问题:所述对象存储系统中,需要执行过期操作的对象可能为一小部分,现有的实现对象过期操作的方法需要设置线程对对象存储系统中的所有对象的元数据进行扫描,使得实现对象过期操作的成本较高。
发明内容
本申请实施例的目的是提供一种实现对象过期操作的方法、装置和设备,以降低实现对象过期操作的成本。
为解决上述技术问题,本申请实施例提供一种实现对象过期操作的方法、装置和设备是这样实现的:
一种实现对象过期操作的方法,包括:获取设置对象生命周期的请求,根据所述请求生成与所述对象对应的第一记录,存储所述第一记录;在预设时间,确定过期任务的任务信息;根据所述任务信息筛选出所述第一记录中的候选第一记录,确定与所述候选第一记录对应的目标对象,对所述目标对象执行过期操作。
优选方案中,所述方法在存储第一记录之前还包括:根据所述请求生成第二记录;所述第二记录与第一记录一一对应。
优选方案中,所述第一记录包括:对象名、自动过期时间和自动过期日期;所述自动过期日期根据所述自动过期时间来确定。
优选方案中,所述第一记录还包括:第一属性值。
优选方案中,所述第一记录还包括:用户编号。
一种实现对象过期操作的装置,包括:第一记录模块、任务信息模块和过期操作执行模块;其中,所述第一记录模块,用于获取设置对象生命周期的请求,根据所述请求生成与所述对象对应的第一记录,存储所述第一记录;所述任务信息模块,用于在预设时间确定过期任务的任务信息,并将所述任务信息发送给过期操作执行模块;所述过期操作执行模块,用于根据所述任务信息模块确定的任务信息筛选出所述第一记录模块中生成的第一记录中的候选第一记录,确定与所述候选第一记录对应的目标对象,对所述目标对象执行过期操作。
一种实现对象过期操作的设备,包括:处理器和存储器;所述处理器,用于获取设置对象生命周期的请求,根据所述请求生成与所述对象对应的第一记录,存储所述第一记录;所述处理器还用于在预设时间确定过期任务的任务信息,根据所述任务信息筛选出所述存储器中的候选第一记录,确定与所述候选第一记录对应的目标对象,对所述目标对象执行过期操作;所述存储器,用于存储对象以及与对象对应的第一记录。
由以上本申请实施例提供的技术方案可见,本申请实施例公开的实现对象过期操作的方法、装置和设备,对设置了自动过期时间的对象生成与所述对象对应的第一记录,第一记录中包括自动过期时间和自动过期日期,在执行对象过期操作时,根据任务信息中的当前时间和第一记录中的自动过期日期、自动过期时间可以确定目标对象,对确定的目标对象执行过期操作,本申请实施例的方案可以通过筛选与对象关联的第一记录的方式快捷地筛选出需要执行过期操作的对象,避免对对象存储系统中的所有对象进行扫描,节省了实现对象过期操作的成本。进一步地,在第一记录中添加用户编号,可以便于记录设置对象自动过期时间的用户信息。进一步地,在第一记录中添加第一属性值以及在任务信息中添加任务编号,可以在具有多个执行对象过期操作的模块时,实现自动分配过期操作任务的功能。进一步地,生成与第一记录的第二记录,可以判断是否已经对所述对象设置过自动过期时间,若已经设置过,还可以实现对已经设置过生命周期的对象进行自动过期时间的更改。此外,本申请实施例公开的实现对象自动过期的方法、装置和设备,可以与已有的对象存储系统很好地耦合,从而可以对已有的对象存储系统中的对象实现自动过期操作。
附图说明
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术 描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请中记载的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实现对象过期操作的一个方法实施例的流程图;
图2是本申请实现对象过期操作的一个装置实施例的模块图;
图3是本申请实现对象过期操作的一个装置实施例中第一记录模块的模块图;
图4是本申请实现对象过期操作的一个装置实施例中过期操作执行模块的模块图;
图5是本申请实现对象过期操作的一个设备实施例的组成示意图。
具体实施方式
本申请实施例提供一种实现对象过期操作的方法、装置和设备。
为了使本技术领域的人员更好地理解本申请中的技术方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都应当属于本申请保护的范围。
图1是本申请实现对象过期操作的一个方法实施例的流程图。如图1所示,所述实现对象过期操作的方法可以包括:
S101:获取设置对象生命周期的请求,根据所述请求生成与所述对象对应的第一记录,存储所述第一记录存储至数据库中。
实现对象过期操作的装置可以获取设置对象生命周期的请求。所述请求可以是预先设置在所述对象过期操作装置中的,也可以是所述对象过期操作装置接收到的用户发来的设置对象生命周期的请求。所述请求可以包括:对象名和自动过期时间。若所述请求是由用户发来的,所述请求还可以包括:用户编号。所述用户编号可以用于标识设置对象生命周期的用户。
所述自动过期时间可以采用绝对时间的方式来表示。例如,所述自动过期时间可以是自1970年1月1日0点起经过的秒数。所述自动过期时间也可以采用年月日的时间方式来表示。
根据所述设置对象生命周期的请求可以生成与所述对象对应的第一记录,可以将所述第一记录存储至数据库中。所述第一记录可以包括:对象名、自动过期日期和自动过期时间。所述自动过期日期可以根据所述自动过期时间来确定,所述自动过期日期可以是所述自动过期时间到达的当天的日期。例如,所述自动过期时间为172810秒(即2天10秒),那么自动过期的日期可以是1970年1月3日。
在另一个实施例中,所述第一记录还可以包括:所述第一记录的记录类型。所述记录类 型可以用于表示所述第一记录的数据类型。
在另一个实施例中,所述第一记录还可以包括:用户编号。
在另一个实施例中,所述第一记录还可包括:第一属性值。所述第一属性值根据第一预设值来确定,具体可以包括:为所述对象名做哈希运算,得到一个整数,利用所述整数对第一预设值进行取余运算得到的结果作为第一属性的值。
本申请中所述第一记录可以采用键值对的形式来实现,所述键值对中的key值可以包括自动过期日期。例如,假设所述第一记录包括对象名和自动过期日期,则可以将自动过期日期作为键值对中的key值,将对象名作为键值对中的value值。假设所述第一记录包括:用户编号、记录类型、自动过期日期、自动过期时间和对象名,则可以将记录类型、自动过期日期、自动过期时间和对象名作为键值对中的key值,将用户编号作为键值对中的value值。当第一记录还包括第一属性值时,采用键值对的形式来实现的第一记录中,所述键值对的key值还可以包括:第一属性值。例如,假设所述第一记录包括:用户编号、记录类型、自动过期日期、第一属性值、自动过期时间和对象名,则可以将记录类型、自动过期日期、第一属性值、自动过期时间和对象名作为键值对中的key值,将用户编号作为键值对中的value值。
在另一个实施例中,所述方法还可以包括,根据所述请求生成第二记录。所述第二记录可以包括:对象名与自动过期时间。所述第二记录可以与第一记录一一对应。
所述第二记录可以采用键值对的形式来实现,第二记录中的对象名可以作为键值对的key值,第二记录中的自动过期时间可以作为键值对的value值。
当所述方法还生成了第二记录时,相应地,将第一记录存储至数据库中之前,还可以包括:在所述数据库中写入第二记录,若第二记录写入成功,可以写入与第二记录对应的第一记录。
上述方法实施例中,通过在数据库中增加写入第二记录,可以判断是否已经对所述对象设置过自动过期时间。
在另一个实施例中,若写入第二记录不成功,所述方法还可以包括:判断所述数据库中是否存在对象名与第二记录对象名相同的第三记录;若不存在,输出写入第二记录不成功的原因;若存在,读取所述第三记录,查找所述数据库中与第三记录对应的第四记录,删除第四记录与第三记录,在数据库中写入第二记录。所述第四记录的记录类型可以与第一记录的记录类型相同。
通过上述步骤,可以实现对已经设置过生命周期的对象进行自动过期时间的更改。
S102:在预设时间,确定过期任务的任务信息。
在预设时间可以确定过期任务的任务信息。所述预设时间可以是从第一时间起每间隔第一时间间隔的时间。例如,从2010年1月1日0点起每间隔1小时的时间,即0点、1点、2点等。
所述任务信息可以包括:当前时间。例如当前时间为2015年01月01日02时0分0秒,则所述任务信息可以为“当前时间:2015年01月01日02时0分0秒”。
在另一个实施例中,所述任务信息还可以包括任务编号和任务总数目。当所述任务信息包括任务编号和任务总数目时,所述在预设时间确定过期任务信息,具体还可以包括:在预设时间,确定过期任务的总数目;根据过期任务的总数目,确定所述过期任务的任务编号;确定过期任务的任务信息;所述过期任务的任务信息包括:任务编号、任务总数目和当前时间。
所述任务的总数目可以根据当前服务器可以处理的任务数目来确定,具体地,可以接收用于执行过期操作的模块发来的第一信号,根据所述接收到的第一信号的数目可以确定过期任务的总数目。例如,可以接收用于执行过期操作的模块在预设时间间隔发来的心跳线程,接收到心跳线程可以说明所述执行过期操作的模块当前可以处理过期任务,假设接收到的第一信号的数目为5,则过期任务的总数目为5。
根据所述过期任务的总数目,可以确定过期任务的任务编号。例如,过期任务的总数目为5,可以确定5个过期任务的任务编号分别为:0、1、2、3、4。所述任务信息可以包括:任务编号、任务总数目和当前时间。例如,任务编号为1的过期任务的任务信息可以为“任务编号:1,任务总数目:5,当前时间:2015年01月01日02时0分0秒”。
当实现对象自动过期的装置中包含多个执行过期操作的模块时,通过确定任务总数目,对任务进行编号,可以实现对每个自动过期操作模块进行自动任务分配的功能。
S103:根据所述任务信息筛选出所述第一记录中的候选第一记录,确定与所述候选第一记录对应的目标对象,对所述目标对象执行过期操作。
根据所述任务信息,可以筛选出所述数据库中的候选第一记录。具体地,根据所述任务信息中的当前时间确定当前日期,筛选出所述数据库中自动过期日期与所述当前日期相同的第一记录,判断所述筛选出的第一记录中的自动过期时间是否已经到达,若是,可以确定所述筛选出的第一记录为候选第一记录。根据所述候选第一记录中的对象名可以确定目标对象,具体地,所述候选第一记录中对象名所对应的对象可以是目标对象。
例如,所述任务信息为:当前时间:2015年01月01日02时0分0秒,那么当前日期可以为2015年01月01日。查询到的自动过期日期与所述当前日期相同且自动过期时间已经到达的候选第一记录假设包括:“记录类型:第一记录,自动过期日期:2015年01月01 日,自动过期时间:2015年01月01日01时10分0秒,对象名:A”和“记录类型:第一记录,自动过期日期:2015年01月01日,自动过期时间:2015年01月01日01时15分0秒,对象名:B”,根据所述候选第一记录中的对象名A和对象名B可以确定目标对象为对象A和对象B。
在另一个实施例中,当所述第一记录还包括第一属性值,并且所述任务信息还包括任务总数目和任务编号时,所述筛选出候选第一记录的方法可以包括:根据所述任务信息中的任务编号、任务总数目和第一预设值,采用第二预设规则得到第一属性的第一范围,根据所述任务信息中的当前时间确定当前日期,筛选出数据库中第一属性的值属于第一范围并且自动过期日期与当前日期相同的第一记录,判断所述筛选出的第一记录中的自动过期时间是否已经到达,若是,可以确定所述筛选出的第一记录为候选第一记录。
所述第二预设规则具体可以用下述公式来表示:
Figure PCTCN2016071174-appb-000001
公式(1)中,start_bucket_no和end_bucket_no之间形成的范围可以是第一范围;es_no表示任务编号;es_count表示任务总数目;bucket_count表示第一预设值。
例如,所述任务信息为“任务编号:1,任务总数目:5,当前日期:2015年01月01日”。假设当前时间为2015年01月01日02时0分0秒,第一预设值为1024,可以计算得到第一范围为:204.8~409.6,那么可以筛选出第一属性的值属于第一范围204.8~409.6,并且自动过期日期为2015年01月01日的第一记录,判断所述筛选出的第一记录中的自动过期时间是否已经到达,若是,可以确定所述筛选出的第一记录为候选第一记录,例如候选第一记录可以包括:“记录类型:第一记录,自动过期日期:2015年01月01日,第一属性值:230,自动过期时间:2015年01月01日01时10分0秒,对象名:A”和“记录类型:第一记录,自动过期日期:2015年01月01日,第一属性值:260,自动过期时间:2015年01月01日01时15分0秒,对象名:B”。
当实现对象过期操作的装置中包含多个用于执行对象过期操作的模块时,通过上述步骤,每一用于执行对象过期操作的模块可以确定所述模块需要处理的目标对象。
上述实施例公开的实现对象过期操作的方法,只对设置了自动过期时间的对象生成与所述对象对应的第一记录,第一记录中包括自动过期时间和自动过期日期,在执行对象过期操作时,根据任务信息中的当前时间和第一记录中的自动过期日期、自动过期时间可以确定目标对象,对确定的目标对象执行过期操作,本申请实施例公开的方法通过筛选与对象关联的第一记录的方式可以快捷地筛选出需要执行过期操作的对象,避免对对象存储系统中的所有 对象进行扫描,节省了实现对象过期操作的成本。进一步地,在第一记录中添加用户编号,可以便于记录设置对象自动过期时间的用户信息。进一步地,在第一记录中添加第一属性值以及在任务信息中添加任务编号,可以在具有多个执行对象过期操作的模块是,实现自动分配过期操作任务的功能。进一步地,生成与第一记录的第二记录,可以判断是否已经对所述对象设置过自动过期时间,若已经设置过,还可以实现对已经设置过生命周期的对象进行自动过期时间的更改。
下面介绍本申请实现对象过期操作的装置实施例。
图2是本申请实现对象过期操作的一个装置实施例的模块图。如图2所示,所述实现对象过期操作的装置,可以包括:第一记录模块210、任务信息模块220和过期操作执行模块230。
所述第一记录模块210,可以用于获取设置对象生命周期的请求,根据所述请求生成与所述对象对应的第一记录,存储所述第一记录。所述第一记录模块210,还可以用于根据所述请求生成与所述第一记录对应的第二记录。
图3是本申请实现对象过期操作的一个装置实施例中第一记录模块的模块图。如图3所示,所述第一记录模块210可以包括:请求获取模块211、第一记录生成模块212和存储模块213。其中,
所述请求获取模块211,可以用于获取设置对象生命周期的请求。所述请求可以包括:对象名和自动过期时间。
所述第一记录生成模块212,可以用于根据所述请求获取模块211获取的请求生成与所述对象对应的第一记录。所述第一记录可以包括:对象名、自动过期时间和自动过期日期。
所述存储模块213,可以用于存储所述第一记录生成模块212生成的第一记录。
在另一个实施例中,所述第一记录模块210还可以包括:第二记录生成模块214。所述第二记录生成模块214,可以用于根据所述请求生成与所述第一记录对应的第二记录。相应地,所述存储模块213还可以用于存储所述第二记录生成模块214生成的第二记录。所述第二记录可以包括:对象名与自动过期时间。
所述任务信息模块220,可以用于在预设时间确定过期任务的任务信息,并将所述任务信息发送给过期操作执行模块230。
所述过期操作执行模块230,可以用于根据所述任务信息模块220确定的任务信息筛选出所述第一记录模块210中生成的第一记录中的候选第一记录,确定与所述候选第一记录对应的目标对象,对所述目标对象执行过期操作。
需要说明的是,所述实现对象过期操作的装置中,可以设置有一个或多个过期操作执行 模块230。所述多个过期操作执行模块230可以同时接收任务信息模块220分配来的任务信息,并根据接收到的任务信息确定目标对象,对目标对象执行对象过期操作。
图4是本申请实现对象过期操作的一个装置实施例中过期操作执行模块的模块图。如图4所示,所述过期操作执行模块230可以包括:任务信息接收模块231、候选第一记录模块232、目标对象确定模块233和目标对象过期模块234。其中,
所述任务信息接收模块231,可以用于接收任务信息模块220发来的任务信息。
所述候选第一记录模块232,可以用于根据所述任务信息接收模块231接收到的任务信息筛选出第一记录中的候选第一记录。
所述目标对象确定模块233,可以用于确定与所述候选第一记录模块232筛选出的候选第一记录对应的目标对象。
所述目标对象过期模块234,可以用于对所述目标对象确定模块233确定的目标对象执行过期操作。
需要说明的是,所述实现对象过期操作的装置可以是集成在服务器中的,也可以是独立与服务器并可以与服务器进行数据交互的装置,本申请对此并不作出限定。
上述实施例公开的实现对象过期操作的装置与本申请实现对象过期操作的方法实施例相对应,可以实现本申请方法实施例的技术效果。
下面介绍本申请实现对象过期操作的设备实施例。
图5是本申请实现对象过期操作的一个设备实施例的组成示意图。如图5所示,所述设备可以包括:处理器501和存储器502。其中,
所述处理器501,可以用于获取设置对象生命周期的请求,根据所述请求生成与所述对象对应的第一记录,存储所述第一记录;还可以用于在预设时间确定过期任务的任务信息,根据所述任务信息筛选出所述存储器中的候选第一记录,确定与所述候选第一记录对应的目标对象,对所述目标对象执行过期操作。
所述存储器502,可以用于存储对象以及与对象对应的第一记录。
在另一个实施例中,所述处理器501,还可以用于生成与第一记录对应的第二记录。相应地,所述存储器502,还可以用于存储第二记录。
上述实施例公开的实现对象过期操作的设备与本申请实现对象过期操作的方法实施例、装置实施例相对应,可以实现本申请方法实施例和装置实施例的技术效果。
此外,上述实施例公开的实现对象自动过期的方法、装置和设备,可以与已有的对象存储系统很好地耦合,从而可以对已有的对象存储系统中的对象实现自动过期操作。
在20世纪90年代,对于一个技术的改进可以很明显地区分是硬件上的改进(例如,对二极管、晶体管、开关等电路结构的改进)还是软件上的改进(对于方法流程的改进)。然而,随着技术的发展,当今的很多方法流程的改进已经可以视为硬件电路结构的直接改进。设计人员几乎都通过将改进的方法流程编程到硬件电路中来得到相应的硬件电路结构。因此,不能说一个方法流程的改进就不能用硬件实体模块来实现。例如,可编程逻辑器件(Programmable Logic Device,PLD)(例如现场可编程门阵列(Field Programmable Gate Array,FPGA))就是这样一种集成电路,其逻辑功能由用户对器件编程来确定。由设计人员自行编程来把一个数字系统“集成”在一片PLD上,而不需要请芯片制造厂商来设计和制作专用的集成电路芯片2。而且,如今,取代手工地制作集成电路芯片,这种编程也多半改用“逻辑编译器(logic compiler)”软件来实现,它与程序开发撰写时所用的软件编译器相类似,而要编译之前的原始代码也得用特定的编程语言来撰写,此称之为硬件描述语言(Hardware Description Language,HDL),而HDL也并非仅有一种,而是有许多种,如ABEL(Advanced Boolean Expression Language)、AHDL(Altera Hardware Description Language)、Confluence、CUPL(Cornell University Programming Language)、HDCal、JHDL(Java Hardware Description Language)、Lava、Lola、MyHDL、PALASM、RHDL(Ruby Hardware Description Language)等,目前最普遍使用的是VHDL(Very-High-Speed Integrated Circuit Hardware Description Language)与Verilog2。本领域技术人员也应该清楚,只需要将方法流程用上述几种硬件描述语言稍作逻辑编程并编程到集成电路中,就可以很容易得到实现该逻辑方法流程的硬件电路。
控制器可以按任何适当的方式实现,例如,控制器可以采取例如微处理器或处理器以及存储可由该(微)处理器执行的计算机可读程序代码(例如软件或固件)的计算机可读介质、逻辑门、开关、专用集成电路(Application Specific Integrated Circuit,ASIC)、可编程逻辑控制器和嵌入微控制器的形式,控制器的例子包括但不限于以下微控制器:ARC 625D、Atmel AT91SAM、Microchip PIC18F26K20以及Silicone Labs C8051F320,存储器控制器还可以被实现为存储器的控制逻辑的一部分。
本领域技术人员也知道,除了以纯计算机可读程序代码方式实现控制器以外,完全可以通过将方法步骤进行逻辑编程来使得控制器以逻辑门、开关、专用集成电路、可编程逻辑控制器和嵌入微控制器等的形式来实现相同功能。因此这种控制器可以被认为是一种硬件部件,而对其内包括的用于实现各种功能的装置也可以视为硬件部件内的结构。或者甚至,可以将用于实现各种功能的装置视为既可以是实现方法的软件模块又可以是硬件部件内的结 构。
上述实施例阐明的系统、装置、模块或单元,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。
为了描述的方便,描述以上装置时以功能分为各种单元分别描述。当然,在实施本申请时可以把各单元的功能在同一个或多个软件和/或硬件中实现。
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本申请可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。该计算机软件产品可以包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例或者实施例的某些部分所述的方法。该计算机软件产品可以存储在内存中,内存可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。内存是计算机可读介质的示例。计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括短暂电脑可读媒体(transitory media),如调制的数据信号和载波。
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于系统实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本申请可用于众多通用或专用的计算机系统环境或配置中。例如:个人计算机、服务器计算机、手持设备或便携式设备、平板型设备、多处理器系统、基于微处理器的系统、置顶盒、可编程的消费电子设备、网络PC、小型计算机、大型计算机、包括以上任何系统或设备的分布式计算环境等等。
本申请可以在由计算机执行的计算机可执行指令的一般上下文中描述,例如程序模块。一般地,程序模块包括执行特定任务或实现特定抽象数据类型的例程、程序、对象、组件、 数据结构等等。也可以在分布式计算环境中实践本申请,在这些分布式计算环境中,由通过通信网络而被连接的远程处理设备来执行任务。在分布式计算环境中,程序模块可以位于包括存储设备在内的本地和远程计算机存储介质中。
虽然通过实施例描绘了本申请,本领域普通技术人员知道,本申请有许多变形和变化而不脱离本申请的精神,希望所附的权利要求包括这些变形和变化而不脱离本申请的精神。

Claims (24)

  1. 一种实现对象过期操作的方法,其特征在于,包括:
    获取设置对象生命周期的请求,根据所述请求生成与所述对象对应的第一记录,存储所述第一记录;
    在预设时间,确定过期任务的任务信息;
    根据所述任务信息筛选出所述第一记录中的候选第一记录,确定与所述候选第一记录对应的目标对象,对所述目标对象执行过期操作。
  2. 如权利要求1所述的一种实现对象过期操作的方法,其特征在于,所述方法在存储第一记录之前还包括:根据所述请求生成第二记录;所述第二记录与第一记录一一对应。
  3. 如权利要求2所述的一种实现对象过期操作的方法,其特征在于,所述第二记录包括:对象名与自动过期时间。
  4. 如权利要求2所述的一种实现对象过期操作的方法,其特征在于,所述存储第一记录包括:在数据库中写入第二记录,若第二记录写入成功,写入与第二记录对应的第一记录。
  5. 如权利要求4所述的一种实现对象过期操作的方法,其特征在于,所述存储第一记录包括:若写入第二记录不成功,判断所述数据库中是否存在对象名与第二记录对象名相同的第三记录;若不存在,输出写入第二记录不成功的原因。
  6. 如权利要求5所述的一种实现对象过期操作的方法,其特征在于,若所述数据库中存在对象名与第二记录对象名相同的第三记录,所述存储第一记录包括:查找所述数据库中与第三记录对应的第四记录,删除第四记录与第三记录,在数据库中写入第二记录;所述第四记录的记录类型与第一记录的记录类型相同。
  7. 如权利要求1所述的一种实现对象过期操作的方法,其特征在于,所述设置对象生命周期的请求包括:对象名和自动过期时间。
  8. 如权利要求7所述的一种实现对象过期操作的方法,其特征在于,所述第一记录包括:对象名、自动过期时间和自动过期日期;所述自动过期日期根据所述自动过期时间来确 定。
  9. 如权利要求8所述的一种实现对象过期操作的方法,其特征在于,所述任务信息包括:当前时间。
  10. 如权利要求9所述的一种实现对象过期操作的方法,其特征在于,所述根据任务信息筛选出所述第一记录中的候选第一记录,包括:根据所述当前时间确定当前日期,筛选出自动过期日期与所述当前日期相同的第一记录,判断所述筛选出的第一记录中的自动过期时间是否已经到达,若是,所述筛选出的第一记录确定为候选第一记录。
  11. 如权利要求8所述的一种实现对象过期操作的方法,其特征在于,所述第一记录还包括:第一属性值。
  12. 如权利要求11所述的一种实现对象过期操作的方法,其特征在于,所述第一属性值根据第一预设值来确定,包括:为所述对象名做哈希运算,得到一个整数,利用所述整数对第一预设值进行取余运算得到的结果作为第一属性的值。
  13. 如权利要求12所述的一种实现对象过期操作的方法,其特征在于,所述任务信息还包括:任务编号和任务总数目。
  14. 如权利要求13所述的一种实现对象过期操作的方法,其特征在于,所述任务的总数目根据当前服务器可处理的任务数目来确定,包括:接收用于执行过期操作的模块发来的第一信号,根据所述接收到的第一信号的数目确定过期任务的总数目。
  15. 如权利要求13所述的一种实现对象过期操作的方法,其特征在于,当所述第一记录包括第一属性值,并且所述任务信息包括任务总数目和任务编号时,所述筛选出候选第一记录的方法包括:
    根据所述任务信息中的任务编号、任务总数目和第一预设值,采用第二预设规则得到第一属性的第一范围;
    根据所述当前时间确定当前日期,筛选出第一属性的值属于第一范围并且自动过期日期与所述当前日期相同的第一记录;
    判断所述筛选出的第一记录中的自动过期时间是否已经到达,若是,所述筛选出的第一记录确定为候选第一记录。
  16. 如权利要求8所述的一种实现对象过期操作的方法,其特征在于,所述第一记录还包括:所述第一记录的记录类型。
  17. 如权利要求8所述的一种实现对象过期操作的方法,其特征在于,所述第一记录还包括:用户编号。
  18. 如权利要求8所述的一种实现对象过期操作的方法,其特征在于,所述第一记录采用键值对的形式来实现。
  19. 一种实现对象过期操作的装置,其特征在于,包括:第一记录模块、任务信息模块和过期操作执行模块;其中,
    所述第一记录模块,用于获取设置对象生命周期的请求,根据所述请求生成与所述对象对应的第一记录,存储所述第一记录;
    所述任务信息模块,用于在预设时间确定过期任务的任务信息,并将所述任务信息发送给过期操作执行模块;
    所述过期操作执行模块,用于根据所述任务信息模块确定的任务信息筛选出所述第一记录模块中生成的第一记录中的候选第一记录,确定与所述候选第一记录对应的目标对象,对所述目标对象执行过期操作。
  20. 如权利要求19所述的一种实现对象过期操作的装置,其特征在于,所述第一记录模块包括:请求获取模块、第一记录生成模块和存储模块;其中,
    所述请求获取模块,用于获取设置对象生命周期的请求;所述请求包括:对象名和自动过期时间;
    所述第一记录生成模块,用于根据所述请求获取模块获取的请求生成与所述对象对应的第一记录;所述第一记录包括:对象名、自动过期时间和自动过期日期;
    所述存储模块,用于存储所述第一记录生成模块生成的第一记录。
  21. 如权利要求20所述的一种实现对象过期操作的装置,其特征在于,所述第一记录 模块还包括:第二记录生成模块;所述第二记录生成模块,用于根据所述请求生成与所述第一记录对应的第二记录;
    相应地,所述存储模块还用于存储所述第二记录生成模块生成的第二记录;所述第二记录包括:对象名与自动过期时间。
  22. 如权利要求19所述的一种实现对象过期操作的装置,其特征在于,所述过期操作执行模块包括:任务信息接收模块、候选第一记录模块、目标对象确定模块和目标对象过期模块;其中,
    所述任务信息接收模块,用于接收任务信息模块发来的任务信息;
    所述候选第一记录模块,用于根据所述任务信息接收模块接收到的任务信息筛选出第一记录中的候选第一记录;
    所述目标对象确定模块,用于确定与所述候选第一记录模块筛选出的候选第一记录对应的目标对象;
    所述目标对象过期模块,用于对所述目标对象确定模块确定的目标对象执行过期操作。
  23. 一种实现对象过期操作的设备,其特征在于,包括:处理器和存储器;其中,
    所述处理器,用于获取设置对象生命周期的请求,根据所述请求生成与所述对象对应的第一记录,将所述第一记录存储至存储器中;所述处理器还用于在预设时间确定过期任务的任务信息,根据所述任务信息筛选出所述存储器中的候选第一记录,确定与所述候选第一记录对应的目标对象,对所述目标对象执行过期操作;
    所述存储器,用于存储对象以及与对象对应的第一记录。
  24. 如权利要求23所述的一种实现对象过期操作的设备,其特征在于,所述处理器,还用于生成与第一记录对应的第二记录;相应地,所述存储器还用于存储第二记录。
PCT/CN2016/071174 2015-01-22 2016-01-18 一种实现对象过期操作的方法、装置和设备 WO2016116020A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510032593.4 2015-01-22
CN201510032593.4A CN105868216B (zh) 2015-01-22 2015-01-22 一种实现对象过期操作的方法、装置和设备

Publications (1)

Publication Number Publication Date
WO2016116020A1 true WO2016116020A1 (zh) 2016-07-28

Family

ID=56416430

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/071174 WO2016116020A1 (zh) 2015-01-22 2016-01-18 一种实现对象过期操作的方法、装置和设备

Country Status (2)

Country Link
CN (1) CN105868216B (zh)
WO (1) WO2016116020A1 (zh)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110033249A (zh) * 2019-03-01 2019-07-19 阿里巴巴集团控股有限公司 一种流水落表方法及装置
CN110737389A (zh) * 2018-07-19 2020-01-31 杭州海康威视系统技术有限公司 存储数据的方法和装置

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106407269A (zh) * 2016-08-25 2017-02-15 刘华英 存储空间对象的处理方法和装置
CN109948098B (zh) * 2019-02-21 2021-07-06 网宿科技股份有限公司 数据过滤方法、缓存信息的记录方法及装置
CN111061689A (zh) * 2019-12-13 2020-04-24 北京金山云网络技术有限公司 用于对象存储系统的文件过期处理方法、装置及电子设备

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004199456A (ja) * 2002-12-19 2004-07-15 Kyocera Mita Corp 印刷システム
CN101060402A (zh) * 2006-04-21 2007-10-24 盛趣信息技术(上海)有限公司 基于Hash-map的多点缓存装置
CN101093506A (zh) * 2006-06-21 2007-12-26 京瓷美达株式会社 具有辅助存储装置的图像形成装置
US20080243966A1 (en) * 2007-04-02 2008-10-02 Croisettier Ramanakumari M System and method for managing temporary storage space of a database management system
CN102024015A (zh) * 2009-09-18 2011-04-20 软件股份公司 用于批量删除数据库系统的数据记录的方法
CN103870549A (zh) * 2014-02-27 2014-06-18 中国石油天然气股份有限公司 石油地质软件数据的清理方法及装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100487705C (zh) * 2007-05-25 2009-05-13 中兴通讯股份有限公司 一种全内存数据库的数据存取方法

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004199456A (ja) * 2002-12-19 2004-07-15 Kyocera Mita Corp 印刷システム
CN101060402A (zh) * 2006-04-21 2007-10-24 盛趣信息技术(上海)有限公司 基于Hash-map的多点缓存装置
CN101093506A (zh) * 2006-06-21 2007-12-26 京瓷美达株式会社 具有辅助存储装置的图像形成装置
US20080243966A1 (en) * 2007-04-02 2008-10-02 Croisettier Ramanakumari M System and method for managing temporary storage space of a database management system
CN102024015A (zh) * 2009-09-18 2011-04-20 软件股份公司 用于批量删除数据库系统的数据记录的方法
CN103870549A (zh) * 2014-02-27 2014-06-18 中国石油天然气股份有限公司 石油地质软件数据的清理方法及装置

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110737389A (zh) * 2018-07-19 2020-01-31 杭州海康威视系统技术有限公司 存储数据的方法和装置
CN110737389B (zh) * 2018-07-19 2023-05-16 杭州海康威视系统技术有限公司 存储数据的方法和装置
CN110033249A (zh) * 2019-03-01 2019-07-19 阿里巴巴集团控股有限公司 一种流水落表方法及装置
CN110033249B (zh) * 2019-03-01 2023-09-29 创新先进技术有限公司 一种流水落表方法及装置

Also Published As

Publication number Publication date
CN105868216B (zh) 2019-11-19
CN105868216A (zh) 2016-08-17

Similar Documents

Publication Publication Date Title
WO2016116020A1 (zh) 一种实现对象过期操作的方法、装置和设备
TWI691855B (zh) 基於區塊鏈的資料處理方法及設備
CN110674228B (zh) 数据仓库模型构建和数据查询方法、装置及设备
WO2018177235A1 (zh) 一种区块链共识方法及装置
US11216476B2 (en) Data processing method, apparatus, and device
CN112036736B (zh) 一种工作流创建方法及装置
TWI709931B (zh) 一種指標異常檢測方法、裝置以及電子設備
WO2017049965A1 (zh) 数据备份的方法和数据处理系统
CN109960686B (zh) 数据库的日志处理方法和装置
WO2016110202A1 (zh) 一种显示页面的方法、客户端及设备
WO2018058944A1 (zh) 一种删除级联快照的方法及装置
WO2019196551A1 (zh) 一种配置支付流程、执行支付流程的方法、装置及设备
CN111881135A (zh) 一种数据聚合方法、装置、设备及计算机可读存储介质
CN110297955B (zh) 一种信息查询方法、装置、设备及介质
WO2019015490A1 (zh) 一种数据处理方法、装置、设备及系统
CN108427737B (zh) 一种数据清理方法、设备及计算机可读介质
US10210165B2 (en) File management for eDiscovery
US9454557B2 (en) Unit of work based incremental data processing
WO2016062197A1 (zh) 一种类目目录确定方法及装置、自动分类方法及装置
WO2024046015A1 (zh) 一种数据查询方法、装置、存储介质及电子设备
CN116048977B (zh) 一种基于数据还原的测试方法及装置
CN110083602B (zh) 一种基于hive表的数据存储及数据处理的方法及装置
WO2023213118A1 (zh) 任务调度的方法、装置和设备
CN111177141A (zh) 利用MySQL并行复制恢复数据方法、设备及系统
US11249990B2 (en) Database management method and system, and electronic device

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: 16739767

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: 16739767

Country of ref document: EP

Kind code of ref document: A1