WO2021073260A1 - Object management method and apparatus, computer device, and storage medium - Google Patents

Object management method and apparatus, computer device, and storage medium Download PDF

Info

Publication number
WO2021073260A1
WO2021073260A1 PCT/CN2020/111425 CN2020111425W WO2021073260A1 WO 2021073260 A1 WO2021073260 A1 WO 2021073260A1 CN 2020111425 W CN2020111425 W CN 2020111425W WO 2021073260 A1 WO2021073260 A1 WO 2021073260A1
Authority
WO
WIPO (PCT)
Prior art keywords
change
time
cumulative
database
sampling time
Prior art date
Application number
PCT/CN2020/111425
Other languages
French (fr)
Chinese (zh)
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 WO2021073260A1 publication Critical patent/WO2021073260A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/70Information retrieval; Database structures therefor; File system structures therefor of video data
    • G06F16/73Querying
    • G06F16/732Query formulation
    • 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/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • G06F16/24553Query execution of query operations
    • G06F16/24558Binary matching operations

Definitions

  • This application relates to the field of data processing technology, in particular to an object management method, device, computer equipment and storage medium.
  • the video image information database is the core part of video analysis, and is responsible for providing data aggregation access, data processing, data resource storage, data services, data cascading, data opening capabilities, and video library software applications.
  • Video image information database (hereinafter referred to as the video library)
  • the objects managed by the video library include at least but not limited to video clip objects, image objects, file objects, human objects, face objects, motor vehicle objects, non-motor vehicle objects, object objects, and scenes There are 11 categories of objects, video case event objects, and video image tag objects.
  • the video library manages all objects, it includes operations such as warehousing (the process of uploading image data from the collection device/collection platform to the video library), out of the library (the process of uploading the video library to the external system), deletion, and modification.
  • the prior art has the problem that it takes a long time to query the object statistical result from the view library.
  • an object management method which includes:
  • the query request means a request to query at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object in the time period to be queried, and the time period to be queried includes the start time and the end time;
  • the first database includes objects The change record of the object, the change record of the object includes the change time when the number of objects changes and the corresponding change amount; the first sampling time is the sampling time before the end time and the closest interval to the end time, and the second sampling time is at the start time The sampling time before and closest to the end time;
  • the second database includes the cumulative change records of the object, and the cumulative change The record includes the cumulative change number of the object from the initial time of the system to each sampling time;
  • the first cumulative change quantity, the second cumulative change quantity, the third cumulative change quantity, and the fourth cumulative change quantity at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object in the time period to be queried is obtained.
  • the duration of the time period to be queried is less than the first preset duration threshold, the number of changes corresponding to the change time from the start time to the end time is obtained from the first database, and the cumulative change is determined according to the number of changes At least one of quantity, total change quantity, and total quantity.
  • the cumulative change quantity includes one of the cumulative storage quantity, the cumulative storage quantity, and the cumulative deletion quantity; the change record and the cumulative change record include the change type, and the change type includes at least one of storage, delivery, and deletion. One kind.
  • the total number of changes in the object during the time period to be queried represents the cumulative number of objects in the inventory during the time period to be queried minus the cumulative number of outgoing objects; or, the total number of changes in the object during the time period to be queried represents Query the cumulative inbound quantity of objects within the query period minus the cumulative outbound quantity and the cumulative deleted quantity;
  • the total number of objects in the time period to be queried represents at least one of the number of objects at the initial time of the system plus the total number of changes in the objects in the time period to be queried.
  • the method further includes:
  • the change information includes at least one of inbound information, outbound information, and deletion information;
  • the first database and the second database are updated according to the change information.
  • the above-mentioned updating the first database according to the change information includes:
  • the change record corresponding to the change information is stored in the first database;
  • the preset condition includes that the storage time since the last change record reaches the second preset duration threshold, or the preset condition includes the first change information
  • the number reaches the preset number threshold, and the first change information is change information corresponding to the change record that is not stored in the first database.
  • the above-mentioned updating the second database according to the operation change information includes:
  • the cumulative change quantity from the initial time of the system to the current sampling time is obtained, and the cumulative change record containing the cumulative change quantity from the initial time of the system to the current sampling time is stored in the second database.
  • the above-mentioned change record and cumulative change record also include the object's generating device ID and the object category.
  • the above-mentioned cumulative number of changes, total number of changes, and total number include the cumulative number of changes, total number of changes, and total number of objects in the specific ID generating device; and/or, the number of cumulative changes, total number of changes,
  • the total quantity includes the cumulative change quantity, total change quantity, and total quantity of objects of a specific category.
  • an embodiment of the present application provides an object management device, the device includes:
  • the receiving module is used to receive the query request of the object;
  • the query request indicates a request to query at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object in the time period to be queried, and the time period to be queried includes the start time and the end time;
  • the first acquisition module is configured to acquire, in the first database, the first change quantity corresponding to the first change time between the first sampling time and the end time, and the second change time between the second sampling time and the start time
  • the corresponding second change quantity, the first cumulative change quantity between the first sampling time and the end time is obtained according to the first change quantity
  • the second cumulative change quantity between the second sampling time and the start time is obtained according to the second change quantity
  • the first database includes the change record of the object, the change record of the object includes the change time at which the number of objects changes and the corresponding change number
  • the first sampling time is the sampling time before the end time and the closest interval to the end time, the first 2.
  • the sampling time is the sampling time before the start time and closest to the end time;
  • the second acquiring module is used to acquire the third cumulative change quantity from the initial time of the system to the first sampling time and the fourth cumulative change quantity from the initial time of the system to the second sampling time in the second database;
  • the second database includes objects
  • the cumulative change record of the, the cumulative change record includes the cumulative change number of the object from the initial time of the system to each sampling time;
  • the determination module is used to obtain the cumulative change number, total change number, and total number of the object in the time period to be queried according to the first cumulative change quantity, the second cumulative change quantity, the third cumulative change quantity, and the fourth cumulative change quantity. At least one.
  • an embodiment of the present application provides a computer device, including a memory and a processor, the memory stores a computer program, and the processor implements the steps of any one of the methods provided in the embodiments of the first aspect when the processor executes the computer program.
  • an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the methods provided in the embodiments of the first aspect are implemented.
  • the object management method, device, computer equipment, and storage medium provided by the embodiments of the present application, when it is necessary to query the outbound/inbound/deleted quantity of objects in the time period (t1, t2), because the first database stores
  • the change record of the object the change record of the object includes the change time of the change in the number of objects and the corresponding change amount.
  • the cumulative change record of the object is stored in the second database.
  • the cumulative change record includes the object from the initial time of the system to each sampling time.
  • FIG. 1 is an application environment diagram of an object management method provided by an embodiment
  • FIG. 2 is a schematic flowchart of an object management method provided by an embodiment
  • FIG. 3 is a schematic flowchart of an object management method provided by an embodiment
  • FIG. 4 is a schematic flowchart of an object management method provided by an embodiment
  • FIG. 5 is a structural block diagram of an object management device provided by an embodiment
  • FIG. 6 is a structural block diagram of an object management apparatus provided by an embodiment
  • FIG. 7 is a structural block diagram of an object management apparatus provided by an embodiment
  • Fig. 8 schematically shows a block diagram of a computing processing device for executing the method according to the present invention
  • Fig. 9 schematically shows a storage unit for holding or carrying program codes for implementing the method according to the present invention.
  • the object management method provided by the present application can be applied to an application environment as shown in FIG. 1, in which a processor of a computer device is used to provide computing and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system, a computer program, and a database.
  • the internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium.
  • the database of the computer equipment is used to store the data of the object management method.
  • the network interface of the computer device is used to communicate with other external devices through a network connection.
  • the computer program is executed by the processor to realize an object management method.
  • counting objects in the time domain is a frequently faced problem.
  • object operations including addition, deletion, modification, and checking.
  • object operations including addition, deletion, modification, and checking.
  • the objects managed by the public security video image information database include at least video clip objects, image objects, file objects, personnel objects, face objects, motor vehicle objects, non-motor vehicle objects, object objects, scene objects, and videos. 11 categories such as case event objects and video image tag objects. Among them, these objects are uploaded by the collection equipment/collection platform (called warehousing) to the visual library, and the uploaded category, warehousing mark, number, time stamp and other information are recorded by the log system; in addition, these objects can also be used by other objects.
  • warehousing collection equipment/collection platform
  • the log system will also record the category, entry and exit tags, number, timestamp and other information of the objects out of the library.
  • the stored object can also have a life cycle, that is, it will be deleted when it expires. Assuming that each collection device is calculated based on 5000 records stored in the warehouse every day, 150,000 records in a month can be generated, and 1.8 million records in a year can be generated. At this time, it may be easy to query the data within a few days. If you query the total amount of storage in the past year, directly accumulating these records is quite resource-consuming, and the time consumed is uncontrollable. Therefore, the embodiments of the present application provide an object management method, device, computer equipment, and storage medium, which are intended to solve the technical problem of long time-consuming when querying object statistical results from the view library.
  • the execution subject of Figures 2 to 4 is a computer device, where the execution subject can also be an object management device, where the device can be implemented through software, hardware, or software and hardware.
  • the combination is realized as part or all of the computer equipment.
  • FIG. 2 provides an object management method. This embodiment relates to a computer device according to a query request to query the database for the cumulative number of changes, the total number of changes, and the total number of changes in the database during the time period to be queried.
  • the specific process of at least one of, as shown in Figure 2, the method includes:
  • S101 Receive a query request of an object; the query request indicates a request to query at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object in the time period to be queried.
  • the time period to be queried includes the start time and the end time.
  • the object represents any object that needs to be managed, and the object here may be an object to be queried or an object to be updated.
  • the query request means a request for querying the cumulative change quantity, total change quantity, or total quantity of an object.
  • the query request may include the change type, device ID and/or object category.
  • the types of changes include outbound, inbound, or deleted.
  • the cumulative amount of change includes the accumulated inbound quantity, the accumulated outbound quantity, or the accumulated deleted quantity.
  • the accumulated storage quantity represents the sum of the object storage quantity in a time period
  • the accumulated storage quantity represents the sum of the object storage quantity in a time period
  • the cumulative deletion quantity represents the sum of the object deletion quantity in a time period.
  • the total number of changes represents the cumulative number of objects in the inventory during the time period to be queried minus the cumulative number of objects out of the library; when the object contains a life cycle, the expired objects will be deleted, and the total number of changes represents the time period to be queried The accumulated inbound quantity of the object minus the accumulated outbound quantity and the accumulated deleted quantity.
  • the total number represents the total number at time T, that is, the number at the initial time of the system plus the total number of changes in the time period 0-T. It should be noted that when the query request is to query the total number of time periods to be queried, only the end time (time T) needs to be given, and the start time defaults to the initial time of the system.
  • Object categories include, but are not limited to, video clip objects, image objects, file objects, human objects, face objects, motor vehicle objects, non-motor vehicle objects, article objects, scene objects, video case event objects, video image tag objects, etc.
  • a query request may be, for example, to query the number of face objects from the device with ID X1 between 14:00 on October 1st and 15:00 on October 2nd.
  • the way for the computer equipment to receive the query request can be to receive the request directly input by the user through the input device, it can also be to receive the request sent by other devices, or it can be to receive the voice request, etc.
  • This embodiment does not limit the way of receiving the query request.
  • the object management method provided in this application is a method used in an information database, for example, a public security video image information database, hereinafter referred to as a video library system.
  • the sampling time represents the preset time for calculating the cumulative change quantity, for example, it can be 23:59:59 every day, that is, the cumulative change quantity of the object is recorded once every day at 23:59:59, for example, the first
  • the cumulative number of changes in the object from the initial time of the system to the sampling time of the first day is recorded.
  • the number of changes from the initial time of the system to the sampling time of the next day is recorded once.
  • the cumulative number of changes in the object between the initial time of the system and the sampling time on the nth day is recorded.
  • the interval between the sampling moments can be fixed or non-fixed, which is not limited here.
  • the sampling time at a fixed interval for example, 23:59:59 every day, is used as the sampling time, and the non-fixed sampling time, for example, when the change record reaches a certain number, the cumulative change amount is calculated, and the time when the cumulative change number is calculated is the sampling time.
  • the first database and the following second database in this step are two databases established in the search server in advance, where the search server means a full-text search engine, such as elasticSearch.
  • the search server means a full-text search engine, such as elasticSearch.
  • This embodiment does not limit the type of search server. As long as it is an engine that can quickly store, search and analyze massive amounts of data.
  • the index in elasticSearch as an example, two indexes statics and days can be created in elasticSearc, corresponding to two databases, the first database is statics, and the second database is days.
  • the first database includes the change record of the object, and the change record of the object includes the change time when the number of the object changes and the corresponding change amount.
  • the change records in the first database are shown in Table 1.
  • the first cumulative change quantity is 0, and the second cumulative change quantity is 8.
  • S103 Acquire the third cumulative change quantity from the initial time of the system to the first sampling time and the fourth cumulative change quantity from the initial time of the system to the second sampling time in the second database; the second database includes the cumulative change record of the object, The cumulative change record includes the cumulative change number of the object from the initial time of the system to each sampling time.
  • the cumulative change records in the second database are shown in Table 3.
  • the query request is to query the number of face objects from the device with ID X1 between 14:00 on October 1st and 15:00 on October 2nd
  • the device ID Is X1 the object category is human face
  • the change type is storage
  • the third cumulative change quantity is 10
  • the fourth cumulative change quantity is 2.
  • S104 according to the first cumulative change quantity, the second cumulative change quantity, the third cumulative change quantity, and the fourth cumulative change quantity, obtain at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object in the time period to be queried .
  • the query request is to query the number of face objects from the device with ID X1 between 14:00 on October 1st and 15:00 on October 2nd
  • the device ID Is X1 the object category is face
  • the change type is warehousing. It can be obtained by using the third cumulative change quantity + the first cumulative change quantity-the fourth cumulative change quantity-the second cumulative change quantity (10+0-2-8)
  • the number of face objects from the device with ID X1 between 14:00 on October 1st and 15:00 on October 2 is zero.
  • the computer device when the computer device queries the cumulative storage quantity of objects in the time period to be queried according to the query request, it can directly query the end time of the time period to be queried from the second database
  • the accumulated storage quantity from the sampling time point before the end time to the end time, and the sampling time point before the start time to the start time can be based on
  • the change records in the first database are analyzed and calculated in real time.
  • the whole process is equivalent to dividing the query time period (t1, t2) with the sampling time as the node as (0, [t1]), ([t1], t1), ( 0,[t2]),([t2],t2) four time periods, for the time period (0,[t1]),(0,[t2]) where the cumulative change number has been recorded in the second database, from The cumulative change quantity is directly obtained in the second database.
  • the time period ([t1],t1),([t2],t2) in the second database that the cumulative change quantity is not recorded then according to the objects stored in the first database Calculate the cumulative change amount in real time for the change record, and finally make the total.
  • the cumulative change amount for most of the time periods does not need to be calculated in real time, only the precise search is performed from the second database, and a small amount of calculations are performed in real time in the first database for a small time period, which can realize fast calculation , Which makes the whole query process less memory consumption and shorter query time.
  • the change record of the object when it is necessary to query the number of outbound/inbound/deleted objects in the time period (t1, t2), since the change record of the object is stored in the first database, the change record of the object includes the object The number of changes at the time of change and the corresponding number of changes.
  • the second database stores the cumulative change record of the object.
  • the cumulative change record includes the cumulative change number of the object from the initial time of the system to each sampling time.
  • the time period to be queried is very short, there is no need to query in two databases, and the calculation can be performed directly in the first database. In one embodiment, if the time period to be queried is less than the first predetermined time period. If the duration threshold is set, the change quantity corresponding to the change time from the start time to the end time is obtained from the first database, and at least one of the cumulative change quantity, the total change quantity, and the total quantity is determined according to the change quantity.
  • the computer device compares the duration of the time period to be queried with the first preset duration threshold, and if the duration of the time period to be queried is less than the first preset duration threshold, the computer device obtains from the first database from the start time to the end
  • the amount of change corresponding to the changing moment between moments in time is determined according to the amount of change, at least one of the cumulative amount of change, the total amount of change, and the total amount.
  • the first preset duration threshold is a preset value, for example, it may be 24 hours, 48 hours, etc., which is not limited in this embodiment. In this way, when the time period to be queried is short, real-time analysis and calculation directly through the first database will not consume too much computing resources, so there is no need to perform the step of obtaining data from the second database.
  • the embodiment of the present application also provides an object management method, which relates to the specific process of updating the first database and the second database by a computer device. As shown in FIG. 3, the method also include:
  • S201 Obtain change information of the object; the change information includes at least one of inbound information, outbound information, and deletion information.
  • the computer device obtains the change information of the object, where the change information includes at least one of warehouse-in information, warehouse-out information, and deletion information.
  • the manner in which the computer device obtains the change information may be determined by receiving the input information of the external device, which is not limited in this embodiment.
  • the computer device Based on the change information obtained in step S201 above, the computer device performs different updates according to the change information, for example, updates the inbound record of the object according to the inbound information, adds the outbound record to the object based on the outbound information, and updates according to the deletion.
  • the information deletes the object and updates the record.
  • the computer device updates the data in the first database and the second database according to the change information of the object, which can ensure the validity, accuracy and timeliness of the data in the first database and the second database Further, the accuracy of the query results in the first database and the second database is ensured.
  • the update process corresponding to different change information provides a process for updating the first database.
  • the change record corresponding to the change information is stored in the first database.
  • the preset condition includes the storage time since the last change record reaches the second preset duration threshold, or the preset condition includes the quantity of the first change information reaches the preset quantity threshold, where the first change information corresponds to the change
  • the information change records the change information that is not stored in the first database.
  • the computer device when the computer device updates the change record in the first database, it is subject to the preset condition, that is, if the storage time from the last change record at the current time reaches the second preset duration threshold, the computer device will update the current time Record all the change information between the time when the last change record was stored; or, if the quantity of the first change information reaches the preset quantity threshold, where the first change information is that the change record corresponding to the change information has not been stored in the first A database of change information, the computer device stores the first change information in the first database. In this way, when the preset conditions are met, the immediacy of the data is guaranteed.
  • a process of updating the second database includes:
  • S301 Obtain a fifth cumulative change quantity at a third sampling time from the second database, where the third sampling time is a sampling time before the current sampling time.
  • the computer device obtains the last accumulated change amount stored in the second database, and the sampling time corresponding to the last accumulated change amount stored in the second database is the third sampling time, that is, the third sampling time is the previous sampling time of the current sampling time .
  • S302 Acquire a third change quantity corresponding to a third change time between the third sampling time and the current sampling time from the first database, and obtain a sixth cumulative change quantity according to the third change quantity.
  • the computer device obtains the amount of change between the third sampling moment and the current sampling moment from the first database, that is, the third amount of change, and the computer analyzes and calculates the sixth cumulative amount of change according to the third amount of change. It can be understood that the sixth cumulative change quantity represents the change from the third sampling moment to the current sampling moment.
  • S303 Obtain the cumulative change quantity at the current sampling time according to the fifth cumulative change quantity and the sixth cumulative change quantity, and store the cumulative change record including the cumulative change quantity at the current sampling time in the second database.
  • the computer device determines the sum of the fifth cumulative change quantity and the sixth cumulative change quantity as the current cumulative change quantity, and stores the cumulative change record of the current sampling time cumulative change quantity in the second database.
  • the sampling time is 23:59:59 every day
  • the current sampling time is 23:59:59 on October 2nd.
  • the fifth cumulative change quantity of 59 is obtained from the first database from October 2 0:0:0 to October 2 23:59:59
  • October 2 0 is obtained from the displayed change quantity:
  • the sixth cumulative change quantity from 0:0 to October 2nd at 23:59:59, and then the cumulative change quantity from the initial time of the system to the current sampling time is obtained from the fifth cumulative change quantity and the sixth cumulative change quantity.
  • the computer device updates the first database and the second database
  • the cumulative change quantity corresponding to each type is updated according to different change types.
  • the accuracy and timeliness of the data in the first database and the second data are ensured.
  • the change record and the cumulative change record also include the object’s generating device ID and the object category; optionally, the cumulative change quantity, total change quantity, and total quantity include the cumulative change of the object in the generating device with a specific ID. Quantity, total change quantity, total quantity; and/or, cumulative change quantity, total change quantity, and total quantity include the cumulative change quantity, total change quantity, and total quantity of a specific type of object.
  • the object's generating device ID represents the ID of the device that generated the object.
  • the device that generated the image is the ID of the collection device that captured the image.
  • the change record and the cumulative change record also include the object's generating device ID to facilitate the identification of the source of the object.
  • the types of objects include human faces, people, and so on.
  • the total quantity can also be queried for the specific ID generating device, the cumulative change quantity, total change quantity, and total quantity of a specific type of object, which is not limited in this embodiment. Dividing objects according to specific IDs and specific types can adapt to different query needs of users.
  • the sampling time of the day (for example, 23:59: 59)
  • the cumulative change quantity is the same as the cumulative change quantity at the sampling time of the previous day.
  • the cumulative change quantity in the second database may not be recorded, or the cumulative change quantity of the previous day can be directly used as the record. The embodiment does not limit this.
  • this application provides a complete embodiment of the process of data storage, update, and query:
  • the statistics of the 11 types of objects can be regarded as operations on a vector in an R 11 space with 11 statistical dimensions. In practical applications, these The object always originates from a uniquely identified collection device/collection platform/external system (referred to by X below), so the vector is identified by the device ID, and written down when writing the log, indicating that the record belongs to device X .
  • X collection device/collection platform/external system
  • the search server as elasticSearch
  • the first database hereinafter referred to as the first index in this embodiment
  • the second database hereinafter referred to as the second index in this embodiment
  • f(t) represents the warehousing number of equipment X at time t
  • the warehousing information of the equipment X at time t is stored in the first index statics
  • the function f(t) is used to represent the number of warehousing
  • S(t) is used to represent the total amount of storage of equipment X from the initial state of the original image system (time 0) to time t, where time 0 is the moment when the view library is deployed and just started, which can be UTC (Uniform Universal Time)
  • the start time (1970-1-100:00:00) of the time can also be the actual project deployment completion time, which is not limited in this embodiment. among them
  • the process of periodically generating original warehouse records and storing them in statics includes: whenever the device/platform uploads the above 11 types of objects to the visual library system, the log module is called in the log It is recorded in the module memory, and the log module records the instantaneous quantity f(t): collect instantaneous storage, storage, and deletion information, and write records to statics.
  • instantaneous refers to a short period of time, such as 5s, 10s, 15s, etc.
  • the log module will periodically (for example, 10 seconds or the number of records in the log memory reaches a certain threshold), and this instantaneous storage Information summary writes records to statics. If there are other objects, they also need to be written.
  • the log module when an object is out of the library every day, or the object is deleted when it expires, the log module will also periodically write records to statics.
  • the following table 4 shows the change records in the first database, which means that within 10s of 1561368429-1561368439, there are 5 faces of device X1 entering the library (here, the change time in a change record is recorded as the time in a short period of time. At the last point in time), there are 3 people leaving the library; within 10s of 1561368439-1561368449, device X1 deletes 1 face and X2 deletes 1 scene.
  • the process of periodically analyzing the original inbound and outbound records to obtain the cumulative change records in the second database includes: the statistics module is responsible for recording the cumulative change number s(t): calculating the two sampling points t i , t i+1 , Cumulative warehousing quantity, cumulative warehousing quantity, or cumulative deletion quantity generated, taking the cumulative warehousing quantity as an example, as an increment
  • the interval between ti and ti +1 may be every fixed time, for example, 23:59:59 every day, or it may be an irregular time.
  • X1 inbound [0,0,0,0,5,0,0,0,0,0,0]
  • the fifth dimension represents the number of faces
  • X1 out Library [0,0,0,3,0,0,0,0,0,0,0]
  • the fourth dimension represents the number of personnel
  • X1 delete [0,0,0,0,1,0 ,0,0,0,0]
  • the fifth dimension represents the number of faces
  • X2 delete [0,0,0,0,0,0,0,0,0,0,1,0,0]
  • the 9th dimension represents the number of scenes.
  • Each dimension of the vector represents the statistical value of the number of objects in a category.
  • the process of updating the accumulated value table days includes:
  • the statistics module is also responsible for writing the cumulative change amount S(t i ) at the end of t i plus the increment S inc into days, that is, The result of is written into days, and for each device X, a cumulative change quantity of inbound, outbound, and deleted is written separately.
  • the cumulative change quantity of the previous day can be used as the cumulative amount of the day
  • the number of changes, or the cumulative change records of the day are not stored in the second database.
  • the process of the quick query method includes: taking the cumulative storage quantity generated by the query device X in the time period [a, b] as an example. Cumulative warehousing quantity
  • step (ii) can be performed before step (i), and the order of steps (i) and (ii) is not limited.
  • an object management device which includes: a receiving module 10, a first acquiring module 11, a second acquiring module 12, and a determining module 13, wherein:
  • the receiving module 10 is used to receive the query request of the object; the query request means to request at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object in the time period to be queried.
  • the time period to be queried includes the start time and the end time ;
  • the first acquisition module 11 is configured to acquire, in the first database, the first change quantity corresponding to the first change time between the first sampling time and the end time, and the second change between the second sampling time and the start time
  • the second change quantity corresponding to the time, the first cumulative change quantity between the first sampling time and the end time is obtained according to the first change quantity
  • the second cumulative change between the second sampling time and the start time is obtained according to the second change quantity Quantity
  • the first database includes the change record of the object, the change record of the object includes the change time when the number of the object changes and the corresponding change quantity
  • the first sampling time is the sampling time before the end time and the closest interval to the end time
  • the second sampling time is the sampling time before the start time and closest to the end time;
  • the second acquiring module 12 is configured to acquire the third cumulative change quantity from the initial time of the system to the first sampling time and the fourth cumulative change quantity from the initial time of the system to the second sampling time in the second database;
  • the second database includes The cumulative change record of the object, which includes the cumulative change amount of the object from the initial time of the system to each sampling time;
  • the determination module 13 is used to obtain the cumulative change number, total change number, and total number of objects in the time period to be queried according to the first cumulative change quantity, the second cumulative change quantity, the third cumulative change quantity, and the fourth cumulative change quantity. At least one of.
  • the object management device provided in the foregoing embodiment has an implementation principle and technical effect similar to the foregoing method embodiment, and will not be repeated here.
  • the change quantity corresponding to the change time from the start time to the end time is obtained from the first database, and the cumulative change quantity is determined according to the change quantity , At least one of the total number of changes and the total number.
  • the object management device provided in the foregoing embodiment has an implementation principle and technical effect similar to the foregoing method embodiment, and will not be repeated here.
  • the cumulative change quantity includes one of the cumulative warehousing quantity, the cumulative exit quantity, and the cumulative deletion quantity; the change record and the cumulative change record include a change type, and the change type includes at least one of warehousing, outgoing, and deletion.
  • the change type includes at least one of warehousing, outgoing, and deletion.
  • the total number of changes of objects in the time period to be queried represents the cumulative number of objects in the inventory during the time period to be queried minus the cumulative number of outgoing objects; or, the total number of changes in the objects during the time period to be queried represents the number of objects to be queried The accumulated inbound quantity of the object within the time period minus the accumulated outbound quantity and the accumulated deleted quantity;
  • the total number of objects in the time period to be queried represents the number of objects at the initial time of the system plus the total number of changes in the objects in the time period to be queried.
  • the object management device provided in the foregoing embodiment has an implementation principle and technical effect similar to the foregoing method embodiment, and will not be repeated here.
  • an object management apparatus is provided, the apparatus further includes: an acquisition module 14 and an update module 15, wherein,
  • the obtaining module 14 is used to obtain change information of the object; the change information includes at least one of inbound information, outbound information, and deletion information;
  • the update module 15 is used to update the first database and the second database according to the change information.
  • the object management device provided in the foregoing embodiment has an implementation principle and technical effect similar to the foregoing method embodiment, and will not be repeated here.
  • the above-mentioned update module 15 is used to store the change record corresponding to the change information in the first database when the preset condition is met; the preset condition includes the storage time since the last change record reaches the second preset duration The threshold value, or the preset condition includes that the quantity of the first change information reaches the preset quantity threshold value, and the first change information is change information corresponding to the change information that is not stored in the first database.
  • the object management device provided in the foregoing embodiment has an implementation principle and technical effect similar to the foregoing method embodiment, and will not be repeated here.
  • an object management apparatus is provided, and the above-mentioned update module 15 includes: a first obtaining unit 151, a second obtaining unit 152, and a storage unit 153, wherein:
  • the first acquiring unit 151 is configured to acquire the fifth cumulative change quantity from the initial time of the system to the third sampling time from the second database, and the third sampling time is the previous sampling time of the current sampling time;
  • the second acquiring unit 152 is configured to acquire the third change quantity corresponding to the third change time between the third sampling time and the current sampling time from the first database, and obtain the sixth cumulative change quantity according to the third change quantity;
  • the storage unit 153 is configured to obtain the cumulative change quantity from the initial time of the system to the current sampling time according to the fifth cumulative change quantity and the sixth cumulative change quantity, and store the cumulative change record containing the cumulative change quantity from the system initial time to the current sampling time To the second database.
  • the object management device provided in the foregoing embodiment has an implementation principle and technical effect similar to the foregoing method embodiment, and will not be repeated here.
  • the above-mentioned change record and cumulative change record further include the object's generating device ID and the object category.
  • the object management device provided in the foregoing embodiment has an implementation principle and technical effect similar to the foregoing method embodiment, and will not be repeated here.
  • the above-mentioned cumulative change number, total change number, and total number include the cumulative change number, total change number, and total number of objects in the specific ID generating device; and/or, the cumulative change number, total change number, and total
  • the quantity includes the cumulative change quantity, the total change quantity, and the total quantity of a specific category of objects.
  • the object management device provided in the foregoing embodiment has an implementation principle and technical effect similar to the foregoing method embodiment, and will not be repeated here.
  • Each module in the above-mentioned object management device can be implemented in whole or in part by software, hardware, and a combination thereof.
  • the above-mentioned modules may be embedded in the form of hardware or independent of the processor in the computer equipment, or may be stored in the memory of the computer equipment in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
  • a computer device is provided.
  • the computer device may be a terminal, and its internal structure diagram may be as shown in FIG. 1.
  • the computer equipment includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus.
  • the processor of the computer device is used to provide calculation and control capabilities.
  • the memory of the computer device includes a non-volatile storage medium and an internal memory.
  • the non-volatile storage medium stores an operating system and computer programs.
  • the internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium.
  • the network interface of the computer device is used to communicate with an external terminal through a network connection.
  • the computer program is executed by the processor to realize an object management method.
  • the display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen
  • the input device of the computer equipment can be a touch layer covered on the display screen, or it can be a button, a trackball or a touchpad set on the housing of the computer equipment , It can also be an external keyboard, touchpad, or mouse.
  • FIG. 1 is only a block diagram of part of the structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied.
  • the specific computer equipment It may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
  • a computer device including a memory and a processor, and a computer program is stored in the memory, and the processor implements the following steps when the processor executes the computer program:
  • the query request means a request to query at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object in the time period to be queried, and the time period to be queried includes the start time and the end time;
  • the first database includes objects The change record of the object, the change record of the object includes the change time when the number of objects changes and the corresponding change amount; the first sampling time is the sampling time before the end time and the closest interval to the end time, and the second sampling time is at the start time The sampling time before and closest to the end time;
  • the second database includes the cumulative change records of the object, and the cumulative change The record includes the cumulative change number of the object from the initial time of the system to each sampling time;
  • the first cumulative change quantity, the second cumulative change quantity, the third cumulative change quantity, and the fourth cumulative change quantity at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object in the time period to be queried is obtained.
  • a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
  • the query request means a request to query at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object in the time period to be queried, and the time period to be queried includes the start time and the end time;
  • the first database includes objects The change record of the object, the change record of the object includes the change time when the number of objects changes and the corresponding change amount; the first sampling time is the sampling time before the end time and the closest interval to the end time, and the second sampling time is at the start time The sampling time before and closest to the end time;
  • the second database includes the cumulative change records of the object, and the cumulative change The record includes the cumulative change number of the object from the initial time of the system to each sampling time;
  • the first cumulative change quantity, the second cumulative change quantity, the third cumulative change quantity, and the fourth cumulative change quantity at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object in the time period to be queried is obtained.
  • the device embodiments described above are merely illustrative.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments. Those of ordinary skill in the art can understand and implement without creative work.
  • the various component embodiments of the present invention may be implemented by hardware, or by software modules running on one or more processors, or by a combination of them.
  • a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the computing processing device according to the embodiments of the present invention.
  • DSP digital signal processor
  • the present invention can also be implemented as a device or device program (for example, a computer program and a computer program product) for executing part or all of the methods described herein.
  • Such a program for realizing the present invention may be stored on a computer-readable medium, or may have the form of one or more signals.
  • Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
  • FIG. 8 shows a computing processing device that can implement the method according to the present invention.
  • the computing processing device traditionally includes a processor 1010 and a computer program product in the form of a memory 1020 or a computer readable medium.
  • the memory 1020 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the memory 1020 has a storage space 1030 for executing the program code 1031 of any method step in the above method.
  • the storage space 1030 for program codes may include various program codes 1031 respectively used to implement various steps in the above method. These program codes can be read from or written into one or more computer program products.
  • Such computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards, or floppy disks.
  • Such a computer program product is usually a portable or fixed storage unit as described with reference to FIG. 9.
  • the storage unit may have storage segments, storage spaces, etc. arranged similarly to the memory 1020 in the computing processing device of FIG. 8.
  • the program code can be compressed in an appropriate form, for example.
  • the storage unit includes computer-readable code 1031', that is, code that can be read by a processor such as 1010, which, when run by a computing processing device, causes the computing processing device to execute the method described above. The various steps.
  • the terms “installed”, “connected”, and “connected” should be understood in a broad sense, for example, they may be fixed connections or detachable connections. , Or integrally connected; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the internal communication between two components.
  • installed e.g., they may be fixed connections or detachable connections. , Or integrally connected; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the internal communication between two components.
  • the disclosed system, device, and method may be implemented in other ways.
  • the device embodiments described above are merely illustrative.
  • the division of the units is only a logical function division, and there may be other divisions in actual implementation.
  • multiple units or components may be combined or It can be integrated into another system, or some features can be ignored or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional units in the various embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer readable storage medium executable by a processor.
  • the technical solution of the present invention essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present invention.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. .
  • any reference signs placed between parentheses should not be constructed as a limitation to the claims.
  • the word “comprising” does not exclude the presence of elements or steps not listed in the claims.
  • the word “a” or “an” preceding an element does not exclude the presence of multiple such elements.
  • the invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims that list several devices, several of these devices may be embodied in the same hardware item.
  • the use of the words first, second, and third, etc. do not indicate any order. These words can be interpreted as names.

Landscapes

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

Abstract

An object management method and apparatus, a computer device, and a storage medium. When the number of objects to be outputted/inputted/deleted within a time period (t1, t2) needs to be queried, it is only necessary to query a second database for an accumulative change record corresponding to a sampling time [t1] that is before t1 and closest to t1 and an accumulative change record corresponding to a sampling time [t2] that is before t2 and closest to t2, to query a first database for change records between two intervals (t1, [t1]) and (t2, [t2]), and then to perform small amount of calculation, so as to obtain the number of objects to be queried. In this way, no matter how large the change record is, the query result can be obtained merely by performing an accurate query in the second database twice, performing an interval query in the first database twice, and then performing a small amount of computation. In the whole query process, there is no need to analyze all the data, thereby having small amount of computation and small memory consumption, and greatly shortening the query time.

Description

对象管理方法、装置、计算机设备和存储介质Object management method, device, computer equipment and storage medium
本申请要求在2019年10月17日提交中国专利局、申请号为201910986607.4,发明名称为“对象管理方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office on October 17, 2019, the application number is 201910986607.4, and the invention title is "object management methods, devices, computer equipment and storage media", the entire contents of which are incorporated by reference In this application.
技术领域Technical field
本申请涉及数据处理技术领域,特别是涉及一种对象管理方法、装置、计算机设备和存储介质。This application relates to the field of data processing technology, in particular to an object management method, device, computer equipment and storage medium.
背景技术Background technique
视频图像信息数据库是视频解析的核心部分,负责提供数据的汇聚接入、数据处理、数据资源存储、数据服务、数据级联、数据开放能力、视图库软件应用等。The video image information database is the core part of video analysis, and is responsible for providing data aggregation access, data processing, data resource storage, data services, data cascading, data opening capabilities, and video library software applications.
视频图像信息数据库(以下简称视图库)视图库管理的对象至少包括但不限于视频片段对象、图像对象、文件对象、人员对象、人脸对象、机动车对象、非机动车对象、物品对象、场景对象、视频案事件对象、视频图像标签对象等11个类别。视图库在对所有对象进行管理时,包括入库(采集设备/采集平台上传图像数据到视图库的过程)、出库(从视图库上传到外部系统的过程)、删除、修改等操作。Video image information database (hereinafter referred to as the video library) The objects managed by the video library include at least but not limited to video clip objects, image objects, file objects, human objects, face objects, motor vehicle objects, non-motor vehicle objects, object objects, and scenes There are 11 categories of objects, video case event objects, and video image tag objects. When the video library manages all objects, it includes operations such as warehousing (the process of uploading image data from the collection device/collection platform to the video library), out of the library (the process of uploading the video library to the external system), deletion, and modification.
但是,现有技术从视图库中查询对象统计结果时存在耗时较长的问题。However, the prior art has the problem that it takes a long time to query the object statistical result from the view library.
发明内容Summary of the invention
基于此,有必要针对上述从视图库中查询对象统计结果时存在耗时较长的技术问题,提供一种对象管理方法、装置、计算机设备和存储介质。Based on this, it is necessary to provide an object management method, device, computer equipment, and storage medium in response to the above-mentioned technical problem of time-consuming when querying the object statistical results from the visual library.
第一方面,本申请实施例提供一种对象管理方法,该方法包括:In the first aspect, an embodiment of the present application provides an object management method, which includes:
接收对象的查询请求;查询请求表示请求查询待查询时间段内对象的累计变化数量、总变化数量、总数量中的至少一种,待查询时间段包括开始时刻和结束时刻;Receive a query request of the object; the query request means a request to query at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object in the time period to be queried, and the time period to be queried includes the start time and the end time;
在第一数据库中获取第一采样时刻与结束时刻之间的第一变化时刻对应的第一变化数量,和,第二采样时刻与开始时刻之间的第二变化时刻对应 的第二变化数量,根据第一变化数量获取第一采样时刻与结束时刻之间的第一累计变化数量,根据第二变化数量获取第二采样时刻与开始时刻之间的第二累计变化数量;第一数据库中包括对象的变化记录,对象的变化记录包括对象的数量发生变化的变化时刻和对应的变化数量;第一采样时刻为在结束时刻之前且与结束时刻间隔最近的采样时刻,第二采样时刻为在开始时刻之前且与结束时刻间隔最近的采样时刻;Acquire in the first database the first change quantity corresponding to the first change moment between the first sampling time and the end time, and the second change quantity corresponding to the second change time between the second sampling time and the start time, Obtain the first cumulative change quantity between the first sampling time and the end time according to the first change quantity, and obtain the second cumulative change quantity between the second sampling time and the start time according to the second change quantity; the first database includes objects The change record of the object, the change record of the object includes the change time when the number of objects changes and the corresponding change amount; the first sampling time is the sampling time before the end time and the closest interval to the end time, and the second sampling time is at the start time The sampling time before and closest to the end time;
在第二数据库中获取系统初始时刻至第一采样时刻的第三累计变化数量,以及获取系统初始时刻至第二采样时刻的第四累计变化数量;第二数据库包括对象的累计变化记录,累计变化记录包括对象从系统初始时刻至各采样时刻之间的累计变化数量;Obtain the third cumulative change quantity from the initial time of the system to the first sampling time in the second database, and obtain the fourth cumulative change quantity from the initial time of the system to the second sampling time; the second database includes the cumulative change records of the object, and the cumulative change The record includes the cumulative change number of the object from the initial time of the system to each sampling time;
根据第一累计变化数量、第二累计变化数量、第三累计变化数量和第四累计变化数量,得到待查询时间段内对象的累计变化数量、总变化数量、总数量中的至少一种。According to the first cumulative change quantity, the second cumulative change quantity, the third cumulative change quantity, and the fourth cumulative change quantity, at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object in the time period to be queried is obtained.
在其中一个实施例中,若待查询时间段的时长小于第一预设时长阈值,则从第一数据库获取从开始时刻至结束时刻之间的变化时刻对应的变化数量,根据变化数量确定累计变化数量、总变化数量、总数量中的至少一种。In one of the embodiments, if the duration of the time period to be queried is less than the first preset duration threshold, the number of changes corresponding to the change time from the start time to the end time is obtained from the first database, and the cumulative change is determined according to the number of changes At least one of quantity, total change quantity, and total quantity.
在其中一个实施例中,累计变化数量包括累计入库数量、累计出库数量、累计删除数量之一;变化记录和累计变化记录包括变化类型,变化类型包括入库、出库、删除中的至少一种。In one of the embodiments, the cumulative change quantity includes one of the cumulative storage quantity, the cumulative storage quantity, and the cumulative deletion quantity; the change record and the cumulative change record include the change type, and the change type includes at least one of storage, delivery, and deletion. One kind.
在其中一个实施例中,待查询时间段内对象的总变化数量表示待查询时间段内对象的累计入库数量减去累计出库数量;或者,待查询时间段内对象的总变化数量表示待查询时间段内对象的累计入库数量减去累计出库数量和累计删除数量;In one of the embodiments, the total number of changes in the object during the time period to be queried represents the cumulative number of objects in the inventory during the time period to be queried minus the cumulative number of outgoing objects; or, the total number of changes in the object during the time period to be queried represents Query the cumulative inbound quantity of objects within the query period minus the cumulative outbound quantity and the cumulative deleted quantity;
待查询时间段内对象的总数量表示系统初始时刻的对象数量加待查询时间段内对象的总变化数量中至少一种。The total number of objects in the time period to be queried represents at least one of the number of objects at the initial time of the system plus the total number of changes in the objects in the time period to be queried.
在其中一个实施例中,该方法还包括:In one of the embodiments, the method further includes:
获取对象的变化信息;变化信息包括入库信息、出库信息和删除信息中的至少一种;Obtain change information of the object; the change information includes at least one of inbound information, outbound information, and deletion information;
根据变化信息对第一数据库和第二数据库中进行更新。The first database and the second database are updated according to the change information.
在其中一个实施例中,上述根据变化信息对第一数据库进行更新,包括:In one of the embodiments, the above-mentioned updating the first database according to the change information includes:
满足预设条件时,将对应于变化信息的变化记录存储至第一数据库;预设条件包括距离上一次变化记录的存储时间达到第二预设时长阈值,或者, 预设条件包括第一变化信息的数量达到预设数量阈值,第一变化信息为对应于变化信息的变化记录未存储至第一数据库的变化信息。When the preset condition is met, the change record corresponding to the change information is stored in the first database; the preset condition includes that the storage time since the last change record reaches the second preset duration threshold, or the preset condition includes the first change information The number reaches the preset number threshold, and the first change information is change information corresponding to the change record that is not stored in the first database.
在其中一个实施例中,上述根据操作变化信息对第二数据库进行更新,包括:In one of the embodiments, the above-mentioned updating the second database according to the operation change information includes:
从第二数据库中获取系统初始时刻至第三采样时刻的第五累计变化数量,第三采样时刻为当前采样时刻的前一个采样时刻;Acquire the fifth cumulative change quantity from the initial time of the system to the third sampling time from the second database, where the third sampling time is the previous sampling time of the current sampling time;
从第一数据库中获取第三采样时刻至当前采样时刻之间的第三变化时刻对应的第三变化数量,根据第三变化数量获取第六累计变化数量;Obtain the third change quantity corresponding to the third change time between the third sampling time and the current sampling time from the first database, and obtain the sixth cumulative change quantity according to the third change quantity;
根据第五累计变化数量和第六累计变化数量,得到系统初始时刻至当前采样时刻的累计变化数量,将包含系统初始时刻至当前采样时刻的累计变化数量的累计变化记录存储至第二数据库。According to the fifth cumulative change quantity and the sixth cumulative change quantity, the cumulative change quantity from the initial time of the system to the current sampling time is obtained, and the cumulative change record containing the cumulative change quantity from the initial time of the system to the current sampling time is stored in the second database.
在其中一个实施例中,上述变化记录和累计变化记录中还包括对象的产生设备ID、对象的类别。In one of the embodiments, the above-mentioned change record and cumulative change record also include the object's generating device ID and the object category.
在其中一个实施例中,上述累计变化数量、总变化数量、总数量包括特定ID的产生设备中对象的累计变化数量、总变化数量、总数量;和/或,累计变化数量、总变化数量、总数量包括特定类别对象的累计变化数量、总变化数量、总数量。In one of the embodiments, the above-mentioned cumulative number of changes, total number of changes, and total number include the cumulative number of changes, total number of changes, and total number of objects in the specific ID generating device; and/or, the number of cumulative changes, total number of changes, The total quantity includes the cumulative change quantity, total change quantity, and total quantity of objects of a specific category.
第二方面,本申请实施例提供一种对象管理装置,装置包括:In a second aspect, an embodiment of the present application provides an object management device, the device includes:
接收模块,用于接收对象的查询请求;查询请求表示请求查询待查询时间段内对象的累计变化数量、总变化数量、总数量中的至少一种,待查询时间段包括开始时刻和结束时刻;The receiving module is used to receive the query request of the object; the query request indicates a request to query at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object in the time period to be queried, and the time period to be queried includes the start time and the end time;
第一获取模块,用于在第一数据库中获取第一采样时刻与结束时刻之间的第一变化时刻对应的第一变化数量,和,第二采样时刻与开始时刻之间的第二变化时刻对应的第二变化数量,根据第一变化数量获取第一采样时刻与结束时刻之间的第一累计变化数量,根据第二变化数量获取第二采样时刻与开始时刻之间的第二累计变化数量;第一数据库中包括对象的变化记录,对象的变化记录包括对象的数量发生变化的变化时刻和对应的变化数量;第一采样时刻为在结束时刻之前且与结束时刻间隔最近的采样时刻,第二采样时刻为在开始时刻之前且与结束时刻间隔最近的采样时刻;The first acquisition module is configured to acquire, in the first database, the first change quantity corresponding to the first change time between the first sampling time and the end time, and the second change time between the second sampling time and the start time The corresponding second change quantity, the first cumulative change quantity between the first sampling time and the end time is obtained according to the first change quantity, and the second cumulative change quantity between the second sampling time and the start time is obtained according to the second change quantity ; The first database includes the change record of the object, the change record of the object includes the change time at which the number of objects changes and the corresponding change number; the first sampling time is the sampling time before the end time and the closest interval to the end time, the first 2. The sampling time is the sampling time before the start time and closest to the end time;
第二获取模块,用于在第二数据库中获取系统初始时刻至第一采样时刻的第三累计变化数量,以及获取系统初始时刻至第二采样时刻的第四累计变化数量;第二数据库包括对象的累计变化记录,累计变化记录包括对象从系 统初始时刻至各采样时刻之间的累计变化数量;The second acquiring module is used to acquire the third cumulative change quantity from the initial time of the system to the first sampling time and the fourth cumulative change quantity from the initial time of the system to the second sampling time in the second database; the second database includes objects The cumulative change record of the, the cumulative change record includes the cumulative change number of the object from the initial time of the system to each sampling time;
确定模块,用于根据第一累计变化数量、第二累计变化数量、第三累计变化数量和第四累计变化数量,得到待查询时间段内对象的累计变化数量、总变化数量、总数量中的至少一种。The determination module is used to obtain the cumulative change number, total change number, and total number of the object in the time period to be queried according to the first cumulative change quantity, the second cumulative change quantity, the third cumulative change quantity, and the fourth cumulative change quantity. At least one.
第三方面,本申请实施例提供一种计算机设备,包括存储器和处理器,存储器存储有计算机程序,处理器执行计算机程序时实现上述第一方面实施例提供的任一项方法的步骤。In a third aspect, an embodiment of the present application provides a computer device, including a memory and a processor, the memory stores a computer program, and the processor implements the steps of any one of the methods provided in the embodiments of the first aspect when the processor executes the computer program.
第四方面,本申请实施例提供一种计算机可读存储介质,其上存储有计算机程序,计算机程序被处理器执行时实现上述第一方面实施例提供的任一项方法的步骤。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, the steps of any one of the methods provided in the embodiments of the first aspect are implemented.
本申请实施例提供的一种对象管理方法、装置、计算机设备和存储介质,当需要查询(t1,t2)时间段内对象的出库/入库/删除数量时,由于第一数据库中存储了对象的变化记录,对象的变化记录包括对象的数量发生变化的变化时刻和对应的变化数量,第二数据库中存储了对象的累计变化记录,累计变化记录包括对象从系统初始时刻至各采样时刻之间的累计变化数量,只需在第二数据库中查询t1之前且距离t1最近的采样时刻[t1]对应的累计变化记录以及t2之前且距离t2最近的采样时刻[t2]对应的累计变化记录,在第一数据库中查询(t1,[t1])和(t2,[t2])这两个小区间的变化记录,再通过少量计算即可得到所要查询的对象数量,这样,无论变化记录多么庞大,只需在第二数据库中进行2次精确查询、在第一数据库中进行2次小区间查询,再经少量运算即可获得查询结果,整个查询过程无需对全部数据进行分析,运算少,内存消耗较少,大大缩短了查询时间。The object management method, device, computer equipment, and storage medium provided by the embodiments of the present application, when it is necessary to query the outbound/inbound/deleted quantity of objects in the time period (t1, t2), because the first database stores The change record of the object, the change record of the object includes the change time of the change in the number of objects and the corresponding change amount. The cumulative change record of the object is stored in the second database. The cumulative change record includes the object from the initial time of the system to each sampling time. For the cumulative change amount between time, you only need to query the cumulative change record corresponding to the sampling time [t1] before t1 and the closest to t1 and the cumulative change record corresponding to the sampling time [t2] before t2 and the closest to t2 in the second database, Query the change records between the two communities (t1,[t1]) and (t2,[t2]) in the first database, and then calculate the number of objects to be queried through a small amount of calculation, so that no matter how large the change records are , You only need to perform two precise queries in the second database, two inter-cell queries in the first database, and then a small amount of calculations to obtain the query results. The entire query process does not need to analyze all the data, with less calculations and less memory. It consumes less and greatly shortens the query time.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to understand the technical means of the present invention more clearly, it can be implemented in accordance with the content of the specification, and in order to make the above and other objectives, features and advantages of the present invention more obvious and understandable. In the following, specific embodiments of the present invention will be cited.
附图说明Description of the drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the drawings in the following description These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work.
图1为一个实施例提供的一种对象管理方法的应用环境图;FIG. 1 is an application environment diagram of an object management method provided by an embodiment;
图2为一个实施例提供的一种对象管理方法的流程示意图;FIG. 2 is a schematic flowchart of an object management method provided by an embodiment;
图3为一个实施例提供的一种对象管理方法的流程示意图;FIG. 3 is a schematic flowchart of an object management method provided by an embodiment;
图4为一个实施例提供的一种对象管理方法的流程示意图;FIG. 4 is a schematic flowchart of an object management method provided by an embodiment;
图5为一个实施例提供的一种对象管理装置的结构框图;FIG. 5 is a structural block diagram of an object management device provided by an embodiment;
图6为一个实施例提供的一种对象管理装置的结构框图;FIG. 6 is a structural block diagram of an object management apparatus provided by an embodiment;
图7为一个实施例提供的一种对象管理装置的结构框图;FIG. 7 is a structural block diagram of an object management apparatus provided by an embodiment;
图8示意性地示出了用于执行根据本发明的方法的计算处理设备的框图;Fig. 8 schematically shows a block diagram of a computing processing device for executing the method according to the present invention;
图9示意性地示出了用于保持或者携带实现根据本发明的方法的程序代码的存储单元。Fig. 9 schematically shows a storage unit for holding or carrying program codes for implementing the method according to the present invention.
具体实施例Specific embodiment
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments These are a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。In order to make the purpose, technical solutions, and advantages of this application clearer, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present application, and are not used to limit the present application.
本申请提供的一种对象管理方法,可以应用于如图1所示的应用环境中,该应用环境中,计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统、计算机程序和数据库。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的数据库用于存储对象管理方法的数据。该计算机设备的网络接口用于与外部的其他设备通过网络连接通信。该计算机程序被处理器执行时以实现一种对象管理方法。The object management method provided by the present application can be applied to an application environment as shown in FIG. 1, in which a processor of a computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer equipment is used to store the data of the object management method. The network interface of the computer device is used to communicate with other external devices through a network connection. The computer program is executed by the processor to realize an object management method.
在实际应用中,对对象在时间域上进行统计计数是一个经常面对的问题。一般的,针对对象的操作,有增删改查四种,其中,对象增加的时候,对象统计值增加,对象删除的时候,对象统计值减少,对象修改的时候,对 象统计值不变。In practical applications, counting objects in the time domain is a frequently faced problem. Generally, there are four types of object operations, including addition, deletion, modification, and checking. When the object increases, the statistical value of the object increases, when the object is deleted, the statistical value of the object decreases, and when the object is modified, the statistical value of the object remains unchanged.
例如,公安视频图像信息库(简称视图库)管理的对象至少包括视频片段对象、图像对象、文件对象、人员对象、人脸对象、机动车对象、非机动车对象、物品对象、场景对象、视频案事件对象、视频图像标签对象等11个类别。其中,这些对象由采集设备/采集平台上传(称作入库)到视图库,由日志系统记录所上传的类别、出入库标记、个数、时间戳等信息;另外,这些对象也可被其他系统订阅,从视图库上传到外部(称作出库)系统,这时也会被日志系统记录出库对象的类别、出入库标记、个数、时间戳等信息。而且,被存储的对象还可以具有生命周期,即到期时将会被删除。假设每台采集设备按每天入库5000条记录计算,一个月可产生15万条的入库记录,一年便可产生180万的入库记录,此时若查询几天内的数据或许容易,倘若查询过去一年的入库总量,直接对这些记录做累计运算是相当消耗资源的,并且耗费的时间不可控。因此本申请实施例提供一种对象管理方法、装置、计算机设备和存储介质,旨在解决从视图库中查询对象统计结果时存在耗时较长的技术问题。For example, the objects managed by the public security video image information database (referred to as the video library) include at least video clip objects, image objects, file objects, personnel objects, face objects, motor vehicle objects, non-motor vehicle objects, object objects, scene objects, and videos. 11 categories such as case event objects and video image tag objects. Among them, these objects are uploaded by the collection equipment/collection platform (called warehousing) to the visual library, and the uploaded category, warehousing mark, number, time stamp and other information are recorded by the log system; in addition, these objects can also be used by other objects. System subscription, upload from the visual library to the external (called making library) system, at this time, the log system will also record the category, entry and exit tags, number, timestamp and other information of the objects out of the library. Moreover, the stored object can also have a life cycle, that is, it will be deleted when it expires. Assuming that each collection device is calculated based on 5000 records stored in the warehouse every day, 150,000 records in a month can be generated, and 1.8 million records in a year can be generated. At this time, it may be easy to query the data within a few days. If you query the total amount of storage in the past year, directly accumulating these records is quite resource-consuming, and the time consumed is uncontrollable. Therefore, the embodiments of the present application provide an object management method, device, computer equipment, and storage medium, which are intended to solve the technical problem of long time-consuming when querying object statistical results from the view library.
下面将通过实施例并结合附图具体地对本申请的技术方案以及本申请的技术方案如何解决上述技术问题进行详细说明。下面这几个具体的实施例可以相互结合,对于相同或相似的概念或过程可能在某些实施例中不再赘述。需要说明的是,本申请提供的一种对象管理方法,图2-图4的执行主体为计算机设备,其中,其执行主体还可以是对象管理装置,其中该装置可以通过软件、硬件或者软硬件结合的方式实现成为计算机设备的部分或者全部。Hereinafter, the technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems will be described in detail through the embodiments and the accompanying drawings. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. It should be noted that, in an object management method provided by this application, the execution subject of Figures 2 to 4 is a computer device, where the execution subject can also be an object management device, where the device can be implemented through software, hardware, or software and hardware. The combination is realized as part or all of the computer equipment.
为使本申请实施例的目的、技术方案和优点更加清楚,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments It is a part of the embodiments of the present application, but not all of the embodiments.
在一个实施例中,图2提供了一种对象管理方法,本实施例涉及的是计算机设备根据查询请求,在数据库中查询对象在待查询时间段内累计变化数量、总变化数量、总数量中的至少一种的具体过程,如图2所示,所述方法包括:In one embodiment, FIG. 2 provides an object management method. This embodiment relates to a computer device according to a query request to query the database for the cumulative number of changes, the total number of changes, and the total number of changes in the database during the time period to be queried. The specific process of at least one of, as shown in Figure 2, the method includes:
S101,接收对象的查询请求;查询请求表示请求查询待查询时间段内对 象的累计变化数量、总变化数量、总数量中的至少一种,待查询时间段包括开始时刻和结束时刻。S101: Receive a query request of an object; the query request indicates a request to query at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object in the time period to be queried. The time period to be queried includes the start time and the end time.
本实施例中,对象表示的是任一个需要管理的对象,这里的对象可以是待查询的对象,也可以是待更新的对象等。其中,查询请求表示需要对对象的累计变化数量、总变化数量或者总数量进行查询的请求。可选地,查询请求可以包含变化类型,设备ID和/或对象类别。变化的类型包括出库、入库或者删除,对应的,累计变化数量包括累计入库数量、累计出库数量或者累计删除数量。累计入库数量表示一个时间段内该对象入库数量之和,累计出库数量表示一个时间段内该对象出库数量之和,累计删除数量表示一个时间段内该对象删除数量之和。可选地,总变化数量表示待查询时间段内对象的累计入库数量减去累计出库数量;当对象包含生命周期时,到期的对象会被删除,总变化数量表示待查询时间段内对象的累计入库数量减去累计出库数量和累计删除数量。其中,总数量表示的是T时刻的总数量,即系统初始时刻的数量加上0-T时刻时间段内的总变化数量。需要说明的是,当查询请求所要查询的是待查询时间段的总数量时,仅需要给出结束时刻(T时刻),开始时刻默认为系统初始时刻。In this embodiment, the object represents any object that needs to be managed, and the object here may be an object to be queried or an object to be updated. Among them, the query request means a request for querying the cumulative change quantity, total change quantity, or total quantity of an object. Optionally, the query request may include the change type, device ID and/or object category. The types of changes include outbound, inbound, or deleted. Correspondingly, the cumulative amount of change includes the accumulated inbound quantity, the accumulated outbound quantity, or the accumulated deleted quantity. The accumulated storage quantity represents the sum of the object storage quantity in a time period, the accumulated storage quantity represents the sum of the object storage quantity in a time period, and the cumulative deletion quantity represents the sum of the object deletion quantity in a time period. Optionally, the total number of changes represents the cumulative number of objects in the inventory during the time period to be queried minus the cumulative number of objects out of the library; when the object contains a life cycle, the expired objects will be deleted, and the total number of changes represents the time period to be queried The accumulated inbound quantity of the object minus the accumulated outbound quantity and the accumulated deleted quantity. Among them, the total number represents the total number at time T, that is, the number at the initial time of the system plus the total number of changes in the time period 0-T. It should be noted that when the query request is to query the total number of time periods to be queried, only the end time (time T) needs to be given, and the start time defaults to the initial time of the system.
对象类别包括但不限于视频片段对象、图像对象、文件对象、人员对象、人脸对象、机动车对象、非机动车对象、物品对象、场景对象、视频案事件对象、视频图像标签对象等。一个查询请求例如可以是查询来自ID为X1的设备的人脸对象在10月1日14:00:00-10月2日15:00:00之间的入库数量。Object categories include, but are not limited to, video clip objects, image objects, file objects, human objects, face objects, motor vehicle objects, non-motor vehicle objects, article objects, scene objects, video case event objects, video image tag objects, etc. A query request may be, for example, to query the number of face objects from the device with ID X1 between 14:00 on October 1st and 15:00 on October 2nd.
其中计算机设备接收查询请求的方式可以是接收用户直接通过输入装置输入的请求,也可以是接收其他设备发送的请求,还可以是接收语音请求等,本实施例对接收查询请求的方式不做限定。需要说明的是,本申请提供的对象管理方法是运用在一种信息库中的方法,例如,公安视频图像信息数据库,以下简称视图库系统。The way for the computer equipment to receive the query request can be to receive the request directly input by the user through the input device, it can also be to receive the request sent by other devices, or it can be to receive the voice request, etc. This embodiment does not limit the way of receiving the query request. . It should be noted that the object management method provided in this application is a method used in an information database, for example, a public security video image information database, hereinafter referred to as a video library system.
S102,在第一数据库中获取第一采样时刻与结束时刻之间的第一变化时刻对应的第一变化数量,和,第二采样时刻与开始时刻之间的第二变化时刻对应的第二变化数量,根据第一变化数量获取第一采样时刻与结束时刻之间的第一累计变化数量,根据第二变化数量获取第二采样时刻与开始时刻之间 的第二累计变化数量;第一数据库中包括对象的变化记录,对象的变化记录包括对象的数量发生变化的变化时刻和对应的变化数量;第一采样时刻为在结束时刻之前且与结束时刻间隔最近的采样时刻,第二采样时刻为在开始时刻之前且与结束时刻间隔最近的采样时刻。S102. Acquire, in the first database, the first change quantity corresponding to the first change time between the first sampling time and the end time, and the second change corresponding to the second change time between the second sampling time and the start time. Quantity, obtain the first cumulative change quantity between the first sampling time and the end time according to the first change quantity, obtain the second cumulative change quantity between the second sampling time and the start time according to the second change quantity; in the first database Including the change record of the object, the change record of the object includes the change time when the number of objects changes and the corresponding change quantity; the first sampling time is the sampling time before the end time and the closest interval to the end time, and the second sampling time is at The sampling time before the start time and closest to the end time.
其中,采样时刻表示预先设定的计算累计变化数量的时刻,例如,可以是每天的23:59:59,即每一天的23:59:59时间记录一次对象的累计变化数量,例如,第一天的23:59:59记录自系统初始时刻到第一天的采样时刻之间对象的累计变化数量,在第2天的23:59:59记录一次系统初始时刻到第二天的采样时刻之间对象的累计变化数量,以此类推,在第n天的23:59:59,记录系统初始时刻到第n天的采样时刻之间对象的累计变化数量。Among them, the sampling time represents the preset time for calculating the cumulative change quantity, for example, it can be 23:59:59 every day, that is, the cumulative change quantity of the object is recorded once every day at 23:59:59, for example, the first At 23:59:59 of the day, the cumulative number of changes in the object from the initial time of the system to the sampling time of the first day is recorded. At 23:59:59 of the second day, the number of changes from the initial time of the system to the sampling time of the next day is recorded once. The accumulative number of changes in the object between the two, and so on. At 23:59:59 on the nth day, the cumulative number of changes in the object between the initial time of the system and the sampling time on the nth day is recorded.
采样时刻之间的间隔可以是固定的,也可以是非固定的,在此不做限定。固定间隔的采样时刻例如每天的23:59:59作为采样时刻,非固定的采样时刻例如当变化记录达到一定数量时即计算累计变化数量,将计算累计变化数量的时刻作为采样时刻。The interval between the sampling moments can be fixed or non-fixed, which is not limited here. The sampling time at a fixed interval, for example, 23:59:59 every day, is used as the sampling time, and the non-fixed sampling time, for example, when the change record reaches a certain number, the cumulative change amount is calculated, and the time when the cumulative change number is calculated is the sampling time.
其中,本步骤中第一数据库和下述第二数据库为预先在搜索服务器中建立的两个数据库,其中,搜索服务器表示全文搜索引擎,例如elasticSearch,本实施例对搜索服务器的类型不做限定,只要是可以快速地储存、搜索和分析海量数据的引擎即可。以elasticSearch中的索引为例,可以在elasticSearc中创建两个索引statics和days,分别对应两个数据库,则第一数据库为statics,第二数据库为days。Among them, the first database and the following second database in this step are two databases established in the search server in advance, where the search server means a full-text search engine, such as elasticSearch. This embodiment does not limit the type of search server. As long as it is an engine that can quickly store, search and analyze massive amounts of data. Taking the index in elasticSearch as an example, two indexes statics and days can be created in elasticSearc, corresponding to two databases, the first database is statics, and the second database is days.
第一数据库中包括对象的变化记录,对象的变化记录包括对象的数量发生变化的变化时刻和对应的变化数量。在一例中,第一数据库中的变化记录如表1所示。The first database includes the change record of the object, and the change record of the object includes the change time when the number of the object changes and the corresponding change amount. In one example, the change records in the first database are shown in Table 1.
表1Table 1
Figure PCTCN2020111425-appb-000001
Figure PCTCN2020111425-appb-000001
续举前例,查询来自ID为X1的设备的人脸对象在10月1日14:00:00-10月2日15:00:00之间的入库数量,采样时刻为每天的23:59:59时,开始时刻为10月1日14:00:00,结束时刻为10月2日下午15:00:00,第一采样时刻为10月1日23:59:59,第二采样时刻为9月30日23:59:59。第一采样时刻与结束时刻之间不存在变化记录,第二变化时刻为10月1日3:00和10月1日13:00。设备ID为X1,对象类别为人脸,变化类型为入库时,第二变化时刻对应的变化记录为以下两条,与第二变化时刻对应的变化数量为5,3,如下表2所示。To continue the previous example, query the number of face objects from the device with ID X1 between 14:00 on October 1st and 15:00 on October 2nd. The sampling time is 23:59 every day. :59 o’clock, start time is 14:00 on October 1st, end time is 15:00 pm on October 2nd, first sampling time is 23:59:59 on October 1st, second sampling time It is 23:59:59 on September 30. There is no change record between the first sampling time and the end time, and the second change time is 3:00 on October 1st and 13:00 on October 1st. When the device ID is X1, the object category is face, and the change type is warehousing, the change records corresponding to the second change moment are the following two, and the number of changes corresponding to the second change moment is 5 and 3, as shown in Table 2 below.
表2Table 2
Figure PCTCN2020111425-appb-000002
Figure PCTCN2020111425-appb-000002
对应地,第一累计变化数量为0,第二累计变化数量为8。Correspondingly, the first cumulative change quantity is 0, and the second cumulative change quantity is 8.
S103,在第二数据库中获取系统初始时刻至第一采样时刻的第三累计变化数量,以及获取系统初始时刻至第二采样时刻的第四累计变化数量;第二数据库包括对象的累计变化记录,累计变化记录包括对象从系统初始时刻至各采样时刻之间的累计变化数量。S103: Acquire the third cumulative change quantity from the initial time of the system to the first sampling time and the fourth cumulative change quantity from the initial time of the system to the second sampling time in the second database; the second database includes the cumulative change record of the object, The cumulative change record includes the cumulative change number of the object from the initial time of the system to each sampling time.
在一例中,第二数据库中的累计变化记录如表3所示。In one example, the cumulative change records in the second database are shown in Table 3.
表3table 3
Figure PCTCN2020111425-appb-000003
Figure PCTCN2020111425-appb-000003
续举前例,当查询请求为是查询来自ID为X1的设备的人脸对象在10月1日14:00:00-10月2日15:00:00之间的入库数量时,设备ID为X1,对象类别为人脸,变化类型为入库,第三累计变化数量为10,第四累 计变化数量为2。To continue the previous example, when the query request is to query the number of face objects from the device with ID X1 between 14:00 on October 1st and 15:00 on October 2nd, the device ID Is X1, the object category is human face, the change type is storage, the third cumulative change quantity is 10, and the fourth cumulative change quantity is 2.
S104,根据第一累计变化数量、第二累计变化数量、第三累计变化数量和第四累计变化数量,得到待查询时间段内对象的累计变化数量、总变化数量、总数量中的至少一种。S104, according to the first cumulative change quantity, the second cumulative change quantity, the third cumulative change quantity, and the fourth cumulative change quantity, obtain at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object in the time period to be queried .
续举前例,当查询请求为是查询来自ID为X1的设备的人脸对象在10月1日14:00:00-10月2日15:00:00之间的入库数量时,设备ID为X1,对象类别为人脸,变化类型为入库,用第三累计变化数量+第一累计变化数量-第四累计变化数量-第二累计变化数量(10+0-2-8)即可得到来自ID为X1的设备的人脸对象在10月1日14:00:00-10月2日15:00:00之间的入库数量为0。To continue the previous example, when the query request is to query the number of face objects from the device with ID X1 between 14:00 on October 1st and 15:00 on October 2nd, the device ID Is X1, the object category is face, and the change type is warehousing. It can be obtained by using the third cumulative change quantity + the first cumulative change quantity-the fourth cumulative change quantity-the second cumulative change quantity (10+0-2-8) The number of face objects from the device with ID X1 between 14:00 on October 1st and 15:00 on October 2 is zero.
示例地,以需要查询的是累计入库数量为例,计算机设备根据查询请求,查询待查询时间段内对象的累计入库数量时,可以从第二数据库中直接查询出待查询时间段结束时刻之前采样时刻记录的累计入库数量以及开始时刻之前采样时刻记录的累计入库数量,对于结束时刻之前采样时刻点到结束时刻、开始时刻之前采样时刻点到开始时刻的累计入库数量,可以根据第一数据库中的变化记录进行实时分析计算,整个过程相当于,将查询时间段(t1,t2)以采样时刻为节点划分为(0,[t1]),([t1],t1),(0,[t2]),([t2],t2)四个时间段,对于第二数据库中已经记录有累计变化数量的时间段(0,[t1]),(0,[t2]),从第二数据库中直接获取累计变化数量,对于累计变化数量没有记录的在第二数据库中的时间段([t1],t1),([t2],t2),则根据第一数据库存储的各对象的变化记录实时计算累计变化数量,最后进行合计即可。这样,在查询过程中,大部分时间段的累计变化数量无需实时计算,只需从第二数据库中精确进行查找,另外一小部分时间段在第一数据库中实时进行少量计算,可以实现快速计算,使得整个查询过程内存消耗较少,查询耗时短。For example, taking the cumulative storage quantity that needs to be queried as an example, when the computer device queries the cumulative storage quantity of objects in the time period to be queried according to the query request, it can directly query the end time of the time period to be queried from the second database The accumulated storage quantity recorded at the previous sampling time and the accumulated storage quantity recorded at the sampling time before the start time. The accumulated storage quantity from the sampling time point before the end time to the end time, and the sampling time point before the start time to the start time can be based on The change records in the first database are analyzed and calculated in real time. The whole process is equivalent to dividing the query time period (t1, t2) with the sampling time as the node as (0, [t1]), ([t1], t1), ( 0,[t2]),([t2],t2) four time periods, for the time period (0,[t1]),(0,[t2]) where the cumulative change number has been recorded in the second database, from The cumulative change quantity is directly obtained in the second database. For the time period ([t1],t1),([t2],t2) in the second database that the cumulative change quantity is not recorded, then according to the objects stored in the first database Calculate the cumulative change amount in real time for the change record, and finally make the total. In this way, in the query process, the cumulative change amount for most of the time periods does not need to be calculated in real time, only the precise search is performed from the second database, and a small amount of calculations are performed in real time in the first database for a small time period, which can realize fast calculation , Which makes the whole query process less memory consumption and shorter query time.
本实施例提供的对象管理方法,当需要查询(t1,t2)时间段内对象的出库/入库/删除数量时,由于第一数据库中存储了对象的变化记录,对象的变化记录包括对象的数量发生变化的变化时刻和对应的变化数量,第二数据库中存储了对象的累计变化记录,累计变化记录包括对象从系统初始时刻至各采样时刻之间的累计变化数量,只需在第二数据库中查询t1之前且距离t1最近 的采样时刻[t1]对应的累计变化记录以及t2之前且距离t2最近的采样时刻[t2]对应的累计变化记录,在第一数据库中查询(t1,[t1])和(t2,[t2])这两个小区间的变化记录,再通过少量计算即可得到所要查询的对象数量,这样,无论变化记录多么庞大,只需在第二数据库中进行2次精确查询、在第一数据库中进行2次小区间查询,再经少量运算即可获得查询结果,整个查询过程无需对全部数据进行分析,运算少,内存消耗较少,大大缩短了查询时间。In the object management method provided in this embodiment, when it is necessary to query the number of outbound/inbound/deleted objects in the time period (t1, t2), since the change record of the object is stored in the first database, the change record of the object includes the object The number of changes at the time of change and the corresponding number of changes. The second database stores the cumulative change record of the object. The cumulative change record includes the cumulative change number of the object from the initial time of the system to each sampling time. It only needs to be in the second Query the database for the cumulative change record corresponding to the sampling time [t1] before t1 and the closest to t1 and the cumulative change record corresponding to the sampling time [t2] before t2 and the closest to t2, query in the first database (t1,[t1 ]) and (t2,[t2]), the change records between the two cells, and then through a small amount of calculation, the number of objects to be queried can be obtained. In this way, no matter how large the change records are, it only needs to be performed twice in the second database. Precise query, two inter-community queries in the first database, and then a small amount of calculations to get the query results. The entire query process does not need to analyze all the data, with less calculations and less memory consumption, which greatly shortens the query time.
在一些场景中,若待查询时间段很短,则无需分两个数据库查询,直接在第一数据库中进行计算即可,则在一个实施例中,若待查询时间段的时长小于第一预设时长阈值,则从第一数据库获取从开始时刻至结束时刻之间的变化时刻对应的变化数量,根据变化数量确定累计变化数量、总变化数量、总数量中的至少一种。In some scenarios, if the time period to be queried is very short, there is no need to query in two databases, and the calculation can be performed directly in the first database. In one embodiment, if the time period to be queried is less than the first predetermined time period. If the duration threshold is set, the change quantity corresponding to the change time from the start time to the end time is obtained from the first database, and at least one of the cumulative change quantity, the total change quantity, and the total quantity is determined according to the change quantity.
具体地,计算机设备将待查询时间段的时长与第一预设时长阈值进行对比,若待查询时间段的时长小于第一预设时长阈值,则计算机设备从第一数据库获取从开始时刻至结束时刻之间的变化时刻对应的变化数量,根据变化数量确定累计变化数量、总变化数量、总数量中的至少一种。其中,第一预设时长阈值为预先设定的值,例如,可取24小时、48小时等,本实施例对此不做限定。这样,在待查询时间段较短时,直接通过第一数据库进行实时分析计算也不会消耗太多计算资源,因此无需执行去第二数据库中获取数据的步骤。Specifically, the computer device compares the duration of the time period to be queried with the first preset duration threshold, and if the duration of the time period to be queried is less than the first preset duration threshold, the computer device obtains from the first database from the start time to the end The amount of change corresponding to the changing moment between moments in time is determined according to the amount of change, at least one of the cumulative amount of change, the total amount of change, and the total amount. Wherein, the first preset duration threshold is a preset value, for example, it may be 24 hours, 48 hours, etc., which is not limited in this embodiment. In this way, when the time period to be queried is short, real-time analysis and calculation directly through the first database will not consume too much computing resources, so there is no need to perform the step of obtaining data from the second database.
在以上实施例的基础上,本申请实施例还提供了一种对象管理方法,其涉及的是计算机设备对第一数据库和第二数据库进行更新的具体过程,如图3所示,该方法还包括:On the basis of the above embodiment, the embodiment of the present application also provides an object management method, which relates to the specific process of updating the first database and the second database by a computer device. As shown in FIG. 3, the method also include:
S201,获取对象的变化信息;变化信息包括入库信息、出库信息和删除信息中的至少一种。S201: Obtain change information of the object; the change information includes at least one of inbound information, outbound information, and deletion information.
本实施例中,计算机设备获取对象的变化信息,其中该变化信息包括入库信息、出库信息和删除信息至少一种。其中计算机设备获取变化信息的方式可以是通过接收外接设备的输入信息确定,本实施例对此不做限定。In this embodiment, the computer device obtains the change information of the object, where the change information includes at least one of warehouse-in information, warehouse-out information, and deletion information. The manner in which the computer device obtains the change information may be determined by receiving the input information of the external device, which is not limited in this embodiment.
S202,根据变化信息对第一数据库和第二数据库中进行更新。S202: Update the first database and the second database according to the change information.
基于上述S201步骤中获取的变化信息,计算机设备根据该变化信息执 行不同的更新,例如,根据入库信息对对象进行入库记录更新,根据出库信息对对象进行增加出库记录更新,根据删除信息对对象进行删除记录更新。Based on the change information obtained in step S201 above, the computer device performs different updates according to the change information, for example, updates the inbound record of the object according to the inbound information, adds the outbound record to the object based on the outbound information, and updates according to the deletion. The information deletes the object and updates the record.
本实施例提供的对象管理方法,计算机设备根据对象的变化信息对第一数据库和第二数据库中的数据进行更新,可以保证第一数据库和第二数据库中数据的有效性、准确性和及时性,进一步地,保证了在该第一数据库和第二数据库中查询结果的准确性。In the object management method provided in this embodiment, the computer device updates the data in the first database and the second database according to the change information of the object, which can ensure the validity, accuracy and timeliness of the data in the first database and the second database Further, the accuracy of the query results in the first database and the second database is ensured.
下面对不同变化信息对应的更新过程进行说明,提供一种对第一数据库进行更新的过程,则在一个实施例中,满足预设条件时,将对应于变化信息的变化记录存储至第一数据库;预设条件包括距离上一次变化记录的存储时间达到第二预设时长阈值,或者,预设条件包括第一变化信息的数量达到预设数量阈值,其中,第一变化信息为对应于变化信息的变化记录未存储至第一数据库的变化信息。The following describes the update process corresponding to different change information, and provides a process for updating the first database. In one embodiment, when a preset condition is met, the change record corresponding to the change information is stored in the first database. Database; the preset condition includes the storage time since the last change record reaches the second preset duration threshold, or the preset condition includes the quantity of the first change information reaches the preset quantity threshold, where the first change information corresponds to the change The information change records the change information that is not stored in the first database.
具体地,计算机设备对第一数据库中变化记录进行更新时,以达到预设条件为准,即若当前时刻距离上一次变化记录的存储时间达到第二预设时长阈值时,计算机设备将当前时刻与上一次变化记录存储时刻之间的所有变化信息进行记录;或者,若第一变化信息的数量达到预设数量阈值时,其中,第一变化信息为对应于变化信息的变化记录未存储至第一数据库的变化信息,计算机设备将第一变化信息存储至第一数据库中。这样,在满足预设条件时,保证了数据的即时性。Specifically, when the computer device updates the change record in the first database, it is subject to the preset condition, that is, if the storage time from the last change record at the current time reaches the second preset duration threshold, the computer device will update the current time Record all the change information between the time when the last change record was stored; or, if the quantity of the first change information reaches the preset quantity threshold, where the first change information is that the change record corresponding to the change information has not been stored in the first A database of change information, the computer device stores the first change information in the first database. In this way, when the preset conditions are met, the immediacy of the data is guaranteed.
在另外一个实施例中,如图4所示,提供一种对第二数据库进行更新的过程,则该过程包括:In another embodiment, as shown in FIG. 4, a process of updating the second database is provided, and the process includes:
S301,从第二数据库中获取第三采样时刻的第五累计变化数量,第三采样时刻为当前采样时刻的前一个采样时刻。S301: Obtain a fifth cumulative change quantity at a third sampling time from the second database, where the third sampling time is a sampling time before the current sampling time.
计算机设备获取第二数据库中最后存储的累计变化数量,则第二数据库中最后存储的累计变化数量对应的采样时刻为第三采样时刻,即,第三采样时刻为当前采样时刻的前一个采样时刻。The computer device obtains the last accumulated change amount stored in the second database, and the sampling time corresponding to the last accumulated change amount stored in the second database is the third sampling time, that is, the third sampling time is the previous sampling time of the current sampling time .
S302,从第一数据库中获取第三采样时刻至当前采样时刻之间的第三变化时刻对应的第三变化数量,根据第三变化数量获取第六累计变化数量。S302: Acquire a third change quantity corresponding to a third change time between the third sampling time and the current sampling time from the first database, and obtain a sixth cumulative change quantity according to the third change quantity.
计算机设备从第一数据库中获取第三采样时刻到当前采样时刻之间的变化量,即第三变化数量,计算机根据该第三变化数量分析计算第六累计变化数量。可以理解的是,第六累计变化数量表示的是第三采样时刻到当前采样时刻的变化量。The computer device obtains the amount of change between the third sampling moment and the current sampling moment from the first database, that is, the third amount of change, and the computer analyzes and calculates the sixth cumulative amount of change according to the third amount of change. It can be understood that the sixth cumulative change quantity represents the change from the third sampling moment to the current sampling moment.
S303,根据第五累计变化数量和第六累计变化数量,得到当前采样时刻的累计变化数量,将包含当前采样时刻的累计变化数量的累计变化记录存储至第二数据库。S303: Obtain the cumulative change quantity at the current sampling time according to the fifth cumulative change quantity and the sixth cumulative change quantity, and store the cumulative change record including the cumulative change quantity at the current sampling time in the second database.
本步骤中,计算机设备将第五累计变化数量与第六累计变化数量的和确定为当前时刻的累计变化量,并将该当前采样时刻的累计变化数量的累计变化记录存储至第二数据库。In this step, the computer device determines the sum of the fifth cumulative change quantity and the sixth cumulative change quantity as the current cumulative change quantity, and stores the cumulative change record of the current sampling time cumulative change quantity in the second database.
续举前例,采样时刻为每天23:59:59,当前采样时刻为10月2日23:59:59,对第二数据库进行更新时,需要从第二数据库获取10月1日23:59:59的第五累计变化数量,再从第一数据库中获取10月2日0:0:0-10月2日23:59:59的变化数量,由所示变化数量得到10月2日0:0:0-10月2日23:59:59的第六累计变化数量,再由第五累计变化数量和第六累计变化数量得到系统初始时刻至当前采样时刻的累计变化数量。To continue the previous example, the sampling time is 23:59:59 every day, and the current sampling time is 23:59:59 on October 2nd. When updating the second database, you need to get 23:59 on October 1st from the second database: The fifth cumulative change quantity of 59 is obtained from the first database from October 2 0:0:0 to October 2 23:59:59, and October 2 0 is obtained from the displayed change quantity: The sixth cumulative change quantity from 0:0 to October 2nd at 23:59:59, and then the cumulative change quantity from the initial time of the system to the current sampling time is obtained from the fifth cumulative change quantity and the sixth cumulative change quantity.
需要说明的是,计算机设备在更新第一数据库和第二数据库时,均是根据不同的变化类型分别更新各类型对应的累计变化数量。本实施例中,通过对第一数据库和第二数据库中的数据进行更新,保证了第一数据库和第二数据中数据的准确性和及时性。It should be noted that when the computer device updates the first database and the second database, the cumulative change quantity corresponding to each type is updated according to different change types. In this embodiment, by updating the data in the first database and the second database, the accuracy and timeliness of the data in the first database and the second data are ensured.
在一个实施例中,变化记录和累计变化记录中还包括对象的产生设备ID、对象的类别;可选地,累计变化数量、总变化数量、总数量包括特定ID的产生设备中对象的累计变化数量、总变化数量、总数量;和/或,累计变化数量、总变化数量、总数量包括特定类型对象的累计变化数量、总变化数量、总数量。In one embodiment, the change record and the cumulative change record also include the object’s generating device ID and the object category; optionally, the cumulative change quantity, total change quantity, and total quantity include the cumulative change of the object in the generating device with a specific ID. Quantity, total change quantity, total quantity; and/or, cumulative change quantity, total change quantity, and total quantity include the cumulative change quantity, total change quantity, and total quantity of a specific type of object.
其中,对象的产生设备ID表示生成该对象的设备的ID,例如,若为人脸对象,则生成该图像的设备为采集该图像的采集设备的ID。这样在变化记录和累计变化记录中还包括对象的产生设备ID可以方便对对象来源进行区分。对象的类型包括人脸、人员等。对应地,在查询对象的数量时,可以 查询的是特定ID的产生设备中对象的累计变化数量、总变化数量、总数量,也可以查询的是特定类型对象的累计变化数量、总变化数量、总数量,还可以查询特定ID的产生设备、特定类型对象的累计变化数量、总变化数量、总数量,本实施例对此也不做限定。根据特定ID和特定类型对对象进行划分,可以适应用户不同的查询需求。Wherein, the object's generating device ID represents the ID of the device that generated the object. For example, if it is a face object, the device that generated the image is the ID of the collection device that captured the image. In this way, the change record and the cumulative change record also include the object's generating device ID to facilitate the identification of the source of the object. The types of objects include human faces, people, and so on. Correspondingly, when querying the number of objects, you can query the cumulative number of changes, the total number of changes, and the total number of objects in the device that generates the specific ID. You can also query the cumulative number of changes, the total number of changes, and the total number of changes for a specific type of object. The total quantity can also be queried for the specific ID generating device, the cumulative change quantity, total change quantity, and total quantity of a specific type of object, which is not limited in this embodiment. Dividing objects according to specific IDs and specific types can adapt to different query needs of users.
在一些场景中,对第一数据库和第二数据库中的数据进行更新过程中,如果某天视图库系统中没有出库、入库、删除信息等操作,那么当天采样时刻(例如23:59:59)的累计变化数量与前一天采样时刻的累计变化数量相同,这种情况下,在第二数据库中的累计变化数量可以不做记录,也可以直接采用前一天的累计数数量作为记录,本实施例对此不做限定。In some scenarios, during the process of updating the data in the first database and the second database, if there are no operations such as leaving, warehousing, or deleting information in the visual library system on a certain day, then the sampling time of the day (for example, 23:59: 59) The cumulative change quantity is the same as the cumulative change quantity at the sampling time of the previous day. In this case, the cumulative change quantity in the second database may not be recorded, or the cumulative change quantity of the previous day can be directly used as the record. The embodiment does not limit this.
基于上述所有实施例,本申请提供一种对数据从入库、更新到查询过程的完整实施例:Based on all the above embodiments, this application provides a complete embodiment of the process of data storage, update, and query:
对于视图库系统,假设其管理的对象有11类,对于该11类对象的个数统计可看作是针对一个具有11个统计维度的R 11空间里向量的操作,由于在实际应用中,这些对象总是来源于某个被唯一标识的采集设备/采集平台/外部系统(下文用X指代),因此采用设备的ID标识该向量,在写日志时候记下来,表示该条记录属于设备X。设定搜索服务器为elasticSearch,其第一数据库(本实施例以下称为第一索引)为statics,第二数据库(本实施例以下称为第二索引)为days; For the visual library system, suppose it manages 11 types of objects. The statistics of the 11 types of objects can be regarded as operations on a vector in an R 11 space with 11 statistical dimensions. In practical applications, these The object always originates from a uniquely identified collection device/collection platform/external system (referred to by X below), so the vector is identified by the device ID, and written down when writing the log, indicating that the record belongs to device X . Set the search server as elasticSearch, the first database (hereinafter referred to as the first index in this embodiment) is statics, and the second database (hereinafter referred to as the second index in this embodiment) is days;
以入库为例,f(t)表示设备X在t时刻的入库个数,在第一索引statics中存放t时刻该设备X的入库信息,采用函数f(t)表示入库个数,则该函数f(t)是具有多个维度的向量f(t)=[f 1(t),f 2(t),...,f n(t)],例如第一维度f 1(t)代表人脸个数,第二个维度f 2(t)代表机动车个数等。采用s(t)表示设备X从原图系统初始状态(0时刻)到t时刻的入库总量,其中,0时刻即视图库部署完成、刚启动的时刻,可以取UTC(世界统一时间)时间的起始时刻(1970-1-100:00:00),也可以取实际项目部署完成时间,本实施例对此不做限定。其 中
Figure PCTCN2020111425-appb-000004
Take warehousing as an example, f(t) represents the warehousing number of equipment X at time t, the warehousing information of the equipment X at time t is stored in the first index statics, and the function f(t) is used to represent the number of warehousing , Then the function f(t) is a vector with multiple dimensions f(t)=[f 1 (t), f 2 (t),..., f n (t)], for example, the first dimension f 1 (t) represents the number of faces, and the second dimension f 2 (t) represents the number of vehicles, etc. S(t) is used to represent the total amount of storage of equipment X from the initial state of the original image system (time 0) to time t, where time 0 is the moment when the view library is deployed and just started, which can be UTC (Uniform Universal Time) The start time (1970-1-100:00:00) of the time can also be the actual project deployment completion time, which is not limited in this embodiment. among them
Figure PCTCN2020111425-appb-000004
具体地,设定执行该方法的模块为log模块,则定期产生原始出入库记录存放在statics的过程包括:每当设备/平台向视图库系统上传上述11种对象时,会调用log模块在log模块内存中记录下来,log模块记录瞬时量f(t):采集瞬时入库、出库、删除信息,向statics写入记录。此处“瞬时”指的是短暂的一段时间区间,例如5s、10s、15s等,log模块会定期(例如10秒或log内存里的记录数达到某个阈值),把这段瞬时的入库信息汇总向statics写入记录。如果还有其他对象,则也需写入。Specifically, if the module that executes this method is set as the log module, the process of periodically generating original warehouse records and storing them in statics includes: whenever the device/platform uploads the above 11 types of objects to the visual library system, the log module is called in the log It is recorded in the module memory, and the log module records the instantaneous quantity f(t): collect instantaneous storage, storage, and deletion information, and write records to statics. Here "instantaneous" refers to a short period of time, such as 5s, 10s, 15s, etc., the log module will periodically (for example, 10 seconds or the number of records in the log memory reaches a certain threshold), and this instantaneous storage Information summary writes records to statics. If there are other objects, they also need to be written.
另一方面,每天有对象出库,或者对象到期被删除时,log模块也会定期向statics写入记录。如下表4所示为第一数据库中的变化记录,表示1561368429-1561368439这10s内,设备X1入库人脸5个(在此,一条变化记录中的变化时刻记为短暂的一段时间区间中的最后一个时间点),出库人员3个;1561368439-1561368449这10s内,设备X1删除人脸1个,X2删除场景1个。On the other hand, when an object is out of the library every day, or the object is deleted when it expires, the log module will also periodically write records to statics. The following table 4 shows the change records in the first database, which means that within 10s of 1561368429-1561368439, there are 5 faces of device X1 entering the library (here, the change time in a change record is recorded as the time in a short period of time. At the last point in time), there are 3 people leaving the library; within 10s of 1561368439-1561368449, device X1 deletes 1 face and X2 deletes 1 scene.
表4Table 4
序号Serial number 设备IDDevice ID 对象类型Object type 变化类型Variation type 变化时刻Moment of change 变化数量Number of changes
11 X1X1 人脸human face “入库”"Warehousing" 15613684391561368439 55
22 X1X1 人员personnel “出库”"Out of the library" 15613684391561368439 33
33 X1X1 人脸human face “删除”"delete" 15613684491561368449 11
44 X2X2 场景Scenes “删除”"delete" 15613684491561368449 11
其中,定期对原始出入库记录进行分析得到第二数据库中的累计变化记录的过程包括:statistics模块负责记录累计变化数量s(t):计算两个采样点t i、t i+1,之间产生的累计入库数量、累计出库数量或累计删除数量,以累计入库数量为例,为增量
Figure PCTCN2020111425-appb-000005
其中,t i和t i+1之间的间隔,可以是每隔固定的时间,例如每天23:59:59,也可以是非固定的时间。
Among them, the process of periodically analyzing the original inbound and outbound records to obtain the cumulative change records in the second database includes: the statistics module is responsible for recording the cumulative change number s(t): calculating the two sampling points t i , t i+1 , Cumulative warehousing quantity, cumulative warehousing quantity, or cumulative deletion quantity generated, taking the cumulative warehousing quantity as an example, as an increment
Figure PCTCN2020111425-appb-000005
Wherein, the interval between ti and ti +1 may be every fixed time, for example, 23:59:59 every day, or it may be an irregular time.
例如每天23:59:59,对从当天00:00:00到23:59:59的所有原始出入库记录按设备ID分组,然后对各个分组的11类对象进行统计,按照变 化类型得到各个变化类型的累计变化数量。对于上述表4的数据,处理得到:X1入库=[0,0,0,0,5,0,0,0,0,0,0],第5个维度表示人脸个数,X1出库=[0,0,0,3,0,0,0,0,0,0,0],第4个维度表示人员个数,X1删除=[0,0,0,0,1,0,0,0,0,0,0],第5个维度表示人脸个数。X2删除=[0,0,0,0,0,0,0,0,1,0,0],第9个维度表示场景个数。向量的每一维度代表一种类别的对象的个数的统计值。For example, every day at 23:59:59, group all the original warehousing records from 00:00:00 to 23:59:59 that day by device ID, and then perform statistics on the 11 types of objects in each group, and get each change according to the type of change The cumulative number of changes for the type. For the data in Table 4 above, the processing results: X1 inbound = [0,0,0,0,5,0,0,0,0,0,0], the fifth dimension represents the number of faces, and X1 out Library=[0,0,0,3,0,0,0,0,0,0,0], the fourth dimension represents the number of personnel, X1 delete=[0,0,0,0,1,0 ,0,0,0,0,0], the fifth dimension represents the number of faces. X2 delete=[0,0,0,0,0,0,0,0,1,0,0], the 9th dimension represents the number of scenes. Each dimension of the vector represents the statistical value of the number of objects in a category.
其中,对于更新累计值表days的过程包括:Among them, the process of updating the accumulated value table days includes:
statistics模块还负责将截止t i时刻的累计变化数量S(t i)加上增量S inc写入days,即把
Figure PCTCN2020111425-appb-000006
的结果写入days,对每个设备X,分别写入一条入库、出库、删除的累计变化数量。以入库为例,写入方法为:查询X上一次写入的累计入库数量(匹配设备ID和变化类型,取时间最大的那条记录),记为S old=S(t i),将该条记录和之前计算所得的X的累计入库数量S inc相加:S new=S(t i+1)=S old+S inc,把相加结果S new写入第二数据库的累计变化记录,其中S new对应的采样时刻为当天23:59:59,当然,如果该设备X当天没有产生入库/出库/删除的记录,则可将前一天的累计变化数量作为当天的累计变化数量,或不在第二数据库中存储当天的累计变化记录。
The statistics module is also responsible for writing the cumulative change amount S(t i ) at the end of t i plus the increment S inc into days, that is,
Figure PCTCN2020111425-appb-000006
The result of is written into days, and for each device X, a cumulative change quantity of inbound, outbound, and deleted is written separately. Take warehousing as an example, the writing method is: query the cumulative warehousing quantity written last time by X (match the device ID and change type, take the record with the longest time), record it as S old =S(t i ), Add this record to the previously calculated cumulative storage quantity S inc of X: S new =S(t i+1 )=S old +S inc , and write the addition result S new to the accumulation of the second database Change record, the sampling time corresponding to S new is 23:59:59 of the current day. Of course, if the device X does not have a record of inbound/outbound/deleted on that day, the cumulative change quantity of the previous day can be used as the cumulative amount of the day The number of changes, or the cumulative change records of the day are not stored in the second database.
其中,快速查询方法的过程包括:以查询设备X在时间段[a,b]产生的累计入库数量为例。累计入库数量
Figure PCTCN2020111425-appb-000007
Among them, the process of the quick query method includes: taking the cumulative storage quantity generated by the query device X in the time period [a, b] as an example. Cumulative warehousing quantity
Figure PCTCN2020111425-appb-000007
(i)从第二数据库days分别查询[a],[b]时刻的累计入库数量S [a]和S [b]。对于获取[a]时刻的累计入库数量S [a],查询条件是匹配设备ID和变化类型为 “入库”,取采样时刻时间小于等于a且最接近的累计变化记录对应的累计变化数量;对于获取[b]时刻的累计变化数量也是同理。如果没有结果,则表示自系统初始时刻时刻起,还没有入库记录。 (i) Query the cumulative storage quantity S [a] and S [b] at the time [a], [b] from the second database days respectively. For obtaining the cumulative storage quantity S [a] at time [a] , the query condition is to match the device ID and the change type as "warehousing", and take the cumulative change quantity corresponding to the closest cumulative change record with the sampling time less than or equal to a ; The same is true for obtaining the cumulative change amount at time [b]. If there is no result, it means that since the initial time of the system, there has not been a storage record.
(ii)从第一数据库中查询设备X在小区间的时间段[[a],a]和[[b],b]产生的入库数量,即从statics匹配设备ID和变化类型为“入库”以及时间区域进行查询,对查询结果进行汇总,得到[[a],a]和[[b],b]两个时间区间的累计变化数量
Figure PCTCN2020111425-appb-000008
Figure PCTCN2020111425-appb-000009
(ii) From the first database, query the number of warehouse receipts generated by the time period [[a],a] and [[b],b] of the device X in the cell, that is, match the device ID from statics and change the type to "inbound Query database" and time zone, summarize the query results, and get the cumulative change of the two time intervals [[a],a] and [[b],b]
Figure PCTCN2020111425-appb-000008
with
Figure PCTCN2020111425-appb-000009
将上述(i)(ii)两部分结果根据公式
Figure PCTCN2020111425-appb-000010
运算即可得到最终结果。可以理解的是,步骤(ii)可以在步骤(i)之前进行,步骤(i)(ii)的顺序不做限定。
Combining the above two parts (i) and (ii) results according to the formula
Figure PCTCN2020111425-appb-000010
The operation can get the final result. It can be understood that step (ii) can be performed before step (i), and the order of steps (i) and (ii) is not limited.
一般的,[a,b]跨度在3天以上时,采用上述查询方法,否则如果[a,b]时间段很短,则直接查询statics,对结果进行累计即可。对于出库、删除信息的查询也是同理,在此不再赘述。Generally, when the span of [a,b] is more than 3 days, the above query method is used. Otherwise, if the time period of [a,b] is very short, query statics directly and accumulate the results. The same is true for the query of outbound and deleted information, so I won't repeat it here.
根据本实施例提供的完成管理过程可知,对于查询指定设备X在任意时间区间[a,b]所产生的出库/入库/删除总量,无论记录条数多么庞大,只需要从days进行历史累计变化数量精确查询,从statics进行小时间区间(一天以内)变化数量查询,最后进行累加即可完成,大大的提高了查询效率。According to the completion management process provided by this embodiment, it can be seen that for querying the total amount of outbound/inbound/deleted generated by the specified device X in any time interval [a,b], no matter how large the number of records is, it only needs to be performed from days Accurate query of the historical cumulative change quantity, query the change quantity in a small time interval (within one day) from statics, and finally complete the accumulation, which greatly improves the query efficiency.
应该理解的是,虽然图2-4的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,图2-4中的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。It should be understood that although the various steps in the flowcharts of FIGS. 2-4 are displayed in sequence as indicated by the arrows, these steps are not necessarily performed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, there is no strict order for the execution of these steps, and these steps can be executed in other orders. Moreover, at least part of the steps in Figures 2-4 may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. These sub-steps or stages The execution order of is not necessarily performed sequentially, but may be performed alternately or alternately with at least a part of other steps or sub-steps or stages of other steps.
在一个实施例中,如图5所示,提供了一种对象管理装置,该装置包括: 接收模块10、第一获取模块11、第二获取模块12和确定模块13,其中,In one embodiment, as shown in FIG. 5, an object management device is provided, which includes: a receiving module 10, a first acquiring module 11, a second acquiring module 12, and a determining module 13, wherein:
接收模块10,用于接收对象的查询请求;查询请求表示请求查询待查询时间段内对象的累计变化数量、总变化数量、总数量中的至少一种,待查询时间段包括开始时刻和结束时刻;The receiving module 10 is used to receive the query request of the object; the query request means to request at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object in the time period to be queried. The time period to be queried includes the start time and the end time ;
第一获取模块11,用于在第一数据库中获取第一采样时刻与结束时刻之间的第一变化时刻对应的第一变化数量,和,第二采样时刻与开始时刻之间的第二变化时刻对应的第二变化数量,根据第一变化数量获取第一采样时刻与结束时刻之间的第一累计变化数量,根据第二变化数量获取第二采样时刻与开始时刻之间的第二累计变化数量;第一数据库中包括对象的变化记录,对象的变化记录包括对象的数量发生变化的变化时刻和对应的变化数量;第一采样时刻为在结束时刻之前且与结束时刻间隔最近的采样时刻,第二采样时刻为在开始时刻之前且与结束时刻间隔最近的采样时刻;The first acquisition module 11 is configured to acquire, in the first database, the first change quantity corresponding to the first change time between the first sampling time and the end time, and the second change between the second sampling time and the start time The second change quantity corresponding to the time, the first cumulative change quantity between the first sampling time and the end time is obtained according to the first change quantity, and the second cumulative change between the second sampling time and the start time is obtained according to the second change quantity Quantity; the first database includes the change record of the object, the change record of the object includes the change time when the number of the object changes and the corresponding change quantity; the first sampling time is the sampling time before the end time and the closest interval to the end time, The second sampling time is the sampling time before the start time and closest to the end time;
第二获取模块12,用于在第二数据库中获取系统初始时刻至第一采样时刻的第三累计变化数量,以及获取系统初始时刻至第二采样时刻的第四累计变化数量;第二数据库包括对象的累计变化记录,累计变化记录包括对象从系统初始时刻至各采样时刻之间的累计变化数量;The second acquiring module 12 is configured to acquire the third cumulative change quantity from the initial time of the system to the first sampling time and the fourth cumulative change quantity from the initial time of the system to the second sampling time in the second database; the second database includes The cumulative change record of the object, which includes the cumulative change amount of the object from the initial time of the system to each sampling time;
确定模块13,用于根据第一累计变化数量、第二累计变化数量、第三累计变化数量和第四累计变化数量,得到待查询时间段内对象的累计变化数量、总变化数量、总数量中的至少一种。The determination module 13 is used to obtain the cumulative change number, total change number, and total number of objects in the time period to be queried according to the first cumulative change quantity, the second cumulative change quantity, the third cumulative change quantity, and the fourth cumulative change quantity. At least one of.
上述实施例提供的一种对象管理装置,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。The object management device provided in the foregoing embodiment has an implementation principle and technical effect similar to the foregoing method embodiment, and will not be repeated here.
在一个实施例中,若待查询时间段的时长小于第一预设时长阈值,则从第一数据库获取从开始时刻至结束时刻之间的变化时刻对应的变化数量,根据变化数量确定累计变化数量、总变化数量、总数量中的至少一种。In one embodiment, if the duration of the time period to be queried is less than the first preset duration threshold, the change quantity corresponding to the change time from the start time to the end time is obtained from the first database, and the cumulative change quantity is determined according to the change quantity , At least one of the total number of changes and the total number.
上述实施例提供的一种对象管理装置,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。The object management device provided in the foregoing embodiment has an implementation principle and technical effect similar to the foregoing method embodiment, and will not be repeated here.
在一个实施例中,累计变化数量包括累计入库数量、累计出库数量、累计删除数量之一;变化记录和累计变化记录包括变化类型,变化类型包括入库、出库、删除中的至少一种。In one embodiment, the cumulative change quantity includes one of the cumulative warehousing quantity, the cumulative exit quantity, and the cumulative deletion quantity; the change record and the cumulative change record include a change type, and the change type includes at least one of warehousing, outgoing, and deletion. Kind.
上述实施例提供的一种对象管理装置,其实现原理和技术效果与上述方 法实施例类似,在此不再赘述。The implementation principle and technical effect of an object management device provided by the foregoing embodiment are similar to those of the foregoing method embodiment, and will not be repeated here.
在一个实施例中,待查询时间段内对象的总变化数量表示待查询时间段内对象的累计入库数量减去累计出库数量;或者,待查询时间段内对象的总变化数量表示待查询时间段内对象的累计入库数量减去累计出库数量和累计删除数量;In one embodiment, the total number of changes of objects in the time period to be queried represents the cumulative number of objects in the inventory during the time period to be queried minus the cumulative number of outgoing objects; or, the total number of changes in the objects during the time period to be queried represents the number of objects to be queried The accumulated inbound quantity of the object within the time period minus the accumulated outbound quantity and the accumulated deleted quantity;
待查询时间段内对象的总数量表示系统初始时刻的对象数量加待查询时间段内对象的总变化数量。The total number of objects in the time period to be queried represents the number of objects at the initial time of the system plus the total number of changes in the objects in the time period to be queried.
上述实施例提供的一种对象管理装置,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。The object management device provided in the foregoing embodiment has an implementation principle and technical effect similar to the foregoing method embodiment, and will not be repeated here.
在一个实施例中,如图6所示,提供了一种对象管理装置,该装置还包括:获取模块14和更新模块15,其中,In an embodiment, as shown in FIG. 6, an object management apparatus is provided, the apparatus further includes: an acquisition module 14 and an update module 15, wherein,
获取模块14,用于获取对象的变化信息;变化信息包括入库信息、出库信息和删除信息中的至少一种;The obtaining module 14 is used to obtain change information of the object; the change information includes at least one of inbound information, outbound information, and deletion information;
更新模块15,用于根据变化信息对第一数据库和第二数据库中进行更新。The update module 15 is used to update the first database and the second database according to the change information.
上述实施例提供的一种对象管理装置,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。The object management device provided in the foregoing embodiment has an implementation principle and technical effect similar to the foregoing method embodiment, and will not be repeated here.
在一个实施例中,上述更新模块15用于满足预设条件时,将对应于变化信息的变化记录存储至第一数据库;预设条件包括距离上一次变化记录的存储时间达到第二预设时长阈值,或者,预设条件包括第一变化信息的数量达到预设数量阈值,第一变化信息为对应于变化信息的变化记录未存储至第一数据库的变化信息。In one embodiment, the above-mentioned update module 15 is used to store the change record corresponding to the change information in the first database when the preset condition is met; the preset condition includes the storage time since the last change record reaches the second preset duration The threshold value, or the preset condition includes that the quantity of the first change information reaches the preset quantity threshold value, and the first change information is change information corresponding to the change information that is not stored in the first database.
上述实施例提供的一种对象管理装置,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。The object management device provided in the foregoing embodiment has an implementation principle and technical effect similar to the foregoing method embodiment, and will not be repeated here.
在一个实施例中,如图7所示,提供了一种对象管理装置,上述更新模块15包括:第一获取单元151、第二获取单元152和存储单元153,其中,In one embodiment, as shown in FIG. 7, an object management apparatus is provided, and the above-mentioned update module 15 includes: a first obtaining unit 151, a second obtaining unit 152, and a storage unit 153, wherein:
第一获取单元151,用于从第二数据库中获取系统初始时刻至第三采样时刻的第五累计变化数量,第三采样时刻为当前采样时刻的前一个采样时刻;The first acquiring unit 151 is configured to acquire the fifth cumulative change quantity from the initial time of the system to the third sampling time from the second database, and the third sampling time is the previous sampling time of the current sampling time;
第二获取单元152,用于从第一数据库中获取第三采样时刻至当前采样 时刻之间的第三变化时刻对应的第三变化数量,根据第三变化数量获取第六累计变化数量;The second acquiring unit 152 is configured to acquire the third change quantity corresponding to the third change time between the third sampling time and the current sampling time from the first database, and obtain the sixth cumulative change quantity according to the third change quantity;
存储单元153,用于根据第五累计变化数量和第六累计变化数量,得到系统初始时刻至当前采样时刻的累计变化数量,将包含系统初始时刻至当前采样时刻的累计变化数量的累计变化记录存储至第二数据库。The storage unit 153 is configured to obtain the cumulative change quantity from the initial time of the system to the current sampling time according to the fifth cumulative change quantity and the sixth cumulative change quantity, and store the cumulative change record containing the cumulative change quantity from the system initial time to the current sampling time To the second database.
上述实施例提供的一种对象管理装置,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。The object management device provided in the foregoing embodiment has an implementation principle and technical effect similar to the foregoing method embodiment, and will not be repeated here.
在一个实施例中,上述变化记录和累计变化记录中还包括对象的产生设备ID、对象的类别。In an embodiment, the above-mentioned change record and cumulative change record further include the object's generating device ID and the object category.
上述实施例提供的一种对象管理装置,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。The object management device provided in the foregoing embodiment has an implementation principle and technical effect similar to the foregoing method embodiment, and will not be repeated here.
在一个实施例中,上述累计变化数量、总变化数量、总数量包括特定ID的产生设备中对象的累计变化数量、总变化数量、总数量;和/或,累计变化数量、总变化数量、总数量包括特定类别对象的累计变化数量、总变化数量、总数量。In one embodiment, the above-mentioned cumulative change number, total change number, and total number include the cumulative change number, total change number, and total number of objects in the specific ID generating device; and/or, the cumulative change number, total change number, and total The quantity includes the cumulative change quantity, the total change quantity, and the total quantity of a specific category of objects.
上述实施例提供的一种对象管理装置,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。The object management device provided in the foregoing embodiment has an implementation principle and technical effect similar to the foregoing method embodiment, and will not be repeated here.
关于对象管理装置的具体限定可以参见上文中对于对象管理方法的限定,在此不再赘述。上述对象管理装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。For the specific limitation of the object management device, please refer to the above limitation of the object management method, which will not be repeated here. Each module in the above-mentioned object management device can be implemented in whole or in part by software, hardware, and a combination thereof. The above-mentioned modules may be embedded in the form of hardware or independent of the processor in the computer equipment, or may be stored in the memory of the computer equipment in the form of software, so that the processor can call and execute the operations corresponding to the above-mentioned modules.
在一个实施例中,提供了一种计算机设备,该计算机设备可以是终端,其内部结构图可以如图1所示。该计算机设备包括通过系统总线连接的处理器、存储器、网络接口、显示屏和输入装置。其中,该计算机设备的处理器用于提供计算和控制能力。该计算机设备的存储器包括非易失性存储介质、内存储器。该非易失性存储介质存储有操作系统和计算机程序。该内存储器为非易失性存储介质中的操作系统和计算机程序的运行提供环境。该计算机设备的网络接口用于与外部的终端通过网络连接通信。该计算机程序被处理器执行时以实现一种对象管理方法。该计算机设备的显示屏可以是液晶显示 屏或者电子墨水显示屏,该计算机设备的输入装置可以是显示屏上覆盖的触摸层,也可以是计算机设备外壳上设置的按键、轨迹球或触控板,还可以是外接的键盘、触控板或鼠标等。In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as shown in FIG. 1. The computer equipment includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide calculation and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. The computer program is executed by the processor to realize an object management method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, or it can be a button, a trackball or a touchpad set on the housing of the computer equipment , It can also be an external keyboard, touchpad, or mouse.
本领域技术人员可以理解,上述图1中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。Those skilled in the art can understand that the structure shown in FIG. 1 is only a block diagram of part of the structure related to the solution of the present application, and does not constitute a limitation on the computer equipment to which the solution of the present application is applied. The specific computer equipment It may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
在一个实施例中,提供了一种计算机设备,包括存储器和处理器,存储器中存储有计算机程序,该处理器执行计算机程序时实现以下步骤:In one embodiment, a computer device is provided, including a memory and a processor, and a computer program is stored in the memory, and the processor implements the following steps when the processor executes the computer program:
接收对象的查询请求;查询请求表示请求查询待查询时间段内对象的累计变化数量、总变化数量、总数量中的至少一种,待查询时间段包括开始时刻和结束时刻;Receive a query request of the object; the query request means a request to query at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object in the time period to be queried, and the time period to be queried includes the start time and the end time;
在第一数据库中获取第一采样时刻与结束时刻之间的第一变化时刻对应的第一变化数量,和,第二采样时刻与开始时刻之间的第二变化时刻对应的第二变化数量,根据第一变化数量获取第一采样时刻与结束时刻之间的第一累计变化数量,根据第二变化数量获取第二采样时刻与开始时刻之间的第二累计变化数量;第一数据库中包括对象的变化记录,对象的变化记录包括对象的数量发生变化的变化时刻和对应的变化数量;第一采样时刻为在结束时刻之前且与结束时刻间隔最近的采样时刻,第二采样时刻为在开始时刻之前且与结束时刻间隔最近的采样时刻;Acquire in the first database the first change quantity corresponding to the first change moment between the first sampling time and the end time, and the second change quantity corresponding to the second change time between the second sampling time and the start time, Obtain the first cumulative change quantity between the first sampling time and the end time according to the first change quantity, and obtain the second cumulative change quantity between the second sampling time and the start time according to the second change quantity; the first database includes objects The change record of the object, the change record of the object includes the change time when the number of objects changes and the corresponding change amount; the first sampling time is the sampling time before the end time and the closest interval to the end time, and the second sampling time is at the start time The sampling time before and closest to the end time;
在第二数据库中获取系统初始时刻至第一采样时刻的第三累计变化数量,以及获取系统初始时刻至第二采样时刻的第四累计变化数量;第二数据库包括对象的累计变化记录,累计变化记录包括对象从系统初始时刻至各采样时刻之间的累计变化数量;Obtain the third cumulative change quantity from the initial time of the system to the first sampling time in the second database, and obtain the fourth cumulative change quantity from the initial time of the system to the second sampling time; the second database includes the cumulative change records of the object, and the cumulative change The record includes the cumulative change number of the object from the initial time of the system to each sampling time;
根据第一累计变化数量、第二累计变化数量、第三累计变化数量和第四累计变化数量,得到待查询时间段内对象的累计变化数量、总变化数量、总数量中的至少一种。According to the first cumulative change quantity, the second cumulative change quantity, the third cumulative change quantity, and the fourth cumulative change quantity, at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object in the time period to be queried is obtained.
上述实施例提供的一种计算机设备,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。The implementation principle and technical effect of a computer device provided by the foregoing embodiment are similar to those of the foregoing method embodiment, and will not be repeated here.
在一个实施例中,提供了一种计算机可读存储介质,其上存储有计算机 程序,计算机程序被处理器执行时实现以下步骤:In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
接收对象的查询请求;查询请求表示请求查询待查询时间段内对象的累计变化数量、总变化数量、总数量中的至少一种,待查询时间段包括开始时刻和结束时刻;Receive a query request of the object; the query request means a request to query at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object in the time period to be queried, and the time period to be queried includes the start time and the end time;
在第一数据库中获取第一采样时刻与结束时刻之间的第一变化时刻对应的第一变化数量,和,第二采样时刻与开始时刻之间的第二变化时刻对应的第二变化数量,根据第一变化数量获取第一采样时刻与结束时刻之间的第一累计变化数量,根据第二变化数量获取第二采样时刻与开始时刻之间的第二累计变化数量;第一数据库中包括对象的变化记录,对象的变化记录包括对象的数量发生变化的变化时刻和对应的变化数量;第一采样时刻为在结束时刻之前且与结束时刻间隔最近的采样时刻,第二采样时刻为在开始时刻之前且与结束时刻间隔最近的采样时刻;Acquire in the first database the first change quantity corresponding to the first change moment between the first sampling time and the end time, and the second change quantity corresponding to the second change time between the second sampling time and the start time, Obtain the first cumulative change quantity between the first sampling time and the end time according to the first change quantity, and obtain the second cumulative change quantity between the second sampling time and the start time according to the second change quantity; the first database includes objects The change record of the object, the change record of the object includes the change time when the number of objects changes and the corresponding change amount; the first sampling time is the sampling time before the end time and the closest interval to the end time, and the second sampling time is at the start time The sampling time before and closest to the end time;
在第二数据库中获取系统初始时刻至第一采样时刻的第三累计变化数量,以及获取系统初始时刻至第二采样时刻的第四累计变化数量;第二数据库包括对象的累计变化记录,累计变化记录包括对象从系统初始时刻至各采样时刻之间的累计变化数量;Obtain the third cumulative change quantity from the initial time of the system to the first sampling time in the second database, and obtain the fourth cumulative change quantity from the initial time of the system to the second sampling time; the second database includes the cumulative change records of the object, and the cumulative change The record includes the cumulative change number of the object from the initial time of the system to each sampling time;
根据第一累计变化数量、第二累计变化数量、第三累计变化数量和第四累计变化数量,得到待查询时间段内对象的累计变化数量、总变化数量、总数量中的至少一种。According to the first cumulative change quantity, the second cumulative change quantity, the third cumulative change quantity, and the fourth cumulative change quantity, at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object in the time period to be queried is obtained.
上述实施例提供的一种计算机可读存储介质,其实现原理和技术效果与上述方法实施例类似,在此不再赘述。The foregoing embodiment provides a computer-readable storage medium, and its implementation principle and technical effect are similar to those of the foregoing method embodiment, and details are not described herein again.
以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性的劳动的情况下,即可以理解并实施。The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in One place, or it can be distributed to multiple network units. Some or all of the modules can be selected according to actual needs to achieve the objectives of the solutions of the embodiments. Those of ordinary skill in the art can understand and implement without creative work.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的计算处理设备中的一些或者全部部件的一些或者全部功能。 本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented by hardware, or by software modules running on one or more processors, or by a combination of them. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all of the functions of some or all of the components in the computing processing device according to the embodiments of the present invention. The present invention can also be implemented as a device or device program (for example, a computer program and a computer program product) for executing part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may have the form of one or more signals. Such a signal can be downloaded from an Internet website, or provided on a carrier signal, or provided in any other form.
例如,图8示出了可以实现根据本发明的方法的计算处理设备。该计算处理设备传统上包括处理器1010和以存储器1020形式的计算机程序产品或者计算机可读介质。存储器1020可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器1020具有用于执行上述方法中的任何方法步骤的程序代码1031的存储空间1030。例如,用于程序代码的存储空间1030可以包括分别用于实现上面的方法中的各种步骤的各个程序代码1031。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为如参考图9所述的便携式或者固定存储单元。该存储单元可以具有与图8的计算处理设备中的存储器1020类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括计算机可读代码1031’,即可以由例如诸如1010之类的处理器读取的代码,这些代码当由计算处理设备运行时,导致该计算处理设备执行上面所描述的方法中的各个步骤。For example, FIG. 8 shows a computing processing device that can implement the method according to the present invention. The computing processing device traditionally includes a processor 1010 and a computer program product in the form of a memory 1020 or a computer readable medium. The memory 1020 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM. The memory 1020 has a storage space 1030 for executing the program code 1031 of any method step in the above method. For example, the storage space 1030 for program codes may include various program codes 1031 respectively used to implement various steps in the above method. These program codes can be read from or written into one or more computer program products. These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards, or floppy disks. Such a computer program product is usually a portable or fixed storage unit as described with reference to FIG. 9. The storage unit may have storage segments, storage spaces, etc. arranged similarly to the memory 1020 in the computing processing device of FIG. 8. The program code can be compressed in an appropriate form, for example. Generally, the storage unit includes computer-readable code 1031', that is, code that can be read by a processor such as 1010, which, when run by a computing processing device, causes the computing processing device to execute the method described above. The various steps.
另外,在本发明实施例的描述中,除非另有明确的规定和限定,术语“安装”、“相连”、“连接”应做广义理解,例如,可以是固定连接,也可以是可拆卸连接,或一体地连接;可以是机械连接,也可以是电连接;可以是直接相连,也可以通过中间媒介间接相连,可以是两个元件内部的连通。对于本领域的普通技术人员而言,可以具体情况理解上述术语在本发明中的具体含义。In addition, in the description of the embodiments of the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", and "connected" should be understood in a broad sense, for example, they may be fixed connections or detachable connections. , Or integrally connected; it can be a mechanical connection or an electrical connection; it can be directly connected or indirectly connected through an intermediate medium, and it can be the internal communication between two components. For those of ordinary skill in the art, the specific meanings of the above-mentioned terms in the present invention can be understood in specific situations.
在本发明的描述中,需要说明的是,术语“中心”、“上”、“下”、“左”、“右”、“竖直”、“水平”、“内”、“外”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明和简化描述,而不是指示或暗示所指的装置或元件必须具有特定的方位、以特定的方位构造和操作,因此不能理解为对本发明的限制。此外,术语“第一”、“第二”、“第三”仅用于描述目的,而不能理解为指示或暗示相对重要性。In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc. The indicated orientation or positional relationship is based on the orientation or positional relationship shown in the drawings, and is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the pointed device or element must have a specific orientation or a specific orientation. The structure and operation cannot therefore be understood as a limitation of the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes, and cannot be understood as indicating or implying relative importance.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working process of the system, device and unit described above can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,又例如,多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些通信接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method may be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division, and there may be other divisions in actual implementation. For example, multiple units or components may be combined or It can be integrated into another system, or some features can be ignored or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be through some communication interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, the functional units in the various embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个处理器可执行的非易失的计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer readable storage medium executable by a processor. Based on this understanding, the technical solution of the present invention essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including Several instructions are used to make a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical disks and other media that can store program codes. .
最后应说明的是:以上所述实施例,仅为本发明的具体实施方式,用以说明本发明的技术方案,而非对其限制,本发明的保护范围并不局限于此,尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,其依然可以对前述实施例所记载的技术方案进行修改或可轻易想到变化,或者对其中部分技术特征进行等同替换;而这些修改、变化或者替换,并不使相应 技术方案的本质脱离本发明实施例技术方案的精神和范围,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。Finally, it should be noted that the above-mentioned embodiments are only specific implementations of the present invention, which are used to illustrate the technical solutions of the present invention, but not to limit them. The protection scope of the present invention is not limited thereto, although referring to the foregoing The embodiments describe the present invention in detail, and those skilled in the art should understand that any person skilled in the art can still modify the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention. Or it can be easily conceived of changes, or equivalent replacements of some of the technical features; and these modifications, changes or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be covered by the present invention Within the scope of protection. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.
本文中所称的“一个实施例”、“实施例”或者“一个或者多个实施例”意味着,结合实施例描述的特定特征、结构或者特性包括在本发明的至少一个实施例中。此外,请注意,这里“在一个实施例中”的词语例子不一定全指同一个实施例。The “one embodiment”, “an embodiment” or “one or more embodiments” referred to herein means that a specific feature, structure, or characteristic described in combination with the embodiment is included in at least one embodiment of the present invention. In addition, please note that the word examples "in one embodiment" here do not necessarily all refer to the same embodiment.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下被实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the instructions provided here, a lot of specific details are explained. However, it can be understood that the embodiments of the present invention can be practiced without these specific details. In some instances, well-known methods, structures, and technologies are not shown in detail, so as not to obscure the understanding of this specification.
在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。In the claims, any reference signs placed between parentheses should not be constructed as a limitation to the claims. The word "comprising" does not exclude the presence of elements or steps not listed in the claims. The word "a" or "an" preceding an element does not exclude the presence of multiple such elements. The invention can be implemented by means of hardware comprising several different elements and by means of a suitably programmed computer. In the unit claims that list several devices, several of these devices may be embodied in the same hardware item. The use of the words first, second, and third, etc. do not indicate any order. These words can be interpreted as names.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions recorded in the foregoing embodiments are modified, or some of the technical features thereof are equivalently replaced; these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (12)

  1. 一种对象管理方法,其特征在于,所述方法包括:An object management method, characterized in that the method includes:
    接收对象的查询请求;所述查询请求表示请求查询待查询时间段内所述对象的累计变化数量、总变化数量、总数量中的至少一种,所述待查询时间段包括开始时刻和结束时刻;Receive a query request of an object; the query request represents a request to query at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object during the time period to be queried, and the time period to be queried includes a start time and an end time ;
    在第一数据库中获取第一采样时刻与所述结束时刻之间的第一变化时刻对应的第一变化数量,和,第二采样时刻与所述开始时刻之间的第二变化时刻对应的第二变化数量,根据所述第一变化数量获取所述第一采样时刻与所述结束时刻之间的第一累计变化数量,根据所述第二变化数量获取所述第二采样时刻与所述开始时刻之间的第二累计变化数量;所述第一数据库中包括对象的变化记录,所述对象的变化记录包括对象的数量发生变化的变化时刻和对应的变化数量;所述第一采样时刻为在所述结束时刻之前且与所述结束时刻间隔最近的采样时刻,所述第二采样时刻为在所述开始时刻之前且与所述结束时刻间隔最近的采样时刻;Acquire in the first database the first change quantity corresponding to the first change time between the first sampling time and the end time, and the first change number corresponding to the second change time between the second sampling time and the start time 2. The amount of change, the first cumulative change amount between the first sampling time and the end time is obtained according to the first change amount, and the second sampling time and the start time are obtained according to the second change amount The second cumulative change quantity between time; the first database includes the change record of the object, and the change record of the object includes the change time at which the number of objects changes and the corresponding change quantity; the first sampling time is A sampling time before the end time and the closest interval to the end time, and the second sampling time is a sampling time before the start time and closest to the end time interval;
    在第二数据库中获取系统初始时刻至所述第一采样时刻的第三累计变化数量,以及获取所述系统初始时刻至所述第二采样时刻的第四累计变化数量;所述第二数据库包括对象的累计变化记录,所述累计变化记录包括对象从系统初始时刻至各采样时刻之间的累计变化数量;The third cumulative change quantity from the initial time of the system to the first sampling time and the fourth cumulative change quantity from the initial time of the system to the second sampling time are acquired in the second database; the second database includes A cumulative change record of the object, where the cumulative change record includes the cumulative change number of the object from the initial time of the system to each sampling time;
    根据所述第一累计变化数量、第二累计变化数量、第三累计变化数量和第四累计变化数量,得到所述待查询时间段内所述对象的累计变化数量、总变化数量、总数量中的至少一种。According to the first cumulative change quantity, the second cumulative change quantity, the third cumulative change quantity, and the fourth cumulative change quantity, the cumulative change quantity, the total change quantity, and the total quantity of the object in the time period to be queried are obtained At least one of.
  2. 根据权利要求1所述的方法,其特征在于,若所述待查询时间段的时长小于第一预设时长阈值,则从所述第一数据库获取从所述开始时刻至所述结束时刻之间的变化时刻对应的变化数量,根据所述变化数量确定所述累计变化数量、总变化数量、总数量中的至少一种。The method according to claim 1, wherein if the duration of the time period to be queried is less than a first preset duration threshold, the period from the start time to the end time is obtained from the first database. At least one of the cumulative change quantity, the total change quantity, and the total quantity is determined according to the change quantity corresponding to the change time of the change quantity.
  3. 根据权利要求1或2所述的方法,其特征在于,所述累计变化数量 包括累计入库数量、累计出库数量、累计删除数量之一;所述变化记录和所述累计变化记录包括变化类型,所述变化类型包括入库、出库、删除中的至少一种。The method according to claim 1 or 2, wherein the cumulative change quantity includes one of a cumulative warehouse-in quantity, a cumulative warehouse-out quantity, and a cumulative deletion quantity; the change record and the cumulative change record include change types , The change type includes at least one of warehousing, warehousing, and deletion.
  4. 根据权利要求3所述的方法,其特征在于,所述待查询时间段内所述对象的总变化数量表示所述待查询时间段内所述对象的累计入库数量减去累计出库数量;或者,所述待查询时间段内所述对象的总变化数量表示所述待查询时间段内所述对象的累计入库数量减去累计出库数量和累计删除数量;The method according to claim 3, wherein the total number of changes of the objects in the time period to be queried represents the cumulative quantity of the objects in the inventory during the time period to be queried minus the cumulative number of outgoing objects; Or, the total number of changes of the object in the time period to be queried represents the cumulative amount of storage of the object in the time period to be queried minus the cumulative number of outbounds and the cumulative number of deletions;
    所述待查询时间段内所述对象的总数量表示所述系统初始时刻的对象数量加所述待查询时间段内所述对象的总变化数量。The total number of the objects in the time period to be queried represents the number of objects at the initial time of the system plus the total number of changes of the objects in the time period to be queried.
  5. 根据权利要求1或2所述的方法,其特征在于,所述方法还包括:The method according to claim 1 or 2, wherein the method further comprises:
    获取所述对象的变化信息;所述变化信息包括入库信息、出库信息和删除信息中的至少一种;Acquiring change information of the object; the change information includes at least one of inbound information, outbound information, and deletion information;
    根据所述变化信息对所述第一数据库和所述第二数据库中进行更新。The first database and the second database are updated according to the change information.
  6. 根据权利要求5所述的方法,其特征在于,所述根据所述变化信息对所述第一数据库进行更新,包括:The method according to claim 5, wherein said updating said first database according to said change information comprises:
    满足预设条件时,将对应于所述变化信息的变化记录存储至所述第一数据库;所述预设条件包括距离上一次变化记录的存储时间达到第二预设时长阈值,或者,所述预设条件包括第一变化信息的数量达到预设数量阈值,所述第一变化信息为对应于所述变化信息的变化记录未存储至所述第一数据库的变化信息。When a preset condition is met, the change record corresponding to the change information is stored in the first database; the preset condition includes that the storage time from the last change record reaches a second preset duration threshold, or The preset condition includes that the quantity of the first change information reaches a preset quantity threshold, and the first change information is change information corresponding to a change record of the change information that is not stored in the first database.
  7. 根据权利要求6所述的方法,其特征在于,所述根据所述变化信息对所述第二数据库进行更新,包括:The method according to claim 6, wherein said updating said second database according to said change information comprises:
    从所述第二数据库中获取系统初始时刻至第三采样时刻的第五累计变化数量,所述第三采样时刻为当前采样时刻的前一个采样时刻;Acquiring, from the second database, the fifth cumulative change quantity from the initial time of the system to the third sampling time, where the third sampling time is the previous sampling time of the current sampling time;
    从所述第一数据库中获取所述第三采样时刻至当前采样时刻之间的第三变化时刻对应的第三变化数量,根据所述第三变化数量获取第六累计变化 数量;Acquiring, from the first database, a third change quantity corresponding to a third change time between the third sampling time and the current sampling time, and obtaining a sixth cumulative change quantity according to the third change quantity;
    根据所述第五累计变化数量和所述第六累计变化数量,得到所述系统初始时刻至所述当前采样时刻的累计变化数量,将包含所述系统初始时刻至所述当前采样时刻的累计变化数量的累计变化记录存储至所述第二数据库。According to the fifth cumulative change quantity and the sixth cumulative change quantity, the cumulative change quantity from the initial time of the system to the current sampling time is obtained, which will include the cumulative change from the initial time of the system to the current sampling time The cumulative change record of the quantity is stored in the second database.
  8. 根据权利要求1所述的方法,其特征在于,所述变化记录和累计变化记录中还包括对象的产生设备ID、对象的类别。The method according to claim 1, wherein the change record and the cumulative change record further include the device ID of the object and the category of the object.
  9. 根据权利要求8所述的方法,其特征在于,所述累计变化数量、总变化数量、总数量包括特定ID的产生设备中对象的累计变化数量、总变化数量、总数量;和/或,所述累计变化数量、总变化数量、总数量包括特定类别对象的累计变化数量、总变化数量、总数量。The method according to claim 8, wherein the cumulative number of changes, the total number of changes, and the total number include the cumulative number of changes, the total number of changes, and the total number of objects in a specific ID generating device; and/or, The cumulative number of changes, total number of changes, and total number include the cumulative number of changes, total number of changes, and total number of objects in a specific category.
  10. 一种对象管理装置,其特征在于,所述装置包括:An object management device, characterized in that the device includes:
    接收模块,用于接收对象的查询请求;所述查询请求表示请求查询待查询时间段内所述对象的累计变化数量、总变化数量、总数量中的至少一种,所述待查询时间段包括开始时刻和结束时刻;The receiving module is configured to receive a query request of an object; the query request represents a request to query at least one of the cumulative change quantity, the total change quantity, and the total quantity of the object during the time period to be queried, and the time period to be queried includes Start time and end time;
    第一获取模块,用于在第一数据库中获取第一采样时刻与所述结束时刻之间的第一变化时刻对应的第一变化数量,和,第二采样时刻与所述开始时刻之间的第二变化时刻对应的第二变化数量,根据所述第一变化数量获取所述第一采样时刻与所述结束时刻之间的第一累计变化数量,根据所述第二变化数量获取所述第二采样时刻与所述开始时刻之间的第二累计变化数量;所述第一数据库中包括对象的变化记录,所述对象的变化记录包括对象的数量发生变化的变化时刻和对应的变化数量;所述第一采样时刻为在所述结束时刻之前且与所述结束时刻间隔最近的采样时刻,所述第二采样时刻为在所述开始时刻之前且与所述结束时刻间隔最近的采样时刻;The first acquisition module is configured to acquire, in the first database, the first change quantity corresponding to the first change time between the first sampling time and the end time, and the difference between the second sampling time and the start time The second change quantity corresponding to the second change time, the first cumulative change quantity between the first sampling time and the end time is obtained according to the first change quantity, and the first change quantity is obtained according to the second change quantity. 2. The second cumulative change quantity between the sampling time and the start time; the first database includes the change record of the object, and the change record of the object includes the change time at which the number of objects changes and the corresponding change quantity; The first sampling time is a sampling time before the end time and the closest interval to the end time, and the second sampling time is a sampling time before the start time and closest to the end time interval;
    第二获取模块,用于在第二数据库中获取系统初始时刻至所述第一采样时刻的第三累计变化数量,以及获取所述系统初始时刻至所述第二采样时刻的第四累计变化数量;所述第二数据库包括对象的累计变化记录,所述累计变化记录包括对象从系统初始时刻至各采样时刻之间的累计变化数量;The second acquiring module is configured to acquire the third cumulative change quantity from the initial time of the system to the first sampling time and the fourth cumulative change quantity from the initial time of the system to the second sampling time in the second database The second database includes a cumulative change record of the object, and the cumulative change record includes the cumulative change number of the object from the initial time of the system to each sampling time;
    确定模块,用于根据所述第一累计变化数量、第二累计变化数量、第三累计变化数量和第四累计变化数量,得到所述待查询时间段内所述对象的累计变化数量、总变化数量、总数量中的至少一种。The determining module is used to obtain the cumulative change quantity and total change of the object in the time period to be queried according to the first cumulative change quantity, the second cumulative change quantity, the third cumulative change quantity, and the fourth cumulative change quantity At least one of quantity and total quantity.
  11. 一种计算机设备,包括存储器和处理器,所述存储器存储有计算机程序,其特征在于,所述处理器执行所述计算机程序时实现权利要求1至9中任一项所述方法的步骤。A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method according to any one of claims 1 to 9 when the computer program is executed by the processor.
  12. 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1至9中任一项所述的方法的步骤。A computer-readable storage medium with a computer program stored thereon, wherein the computer program implements the steps of the method according to any one of claims 1 to 9 when the computer program is executed by a processor.
PCT/CN2020/111425 2019-10-17 2020-08-26 Object management method and apparatus, computer device, and storage medium WO2021073260A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910986607.4A CN110704675B (en) 2019-10-17 2019-10-17 Object management method, device, computer equipment and storage medium
CN201910986607.4 2019-10-17

Publications (1)

Publication Number Publication Date
WO2021073260A1 true WO2021073260A1 (en) 2021-04-22

Family

ID=69201230

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/111425 WO2021073260A1 (en) 2019-10-17 2020-08-26 Object management method and apparatus, computer device, and storage medium

Country Status (2)

Country Link
CN (1) CN110704675B (en)
WO (1) WO2021073260A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113654630A (en) * 2021-07-30 2021-11-16 深圳市中金岭南有色金属股份有限公司凡口铅锌矿 Mineral weight measuring method, device, equipment and storage medium
CN114416817A (en) * 2021-12-21 2022-04-29 北京镁伽科技有限公司 Method, apparatus, device, system and storage medium for processing data

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110704675B (en) * 2019-10-17 2022-07-29 北京旷视科技有限公司 Object management method, device, computer equipment and storage medium
CN117172806A (en) * 2023-09-27 2023-12-05 滨州邦维信息科技有限公司 Non-identification multi-source batch mixable product tracing method, device and equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106021593A (en) * 2016-06-07 2016-10-12 浪潮电子信息产业股份有限公司 Copying processing method in take-over process of first database and second database
US20170357692A1 (en) * 2012-09-28 2017-12-14 Oracle International Corporation Leveraging query-specific statistics in non-equivalent queries
CN108595314A (en) * 2018-03-12 2018-09-28 中国平安人寿保险股份有限公司 The user equipment moon enlivens number calculating method, device, terminal device and storage medium
CN108920498A (en) * 2018-05-23 2018-11-30 阿里巴巴集团控股有限公司 Data query method, device and equipment
CN110704675A (en) * 2019-10-17 2020-01-17 北京旷视科技有限公司 Object management method, device, computer equipment and storage medium

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090222293A1 (en) * 2008-02-28 2009-09-03 Daniel Wong Method and System of Using Commodity Databases in Internet Search Advertising
CN102024031B (en) * 2010-11-25 2012-12-19 百度在线网络技术(北京)有限公司 Method and equipment used for providing second search result based on real-time search
CN102375449B (en) * 2011-10-18 2014-02-19 北京化工大学 Database optimized storage and query method based on industrial control field
CN105260372B (en) * 2014-07-18 2019-03-26 上海宝信软件股份有限公司 Method based on real-time data base statistics any time period energy consumption
CN105808557B (en) * 2014-12-30 2019-03-05 陕西重型汽车有限公司 The Data Quality Analysis system and method for vehicle monitoring system
CN110147385A (en) * 2017-09-26 2019-08-20 北京国双科技有限公司 Stream data processing method, device and equipment
CN108108486B (en) * 2018-01-10 2020-05-19 上海达梦数据库有限公司 Data table query method and device, terminal equipment and storage medium
CN109241140A (en) * 2018-09-03 2019-01-18 北京旷视科技有限公司 Data statistical approach, device and electronic equipment
CN110046183A (en) * 2019-04-16 2019-07-23 北京易沃特科技有限公司 A kind of time series data polymerization search method, equipment and medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170357692A1 (en) * 2012-09-28 2017-12-14 Oracle International Corporation Leveraging query-specific statistics in non-equivalent queries
CN106021593A (en) * 2016-06-07 2016-10-12 浪潮电子信息产业股份有限公司 Copying processing method in take-over process of first database and second database
CN108595314A (en) * 2018-03-12 2018-09-28 中国平安人寿保险股份有限公司 The user equipment moon enlivens number calculating method, device, terminal device and storage medium
CN108920498A (en) * 2018-05-23 2018-11-30 阿里巴巴集团控股有限公司 Data query method, device and equipment
CN110704675A (en) * 2019-10-17 2020-01-17 北京旷视科技有限公司 Object management method, device, computer equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113654630A (en) * 2021-07-30 2021-11-16 深圳市中金岭南有色金属股份有限公司凡口铅锌矿 Mineral weight measuring method, device, equipment and storage medium
CN114416817A (en) * 2021-12-21 2022-04-29 北京镁伽科技有限公司 Method, apparatus, device, system and storage medium for processing data

Also Published As

Publication number Publication date
CN110704675A (en) 2020-01-17
CN110704675B (en) 2022-07-29

Similar Documents

Publication Publication Date Title
WO2021073260A1 (en) Object management method and apparatus, computer device, and storage medium
US7822712B1 (en) Incremental data warehouse updating
US9665632B2 (en) Managing activities over time in an activity graph
US10606806B2 (en) Method and apparatus for storing time series data
US11163735B2 (en) Database capacity estimation for database sizing
WO2005070094A2 (en) Data migration and analysis
CN111274256B (en) Resource management and control method, device, equipment and storage medium based on time sequence database
US20140071135A1 (en) Managing activities over time in an activity graph
CN110865992A (en) Retrieval library management method, retrieval device and retrieval medium
US20150235260A1 (en) Forecasting electronic events
US20230359587A1 (en) Analysis of streaming data using deltas and snapshots
Hu Information lifecycle modeling framework for construction project lifecycle management
CN110597830B (en) Real-time index generation method and system, electronic equipment and storage medium
CN108959324B (en) Method and device for estimating multimedia display resource inventory and storage medium
US11243966B1 (en) Data model design supporting low latency time-series volume planning and analysis
CN114742024A (en) Service information processing method and device and electronic equipment
US10810640B1 (en) Automated time tracking of events in a calendar and use of the same to generate invoices
US20240029002A1 (en) Method and system for identifying anomalies in compensation data
CN114816586B (en) Visible data loading method and device, computer equipment and storage medium
US11232243B1 (en) System and method for employing model repository
CN115718571B (en) Data management method and device based on multidimensional features
US20140188530A1 (en) Provision of customer attributes to an organization
CN117235179A (en) SQOOP-based data synchronization method and device, computer equipment and storage medium
CN115907904A (en) Hotel order checking method and device, computer equipment and storage medium
CN114780598A (en) Loan data acquisition method and device and computer equipment

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

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

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 05.08.2022)

122 Ep: pct application non-entry in european phase

Ref document number: 20876093

Country of ref document: EP

Kind code of ref document: A1