[go: up one dir, main page]

WO2019128318A1 - 数据处理方法、装置和系统 - Google Patents

数据处理方法、装置和系统 Download PDF

Info

Publication number
WO2019128318A1
WO2019128318A1 PCT/CN2018/105875 CN2018105875W WO2019128318A1 WO 2019128318 A1 WO2019128318 A1 WO 2019128318A1 CN 2018105875 W CN2018105875 W CN 2018105875W WO 2019128318 A1 WO2019128318 A1 WO 2019128318A1
Authority
WO
WIPO (PCT)
Prior art keywords
index
data
relationship
identifier
record
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2018/105875
Other languages
English (en)
French (fr)
Inventor
徐文华
夏永霖
李岩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to EP18895630.4A priority Critical patent/EP3716090A4/en
Publication of WO2019128318A1 publication Critical patent/WO2019128318A1/zh
Priority to US16/913,600 priority patent/US11550769B2/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/289Object oriented databases
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/235Update request formulation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/242Query formulation
    • G06F16/2433Query languages
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/24552Database cache management
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/2457Query processing with adaptation to user needs
    • G06F16/24573Query processing with adaptation to user needs using data annotations, e.g. user-defined metadata
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/248Presentation of query results
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • G06F16/288Entity relationship models

Definitions

  • the present application relates to the field of computer technologies, and in particular, to a data processing method, apparatus, and system.
  • SaaS software-as-a-service
  • CRM Customer Relationship Management
  • each enterprise also known as a tenant
  • Customization needs to be custom developed on the baseline version (also known as the base version) software.
  • Custom-developed content can include data models, business logic, and customization of front-end pages.
  • custom development includes table customization development, field customization development, and index customization development.
  • One of the solutions for implementing custom development is to directly modify the database table model. Due to the modification of the database table model, it will affect the existing network business. In addition, in the case of logical multi-tenancy, that is, in the tenant shared data table scenario, multiple tenants modify the model of the same database table to cause conflict.
  • the embodiment of the present application provides a data processing method, device, and system, thereby implementing high-performance data processing of a wide-width table.
  • the embodiment of the present invention provides the following technical solutions:
  • a data processing method comprising: receiving a data insertion request sent by a service software, the data insertion request including a data record, the data record including an object type identifier, a field value, a field identifier, and An object instance identifier; generating a field index according to the object type identifier, the field value, and the object instance identifier; generating a relation index according to the object type identifier; writing the data record to a database;
  • the operation items of the index record and the index record are cached to a cache device, and the index record includes the relationship index and the field index.
  • the data record is inserted into the database, and the index record is cached in the cache device; in the second stage, the timed task is periodically batched from the timed task.
  • the cache device synchronizes the index records to the database.
  • generating a field index according to the object type identifier, the field value, and the object instance identifier specifically: acquiring field metadata according to the object type identifier; The field metadata, the field value, and the object instance identifier are generated, and a field index is generated, the field index including a unique index or a non-unique index.
  • generating a relationship index according to the object type identifier includes: acquiring relationship metadata according to the object type identifier, where the relationship metadata includes a relationship between a parent object and a child object.
  • the relationship between the parent object and the child object includes an object type identifier of the parent object, an object type identifier of the child object, a field identifier associated with the parent object, and a field identifier associated with the child object; from the relationship metadata Obtaining a relationship between the parent object and the child object, and an object type identifier of the child object; obtaining a list of all child object instances from the parent object instance according to the object type identifier of the child object; traversing each child object An instance list, generating a relational index for each pair of parent object instances and child object instances; generating a relational index record based on all relational indexes of the parent object, the relationship index record including a parent object type identifier, a parent object instance identifier, and the All relational indexes of
  • the operation items of the index record and the index record are cached to the cache device, and the operation items of the index record and the index record are respectively cached according to the chronological order in which the operation items of the index record occur.
  • the cache device In the cache device.
  • the index persistence means writes the index record in the cache device and the operation item of the index record into the database when the predetermined time arrives.
  • the index persistence device writes the index record in the cache device and the operation item of the index record into the database, including: the index persistence device occurs according to an operation item. Time-sequentially, acquiring the index record stored in the cache device and the operation item of the index record; the index persistence device generates a database operation statement according to the index record and the operation item of the index record, The database sends a database operation statement.
  • the method further includes: receiving a data operation request generated by the service software, where the data operation request includes an object type identifier, a field value, and a field identifier; according to the object type identifier and the field identifier Obtaining the relationship data, wherein the relationship data includes an object instance identifier of all child objects associated with the parent object; and obtaining a list of object instance identifiers according to the relationship data, wherein the object instance identifier list includes An object instance identifier of all child objects associated with the parent object in the relation data; performing data operations of the database according to the object instance identifier list.
  • the field metadata may be queried according to the object type identifier and the field identifier, and the field index is determined to be a unique index or a non-unique index, and an index query request is generated, where the index query request includes The object type identifier, the field identifier, and the field value; when the field index is a unique index, sending the index query request to the cache device, receiving the first index query returned by the cache device Responding to determine whether the first index query response includes the object instance identifier; if the first index query response includes the object instance identifier, acquiring relationship data; if the first index query response is not included The object instance identifier, sending the index query request to the database; receiving a second index query response sent by the database, determining that the second index query response includes the object instance identifier, acquiring the Relational data; when the field index is a non-unique index, respectively to the cache device and the number
  • the library sends an index query request; respectively receiving a third index query response sent by the cache device and receiving
  • the relationship metadata may be queried based on the object instance identifier or the object instance identifier included in the object instance identifier set, and the object corresponding to the object instance identifier is determined to have an associated child object. Transmitting a relationship query request query relationship data to the cache device, and receiving a first relationship query response sent by the cache device; acquiring the relationship data when the first relationship query response includes relationship data; and when the relationship query response The relationship data is sent to the database, and the relationship query data is sent to the database, and the second relation query response sent by the database is received, and the relationship data is obtained from the second relationship query response.
  • the data operation request may be a data query request, and further includes: acquiring, according to the object instance identifier list, a data record set of all object instances in the object instance identifier list from the database .
  • the method further includes: deleting all the objects in the object instance identifier list in the database and the cache device based on the object instance identifier list The index record of the object instance.
  • an embodiment of the present invention provides an apparatus having a function of implementing a data processing apparatus or a cache apparatus in the foregoing method embodiments.
  • This function can be implemented in hardware or in hardware by executing the corresponding software.
  • the hardware or software includes one or more modules corresponding to the functions described above.
  • an embodiment of the present invention provides a data processing apparatus, including: a processor, a memory, a bus, and a communication interface; the memory is configured to store a computer execution instruction, and the processor is connected to the memory through the bus, when While the device is in operation, the processor executes the computer-executable instructions stored by the memory to cause the data processing apparatus to perform the data processing method of any of the first aspects above.
  • an embodiment of the present invention provides a system for implementing data processing, including the data processing device and the cache device in the foregoing method embodiment or the device embodiment.
  • an embodiment of the present invention provides a computer storage medium for storing computer software instructions used by the data processing device or the cache device, which is configured to perform the foregoing aspects for a data processing device or a cache device. program.
  • an embodiment of the present invention provides a computer program product.
  • the computer program product comprises computer software instructions executable by a processor to implement the flow in the data processing method of any of the above first aspects.
  • FIG. 1 is a schematic diagram of a possible network architecture according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a computer device according to an embodiment of the present invention.
  • FIG. 3 is a schematic flowchart of a method for writing data according to an embodiment of the present invention.
  • FIG. 4 is a schematic flowchart of a method for querying a cascading object according to an embodiment of the present invention
  • FIG. 5 is a schematic flowchart of a method for deleting a cascading object according to an embodiment of the present invention
  • FIG. 6 is a schematic flowchart of a method for data recovery according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of an implementation of a data processing apparatus according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of a system for implementing data processing according to an embodiment of the present invention.
  • a wide table technology is proposed to implement the customizability of a data model in a logical multi-tenancy scenario, and a logical model of the data is implemented through three tables: a metadata table, a service data table (wide table), and an index table. Decoupling of physical models.
  • the metadata model is described by a metadata table, and the field attributes of the data table are described.
  • the metadata (Metadata) also referred to as intermediate data and relay data, is data about data, mainly Information describing the properties of the data to support functions such as indicating storage location, historical data, resource lookup, file logging, and so on.
  • the wide table defines a unified physical model of the business data table, which reserves a large number of fields (for example: 500 fields), all of which are variable-length strings, so that different types of massive data of different tenants can be stored through the wide table;
  • the business data can also be referred to as data, which is usually referred to as data generated by the business software and stored in the database.
  • Index tables can help tenants or users improve the performance of querying data in a wide table.
  • Index tables can include unique indexes, non-unique indexes, relational indexes, name indexes (NameDenom), and fuzzy indexes (Fal lBackIndex). The difference between a unique index and a non-unique index is whether the field value stored in the table is unique.
  • a unique index and a non-unique index may also be referred to as a field index.
  • the relational index is mainly used for object association query, and the relational index is used to identify the parent-child relationship of two data records.
  • the name index is used to obtain the name based on the ID, and the fuzzy index is used to search for the word based on the name and the result of the union.
  • the field index and the relation index are involved.
  • Table 1 An example of wide table storage is shown in Table 1.
  • different tenants can store different services or different types of business data, and the same column of data fields can store different types of data.
  • the field OrgID in Table 1 can be represented as a different tenant ID. It can be seen from the different values of the OrgID in Table 1 that the wide table can store different tenant data.
  • ObjID is an object type identifier.
  • data of different object types can be represented by different logical data tables. Therefore, the object table identifier is the ID of the table, and different object partitions are specifically divided according to business requirements, for example: The object is divided into a provider (offerinst) and a subscriber (subscriberinst).
  • GUID Globally Unique Identifier
  • object instance identifier for an object instance.
  • a GUID can be a key.
  • object instance identifiers may be offerinst01, offerinst02, offerinst03... respectively.
  • the field Val0 can represent the value of each data under different tenants. It can be seen that different tenants can have different data types corresponding to Val0.
  • OrgID ObjID GUID ... Val0 Org1 A01 A01...1 ... Up Org1 A01 A01...2 ... Flat Org1 A02 A02...1 ... 20080129 Org1 A02 A02...2 ... 20080214 Org2 A03 A03...1 ... 41.23 Org2 A03 A03...2 ... -10.3
  • the wide-table technology usually includes three types of tables (metadata tables, business data tables and index tables), nine specific physical tables, including two metadata tables, two business data tables, and 5 index tables. If a data record is stored, the data record related content will be stored in the business data table and the index table.
  • the object type identifier OfferInstID is the primary key. It is assumed that the object type OfferInst has one unique index and two non-unique indexes, and the SubscriberId field is associated with the Subscriber table.
  • it is necessary to store four index records one unique index record, two non-unique index records, and one relation index record).
  • FIG. 1 is a schematic diagram of a possible system architecture according to an embodiment of the present invention.
  • the architecture includes a data processing device 11, a cache device 12, a database 13, an index persistence device 14, and an exception handling device 15.
  • the database can be used to store and manage wide tables, index tables, and metadata tables, provide operations such as querying, adding, modifying, and deleting data processing devices, as well as accepting index persistence operations of index persistence devices, and under abnormal conditions. Accept exception handling operations.
  • the data processing device can be used for accepting the access of the business software 16, defining the metadata, generating the index, caching the index in the cache device, and accessing the database, and implementing query, addition, and modification of the data stored in the database. And delete operations.
  • the caching device can be used to cache an index sent by the data processing device and to accept access by the index persistence device.
  • the index persistence means can be used to access the cache device, obtain the cached index from the cache device, and persist the cached index to the database.
  • the exception handling device can be used to maintain data consistency of the database when an exception occurs.
  • FIG. 2 is a schematic diagram of a computer device according to an embodiment of the present invention.
  • the computer device 200 includes at least one processor 21, a communication bus 22, a memory 23, and at least one communication interface 24.
  • the processor 21 can be a general purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present invention.
  • CPU central processing unit
  • ASIC application-specific integrated circuit
  • Communication bus 22 may include a path for communicating information between the components described above.
  • the communication interface 24 uses devices such as any transceiver for communicating with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Networks (WLAN), and the like.
  • RAN Radio Access Network
  • WLAN Wireless Local Area Networks
  • the memory 23 can be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type that can store information and instructions.
  • the dynamic storage device can also be an Electrically Erasable Programmable Read-Only Memory (EEPROM), a Compact Disc Read-Only Memory (CD-ROM) or other optical disc storage, and a disc storage device. (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or can be used to carry or store desired program code in the form of instructions or data structures and can be Any other media accessed, but not limited to this.
  • the memory can exist independently and be connected to the processor via a bus.
  • the memory can also be integrated with the processor.
  • the memory 23 is used to store application code for executing the solution of the present invention, and is controlled by the processor 21 for execution.
  • the processor 21 is configured to execute application code stored in the memory 23.
  • processor 21 may include one or more CPUs, such as CPU0 and CPU1 in FIG.
  • computer device 200 can include multiple processors, such as processor 21 and processor 28 in FIG. Each of these processors can be a single-CPU processor or a multi-core (mult i-CPU) processor.
  • a processor herein may refer to one or more devices, circuits, and/or processing cores for processing data, such as computer program instructions.
  • computer device 200 may also include output device 25 and input device 26 as an embodiment.
  • Output device 25 is in communication with processor 21 and can display information in a variety of ways.
  • the output device 25 may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. Wait.
  • Input device 26 is in communication with processor 21 and can accept user input in a variety of ways.
  • input device 26 can be a mouse, keyboard, touch screen device, or sensing device, and the like.
  • the computer device 200 described above can be a general purpose computer device or a special purpose computer device.
  • the computer device 200 can be a desktop computer, a portable computer, a network server, a personal digital assistant (PDA), a mobile phone, a tablet, a wireless terminal device, a communication device, an embedded device, or have FIG. A device of similar structure.
  • Embodiments of the invention do not limit the type of computer device 200.
  • the data processing device in FIG. 1 may be the device shown in FIG. 2, and one or more software modules are stored in the memory of the data processing device.
  • the data processing device can implement the software module through the processor and the program code in the memory to realize the business processing of the wide table.
  • the cache device of FIG. 1 may be the device shown in FIG. 2, and one or more software modules are stored in the memory of the cache device.
  • the cache device can implement the software module through the processor and the program code in the memory, and realize the business processing of the wide table.
  • the index persistence device of FIG. 1 may be the device shown in FIG. 2, in which one or more software modules are stored in the memory of the index persistence device.
  • the index persistence device can implement the software module through the processor and the program code in the memory to realize the business processing of the wide table.
  • the exception handling apparatus of FIG. 1 may be the apparatus shown in FIG. 2, and one or more software modules are stored in the memory of the exception handling apparatus.
  • the exception handling device can implement the software module through the processor and the program code in the memory to realize the business processing of the wide table.
  • FIG. 3 is a schematic flowchart diagram of a data processing method according to an embodiment of the present invention. The method can be applied to the network architecture shown in FIG.
  • Step 301 the data processing apparatus may pre-define field metadata and relationship metadata, and store the defined field metadata and relationship metadata.
  • the field metadata and the relationship metadata are usually stored in the data processing device.
  • metadata may also be stored in the cache device or the database, which is not specifically limited herein.
  • Subsequent steps are described by taking the field metadata and the relationship element number in the data processing device as an example. If the field metadata and the relationship element number are stored in the cache device or the database, the field metadata or relationship metadata is used. Need to get from the cache device or database.
  • Field metadata can be used to generate a unique index and a non-unique index, wherein the field metadata includes: an object type identifier, a field identifier, a field type, and an index type.
  • the field identifier is used to uniquely identify a field.
  • the field type can be a general database field type such as string, numeric, and date. Index types can be divided into unique indexes and non-unique indexes. For example, the field metadata of the defined object type Offer is shown in Table 2.
  • Subscriber SubscriberId String Unique index Subscriber offerId String Non-unique index
  • the relationship metadata may be used to generate a relational index, wherein the relationship metadata may include a relationship between the parent object and the child object, wherein the relationship between the parent object and the child object may include: an object type identifier of the parent object, a child object
  • the object type identifier, the relationship type, the field identifier associated with the parent object, and the field identifier associated with the child object can be 1:n and n:1.
  • the relationship metadata between the defined object type Subscriber and the object type Offer is as shown in Table 3.
  • the object type is Subscriber and the object type is Offer. Both are cascading objects, Subscriber is the parent object, Offer is the child object, and there may be a one-to-many relationship between Subscriber and Offer.
  • Subscriber is the parent object
  • Offer is the child object
  • Offer can also have its own child object, at this time the top-level parent object Subscriber can be called the root object.
  • Step 302 The data processing device receives the data insertion request sent by the service software.
  • the operation process is to write the data record of the root object into the database.
  • the root object also the parent object
  • Offer is the Subscriber child object
  • Offer has 10 child object instances.
  • the data insertion request contains a data record containing an object type identifier and a field value of the object, a field identifier, and an object instance identifier, which is an object type identifier of the parent object (or the root object).
  • a data insertion request can contain one data record or multiple data records.
  • Step 303 The data operation processing device acquires the field metadata according to the object type identifier of the parent object.
  • the data operation processing device further generates a field index for the parent object according to the field metadata, the field value, and the object instance identifier. If the field value is unique, the generated field index is a unique index, and if the field value is non-unique, the generated The field index is a non-unique index.
  • the field index may include: an object identifier, a field identifier, a field value, and an object instance identifier. For example, the index is shown in Table 4.
  • Step 304 The data processing device queries the relationship metadata according to the object type identifier of the parent object, acquires the association relationship of the parent object, and obtains a relationship list between the parent object and the child object.
  • the source object type identifier is the object type identifier of the parent object Subscriber.
  • Step 305 The data processing device traverses the relationship list between the parent object and the child object. For each relationship between the parent object instance and the child object instance, the object type identifier of the child object is obtained, and the object type identifier based on the child object is obtained from the parent. Get a list of all child object instances in the object instance.
  • the Subscriber-Offer relationship list there are 10 pairs of parent objects and child objects between Subscriber-Offers because there are 10 child object instances Offer.
  • the object type identifier of the child object is obtained, and the operation of acquiring all of the child object instances is performed based on the parent object instance, so that the list of 10 child object instances whose object type is Offer is respectively obtained.
  • Step 306 The data processing device traverses each sub-object instance list according to the obtained sub-object instance lists, and generates a relationship index for each pair of parent object instances and sub-object instances.
  • Table 5 shows an example of two relational indexes.
  • Parent object type identifier Parent object instance identifier
  • Sub-object type identifier Child object instance identifier Subscriber 111111 Offer 200001 Subscriber 111111 Offer 200002
  • each child object instance it is processed according to the above process until the relational index of each pair of parent and child objects is generated.
  • Step 307 The data processing apparatus generates a final relationship index record based on all relation indexes of the root object, including a root object type identifier, a root object instance identifier, and relationship data.
  • Table 6 is taken as an example to illustrate the relational index record.
  • the data processing apparatus is started to start the first transaction, and the data record is written to the database and the index record is written to the cache device.
  • Step 308 The data processing apparatus batch writes a plurality of data records of the cascade object to the database, and writing the data record to the database may be understood as inserting the data record into the data table of the database. For example, as shown in Table 6, a record in which the object type identifier is a subscriber and an object instance identifier of 11111, and a data record in which the object type identifier is offer and the object instance identifier is 20001 is written.
  • Step 309 The data processing apparatus writes the index records such as the field index and the relation index generated by the previous steps and the operation items of the index record into the cache device, and the operation items may include insert, delete, and update. ), etc., and write to the cache device in the order in which they occur.
  • the relational index record cached in the cache device can be as shown in Table 8.
  • the action item is insert.
  • the field index record cached in the cache device can be as shown in Table 9.
  • Insert operation because it is a new object:
  • the data processing device ends the first transaction after the data record is written to the database and the index record is written to the cache device.
  • the index persistence device initiates a scheduled task, starts a second transaction when the predetermined time arrives, and writes the index record in the cache device to the database.
  • the process of writing the index record of the cache device to the database by the index persistence device is specifically described below.
  • Step 310 The index persistence device periodically scans the index records to be updated cached in the cache device, and acquires the index records in chronological order.
  • Step 311 The index persistence device obtains an operation item from the index record, and combines the index record generation database operation statement, and the index persistence device sends the database operation statement to the database.
  • the database operation statement is sql statement
  • the operation type is insert to generate the insert sql statement
  • the operation type is delete to generate the delete sql statement
  • the operation type is update to generate the update sql statement.
  • a specific example is an example of a SQL statement that inserts a relational index record: insert into relationship ('Subscriber', '111111', ‘(%),mitted').
  • Step 312 The database receives the database operation statement of the index persistence device, and performs related database operation processing, thereby implementing database operations on the index record.
  • the data record When writing a wide table data record, it is divided into two stages. In the first stage, the data record is inserted into the database, and the index record is cached in the cache device. In the second stage, the index record is periodically batched from the cache device by the timed task. Synchronize to the database. Thereby achieving a high-performance writing library of large wide tables.
  • the existing scheme is that a relationship between two objects generates a relationship record, resulting in a large number of relationship records.
  • the relationship record is merged, and only the relationship record of the root object is retained, thereby improving the relationship index increase, query or delete performance.
  • Step 401 The data processing apparatus receives a data query request of the cascading object sent by the service software, and executes the query operation, where the query condition included in the data query request is a root object type identifier and a field identifier.
  • Step 403 The data processing device sends an index query request to the cache device.
  • Step 404 The cache device receives the index query request sent by the data processing device, queries the cached index record according to the object type identifier, the field identifier, and the field value, and returns an index query response.
  • the index response returned by the cache device to the data processing device contains the object instance identifier corresponding to the field value. If the cached index record does not include the field, the cache device returns an index query response to the data processing device, the index query response does not include an object instance identifier corresponding to the field value, for example, the index query response may be empty, or an index The query response contains an indication or identifier indicating that the value of the field is not queried.
  • Step 405 The data processing device receives the index query response sent by the cache device, and the data processing device determines whether the index query response includes the object instance identifier. If the index query response includes the object instance identifier, the process proceeds to step 411. If the index query response does not contain an object instance identifier, the data processing device sends an index query request to the database.
  • Step 406 The database receives the index query request, queries the stored index record according to the field value, and returns an index query response to the data processing device.
  • Step 407 The data processing apparatus receives the index query response sent by the database, and the data processing apparatus determines whether the index query response includes the object instance identifier. If the index query response includes the object instance identifier, the process proceeds to step 411. If the index query response does not contain an object instance identifier, the data processing device confirms that the query failed.
  • Step 408 The data processing device sends an index query request to the cache device and the database, respectively.
  • Step 409 The cache device and the database respectively receive an index query request, and the cache device queries the cached index record according to the object type identifier, the field identifier, and the field value, and returns an index query response to the data processing device.
  • the database queries the stored index record based on the object type identifier, the field identifier, and the field value, and returns an index query response to the data processing device.
  • the index query response may contain the same content as the index query response described in step 404.
  • Step 410 The data processing device respectively receives an index query response sent by the cache device and the database, and the data processing device determines whether the index query response includes an object instance identifier. If the index query response includes the object instance identifier, the index query response is included. The object instance identifier, the plurality of object instance identifier result sets form an object instance identifier result set, the result set includes a plurality of object type identifiers, and jumps to step 411. If the index query response does not contain an object instance identifier, the query fails.
  • Step 411 The data processing apparatus queries the relationship metadata based on the object instance identifier or the object instance identifier included in the object instance identifier set, and determines whether the parent object has an associated child object, and if the parent object has the associated child object, the jump Step 412, if the object has no associated child objects, then step 414 is skipped.
  • Step 412 The data processing device sends a relation query request query relationship data to the cache device, where the relationship query request includes an object type identifier of the root object and an object instance identifier of the root object.
  • Step 413 The data processing device receives the relationship query response sent by the cache device.
  • the relationship query response includes the relationship data
  • the relationship data is acquired.
  • the relationship query response has no relationship data
  • the relationship query request query relationship data is sent to the database, and the receiving database sends the data.
  • Relational query response get relational data.
  • Step 414 The data processing apparatus acquires the object instance identifiers of all related sub-objects based on the relation data to form a list of object instance identifiers. And the data query operation of the database is performed based on the object instance identifier list, for example, sending a SQL query statement to the database.
  • the SQL query can be:
  • Step 415 The database accepts the data query operation of the data processing device, obtains the data record set of the object, and returns a data query result to the database, where the data query result includes the data record set of the object.
  • Step 416 The data processing apparatus receives the data query result, converts the data record into an object according to each data record and its object instance identifier, and sets a relationship between the objects according to the relationship index in the relation data to form a final cascade object. Data record.
  • Steps 502-513 the same as the query process 402-413.
  • Step 514 The data processing apparatus acquires the object instance identifiers of all related sub-objects based on the relation data to form a list of object instance identifiers. And generating a data deletion request based on the object instance identifier list, and separately sending the data deletion request to the database and the cache module.
  • the SQL statement for the data deletion request can be:
  • the SQL operation request of the data manipulation module to generate data based on the object instance identifier list may be:
  • Step 515 The cache device and the database respectively accept the data deletion operation, delete the corresponding data and the relationship index and the field index, and return the deletion result to the data processing device.
  • Step 601 When the service software or the index persistence device accesses the cache device abnormality, an abnormality notification is sent to the index exception processing device.
  • Step 602 After receiving the abnormality notification, the index abnormality processing device queries the index persistence device for the generation time of the last inbound index record cache, and determines the data recovery time point according to the generation time, and the data recovery time point may specifically be the generation time. Subtract an interval (for example, 1 minute).
  • Step 603 The index abnormality processing device queries the data table of the database at the data recovery time point to obtain a data record set that needs to be restored, and the data record set that needs to be restored is the data record stored after the data recovery time point.
  • Step 604 The index exception processing apparatus acquires the object instance identifier list from the data record set, and issues an index delete request to the database, the index delete request including the object instance identifier list.
  • Step 605 The database receives the index deletion request, and deletes the index record corresponding to all the object instance identifiers in the object instance identifier list.
  • Step 606 The index exception processing device acquires field metadata and relationship metadata of each object instance according to the object instance identifier list, and generates a field index for each data record without the delete mark according to the field metadata, according to the relationship metadata.
  • a relational index is generated for the data record of the cascading object.
  • Step 607 The index exception processing apparatus writes the unique index, the non-unique index, or the relational index to the unique index table, the non-unique index table, and the relation index table in the database, respectively.
  • the actions of the data processing apparatus may be performed by the data processing apparatus in accordance with the software modules in the memory mentioned above.
  • the actions of the caching device can be performed by the caching device in accordance with the software modules in the memory mentioned above.
  • the actions of the index persistence means may be performed by the index persistence means in accordance with the software modules in the memory mentioned above.
  • the actions of the index exception handling means may be performed by the index exception handling means in accordance with the software modules in the memory mentioned above.
  • the embodiment of the present application does not impose any limitation on this.
  • the device for implementing the programming device or the network function management device includes a corresponding hardware structure and/or software module for executing each function.
  • the present invention can be implemented in a combination of hardware or hardware and computer software in combination with the elements and algorithm steps of the various examples described in the embodiments disclosed herein. Whether a function is implemented in hardware or computer software to drive hardware depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods for implementing the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
  • the embodiment of the present invention may divide the function module into the orchestration device or the network function management device according to the foregoing method example.
  • each function module may be divided according to each function, or two or more functions may be integrated into one processing module.
  • the above integrated modules can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of the module in the embodiment of the present invention is schematic, and is only a logical function division, and the actual implementation may have another division manner.
  • FIG. 7 is a schematic structural diagram of a possible implementation of the data processing apparatus involved in the foregoing embodiment.
  • the apparatus 700 includes: a receiving unit 701, and a generating unit 703. , a database processing unit 705 and a cache processing unit 707.
  • the receiving unit 701 is configured to receive a data insertion request sent by the service software, where the data insertion request includes a data record, where the data record includes an object type identifier, a field value, a field identifier, and an object instance identifier;
  • a generating unit 703, configured to generate a field index according to the object type identifier, the field value, and the object instance identifier;
  • the generating unit 703 is further configured to generate a relationship index according to the object type identifier
  • a database processing unit 705, configured to write the data record to a database
  • the cache processing unit 707 is configured to cache the operation items of the index record and the index record to the cache device, where the index record includes the relationship index and the field index.
  • the generating unit 703 is specifically configured to: obtain field metadata according to the object type identifier, according to the field metadata, the field value, and the object instance identifier, A field index is generated, the field index including a unique index or a non-unique index.
  • the generating unit 703 is specifically configured to: acquire relationship metadata according to the object type identifier, where the relationship metadata includes a relationship between a parent object and a child object, where The relationship between the parent object and the child object includes an object type identifier of the parent object, an object type identifier of the child object, a field identifier associated with the parent object, and a field identifier associated with the child object; obtained from the relationship metadata a relationship between the parent object and the child object, and an object type identifier of the child object; obtaining a list of all child object instances from the parent object instance according to the object type identifier of the child object; traversing each child object instance list Generating a relational index for each pair of parent object instances and child object instances; generating a relational index record based on all relational indexes of the parent object, the relationship index record including a parent object type identifier, a parent object instance identifier, and the parent object All relational indexes.
  • the cache processing unit 707 is specifically configured to cache the operation items of the index record and the index record into the cache device according to the chronological order in which the operation items of the index record occur.
  • the receiving unit 701 is further configured to receive a data operation request that is generated by the service software, where the data operation request includes an object type identifier, a field value, and a field identifier; the device further includes The obtaining unit 709 is configured to acquire the relationship data according to the object type identifier and the field identifier, where the relationship data includes an object instance identifier of all child objects associated with the parent object; and the obtaining unit 709 is further configured to: Obtaining, according to the relationship data, a list of object instance identifiers, where the object instance identifier list includes an object instance identifier of all child objects associated with the parent object in the relationship data; the database processing unit 707 is further configured to The object instance identifier list performs data operations of the database.
  • the obtaining unit 709 is specifically configured to: query the field metadata according to the object type identifier and the field identifier, determine that the field index is a unique index or a non-unique index, and generate an index query.
  • a request the index query request includes the object type identifier, the field identifier, and the field value; when the field index is a unique index, sending the index query request to the cache device, receiving the location Determining, by the cache device, a first index query response, determining whether the first index query response includes the object instance identifier; if the first index query response includes the object instance identifier, acquiring relationship data; The first index query response does not include the object instance identifier, and sends the index query request to the database; receiving a second index query response sent by the database, determining that the second index query response includes the An object instance identifier, the relation data is obtained; when the field index is a non-unique index, Sending an index query request to the cache device and the database; respectively receiving a third
  • the obtaining unit 709 is further configured to: determine the object instance by querying the relationship metadata based on the object instance identifier or the object instance identifier included in the object instance identifier set.
  • the object corresponding to the identifier has an associated sub-object, and sends a relation query request query relationship data to the cache device, and receives a first relationship query response sent by the cache device; when the first relationship query response includes relationship data, acquiring the Relational data; when the relationship query response has no relational data, sending a relational query request query relationship data to the database, receiving a second relational query response sent by the database, and acquiring the second relation query response from the second relationship query response Relationship data.
  • the database processing unit 707 is further configured to: when the data operation request is specifically a data query request, obtain the object instance identifier from the database according to the object instance identifier list. A set of data records for all object instances in the list.
  • the database processing unit 707 is further configured to: when the data operation request is specifically a data deletion request, delete the database and the cache device respectively according to the object instance identifier list The index record of all object instances in the object instance identifier list.
  • the device for realizing data processing is presented in the form of dividing each functional module corresponding to each function, or the device for realizing data processing is presented in a form of dividing each functional module in an integrated manner.
  • a “module” herein may refer to an application-specific integrated circuit (ASIC), circuitry, a processor and memory that executes one or more software or firmware programs, integrated logic circuitry, and/or other functions that provide the functionality described above.
  • ASIC application-specific integrated circuit
  • apparatus 700 for implementing data processing may take the form shown in FIG.
  • the receiving unit 701, the generating unit 703, the cache processing unit 705 and the data processing unit 707 or the obtaining unit 709 can be executed by calling the application code stored in the memory 23 by the processor 21 (and/or the processor 28),
  • the embodiment of the present invention does not impose any limitation on this.
  • FIG. 8 shows a data processing system involved in the above embodiment, the system comprising: a data processing device 801 and a cache device 802,
  • the data processing device 801 is configured to receive a data insertion request sent by the service software, where the data insertion request includes a data record, where the data record includes an object type identifier, a field value, a field identifier, and an object instance identifier; Generating a field index based on the object type identifier, the field value, and the object instance identifier; generating a relational index according to the object type identifier; writing the data record to a database; and caching the index record to a cache device And an operation item of the index record, the index record including the relationship index and the field index;
  • the cache device 802 is configured to cache the operation items of the index record and the index record.
  • the method further includes: an index persistence means 803, configured to write the index record and the operation item of the index record in the cache device into the database when a predetermined time arrives.
  • the index persistence device 803 is configured to acquire, according to the chronological order of the operation items, the index records stored in the cache device and the operation items of the index records;
  • the operation item of the index record generates a database operation statement and sends a database operation statement to the database.
  • the method further includes: an index exception processing unit 804, configured to query the index persistence device for the generation time of the last inbound index record cache after receiving the exception notification, and determine data recovery according to the generation time. a time point; querying the data table of the database according to the data recovery time point, and acquiring a data record set that needs to be restored, wherein the data record set that needs to be restored is a data record stored after the data recovery time point; Obtaining, by the data record set, a list of object instance identifiers, and issuing an index deletion request to the database, the index deletion request including a list of the image instance identifiers; obtaining each object instance according to the object instance identifier list Field metadata and relationship metadata, and generating a field index for each data record without a delete mark according to the field metadata, generating a relation index according to the relationship metadata; and indexing the field and the relationship index Write to the database separately.
  • an index exception processing unit 804 configured to query the index persistence device for the generation time of the last inbound index record cache after receiving
  • the embodiment of the present invention further provides a computer storage medium for storing computer software instructions for the apparatus for implementing data processing shown in FIG. 3-6, which includes program code for executing the foregoing method embodiment. .
  • the data processing performance of a wide table can be improved by executing stored program code.
  • the embodiment of the invention also provides a computer program product.
  • the computer program product includes computer software instructions that are loadable by a processor to implement the methods of the above method embodiments.
  • embodiments of the present application can be provided as a method, apparatus (device), or computer program product.
  • the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware aspects, which are collectively referred to herein as "module” or “system.”
  • the application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • the computer program is stored/distributed in a suitable medium, provided with other hardware or as part of the hardware, or in other distributed forms, such as over the Internet or other wired or wireless telecommunication systems.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.

Landscapes

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

Abstract

一种数据处理方法、装置和系统,该方法包括:接收业务软件发送的数据插入请求,所述数据插入请求包含数据记录,所述数据记录包含对象类型标识符、字段值、字段标识符和对象实例标识符;根据所述对象类型标识符、所述字段值和所述对象实例标识符,生成字段索引;根据所述对象类型标识符,生成关系索引;向数据库写入所述数据记录;向缓存装置缓存所述索引记录以及索引记录的操作项,所述索引记录包含所述关系索引和字段索引。通过上述方案,实现宽表的高性能的数据处理。

Description

数据处理方法、装置和系统
本申请要求于2017年12月29日提交中国专利局、申请号为201711487277.1,发明名称为“数据处理方法、装置和系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及一种数据处理方法、装置及系统。
背景技术
在软件即服务(Software-as-a-Service,SaaS)化的各种软件(例如:客户关系管理(Customer Relationship Management,CRM))业务中,各个企业(又可以称为租户)有自身的个性化需求,需要在基线版本(又可以称为基础版本)软件上进行定制开发。定制开发的内容可以包括数据模型、业务逻辑和前台页面的定制。
以数据模型的定制开发为例,定制开发包括表定制开发、字段定制开发和索引定制开发等,其中一种实现定制开发的方案是直接修改数据库表模型。由于涉及数据库表模型的修改,对现网业务会造成影响。另外,在逻辑多租情况下,即租户共用数据表场景下,多个租户对同一张数据库表的模型进行修改会造成冲突。
发明内容
本申请实施例提供一种数据处理方法、装置及系统,从而实现大宽表的高性能的数据处理。
为达到上述目的,本发明实施例提供如下技术方案:
第一方面,提供一种数据处理方法,该方法包括:接收业务软件发送的数据插入请求,所述数据插入请求包含数据记录,所述数据记录包含对象类型标识符、字段值、字段标识符和对象实例标识符;根据所述对象类型标识符、所述字段值和所述对象实例标识符,生成字段索引;根据所述对象类型标识符,生成关系索引;向数据库写入所述数据记录;向缓存装置缓存所述索引记录以及索引记录的操作项,所述索引记录包含所述关系索引和字段索引。在该方案中,在写宽表数据记录时分成两个阶段,在第一个阶段,将数据记录插入到数据库、将索引记录缓存在缓存装置;在第二个阶段,通过定时任务定时批量从缓存装置将索引记录同步到数据库。从而实现大宽表的高性能写库。
在一种可能的设计中,根据所述对象类型标识符、所述字段值和所述对象实例标识符,生成字段索引,具体包括:根据所述对象类型标识符,获取字段元数据;根据所述字段元数据、所述字段值和所述对象实例标识符,生成字段索引,所述字段索引包括唯一索引或非唯一索引。
在一种可能的设计中,根据所述对象类型标识符,生成关系索引,具体包括:根据所述对象类型标识符,获取关系元数据,所述关系元数据包括父对象和子对象之间的关系,其中所述父对象和子对象之间的关系包括父对象的对象类型标识符、子对象的对象类型标识符、父对象关联的字段标识符和子对象关联的字段标识符;从所述关系元数据中获取所述父对象和子对象之间的关系,以及所述子对象的对象类型标识符;根据所述子对象的对象类型标识 符从父对象实例中获取所有子对象实例列表;遍历各个子对象实例列表,为每对父对象实例和子对象实例生成一个关系索引;基于父对象的所有关系索引,生成关系索引记录,所述关系索引记录包括父对象类型标识符、父对象实例标识符和所述父对象的所有关系索引。
在一种可能的设计中,向缓存装置缓存所述索引记录以及索引记录的操作项,包括:按照索引记录的操作项发生的时间先后顺序分别将所述索引记录以及索引记录的操作项缓存到所述缓存装置中。
在一种可能的设计中,在预定的时间到达时,索引持久化装置将所述缓存装置中的所述索引记录以及索引记录的操作项写入到所述数据库中。
在一种可能的设计中,所述索引持久化装置将缓存装置中的所述索引记录以及索引记录的操作项写入到所述数据库中,包括:所述索引持久化装置按照操作项发生的时间先后顺序,获取缓存装置中存储的所述索引记录以及所述索引记录的操作项;所述索引持久化装置根据所述索引记录以及所述索引记录的操作项,生成数据库操作语句,向所述数据库发送数据库操作语句。
在一种可能的设计,还包括:接收所述业务软件发生的数据操作请求,所述数据操作请求包含对象类型标识符、字段值和字段标识符;根据所述对象类型标识符和字段标识符,获取所述关系数据,其中所述关系数据包括父对象相关联所有子对象的对象实例标识符;根据所述关系数据,获取对象实例标识符列表,其中,所述对象实例标识符列表包含所述关系数据中的父对象关联的所有子对象的对象实例标识;根据所述对象实例标识符列表进行数据库的数据操作。
在一种可能的设计中,可以根据所述对象类型标识符和所述字段标识符查询字段元数据,确定字段索引为唯一索引或非唯一索引,生成索引查询请求,所述索引查询请求中包括所述对象类型标识符、所述字段标识符和所述字段值;当所述字段索引是唯一索引,向所述缓存装置发送所述索引查询请求,接收所述缓存装置返回的第一索引查询响应,判断所述第一索引查询响应是否包含所述对象实例标识符;如果所述第一索引查询响应包含所述对象实例标识符,则获取关系数据;如果所述第一索引查询响应没有包含所述对象实例标识符,向所述数据库发送所述索引查询请求;接收所述数据库发送的第二索引查询响应,确定所述第二索引查询响应包含所述对象实例标识符,则获取所述关系数据;当所述字段索引是非唯一索引,分别向所述缓存装置和所述数据库发送索引查询请求;分别接收所述缓存装置发送的第三索引查询响应和接收所述数据库发送的第四索引查询响应;分别获取所述第三索引查询响应包含的对象实例标识符和所述第四索引查询响应包含的对象实例标识符,以及形成对象实例标识符结果集,其中,所述对象实例标识符结果集包含所述第三索引查询响应包含的对象实例标识符和所述第四索引查询响应包含的对象实例标识符,获取所述关系数据。本发明实施例通过将关系数据合并,只保留一条根对象的关系数据,从而提升关系索引的增加,查询或者删除性能。
在一种可能的设计中,可以基于所述对象实例标识符或者所述对象实例标识符集包含的对象实例标识符查询关系元数据,确定所述对象实例标识符对应的对象具有关联子对象,向所述缓存装置发送关系查询请求查询关系数据,接收所述缓存装置发送的第一关系查询响应;当所述第一关系查询响应包含关系数据,获取所述关系数据;当所述关系查询响应没有关系数据,向所述数据库发送关系查询请求查询关系数据,接收所述数据库发送的第二关系查询响应,从所述第二关系查询响应中获取所述关系数据。
在一种可能的设计中,数据操作请求具体可以为数据查询请求,还包括:根据所述对象实例标识符列表,从所述数据库获取所述对象实例标识符列表中所有对象实例的数据记录集。
在一种可能的设计中,当所述数据操作请求具体为数据删除请求,还包括:基于所述对象实例标识符列表,分别删除所述数据库和缓存装置中所述对象实例标识符列表中所有对象实例的索引记录。
第二方面,本发明的实施例提供一种装置,该实现数据处理的装置具有实现上述方法实施例中数据处理装置或缓存装置的功能。该功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。该硬件或软件包括一个或多个与上述功能相对应的模块。
第三方面,本发明的实施例提供一种数据处理装置,包括:处理器、存储器、总线和通信接口;该存储器用于存储计算机执行指令,该处理器与该存储器通过该总线连接,当该设备运行时,该处理器执行该存储器存储的该计算机执行指令,以使该实现数据处理装置执行如上述第一方面任意一项的数据处理方法。
第四方面,本发明的实施例提供一种实现数据处理的系统,包括上述方法实施例中或装置实施例中的数据处理装置和缓存装置。
第五方面,本发明实施例提供了一种计算机存储介质,用于储存为上述数据处理装置或缓存装置所用的计算机软件指令,其包含用于执行上述方面为数据处理装置或缓存装置所设计的程序。
第六方面,本发明实施例提供了一种计算机程序产品。该计算机程序产品包括计算机软件指令,该计算机软件指令可通过处理器进行加载来实现上述第一方面中任意一项的数据处理方法中的流程。
另外,第二方面至第六方面中任一种设计方式所带来的技术效果可参见第一方面中不同设计方式所带来的技术效果,此处不再赘述。
本发明的这些方面或其他方面在以下实施例的描述中会更加简明易懂。
附图说明
图1所示为本发明实施例提供的一种可能的网络架构示意图;
图2所示为本发明实施例提供的计算机设备示意图;
图3所示为本发明实施例提供的一种数据写入的方法流程示意图;
图4所示为本发明实施例提供的一种级联对象查询的方法流程示意图;
图5所示为本发明实施例提供的一种级联对象删除的方法流程示意图;
图6所示为本发明实施例提供的一种数据恢复的方法流程示意图;
图7所示为本发明实施例提供的一种实现数据处理装置结构示意图;
图8所示为本发明实施例提供的一种实现数据处理的系统示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行描述。方法实施例中的具体操作方法也可以应用于装置实施例或系统实施例中。其中,在本申请的描述中,除非另有说明,“多个”的含义是两个或两个以上。
本发明实施例描述的架构以及业务场景是为了更加清楚的说明本发明实施例的技术方案,并不构成对于本发明实施例提供的技术方案的限定,本领域普通技术人员可知,随着网 络架构的演变和新业务场景的出现,本发明实施例提供的技术方案对于类似的技术问题,同样适用。
现有技术中提出了宽表技术来实现逻辑多租场景下的数据模型的可定制性,通过元数据表、业务数据表(宽表)、索引表这三种表来实现对数据逻辑模型和物理模型的解耦。具体来说,通过元数据表描述数据逻辑模型,描述数据表的字段属性,这里的元数据(Metadata),又称中介数据、中继数据,为描述数据的数据(data about data),主要是描述数据属性(property)的信息,用来支持如指示存储位置、历史数据、资源查找、文件记录等功能。宽表定义了一个统一的业务数据表物理模型,预留海量字段(例如:500字段),所有字段都是可变长字符串,这样通过宽表可以存储不同租户的不同类型的海量数据;这里的业务数据也可以简称为数据,通常指的业务软件产生的并存储在数据库中的数据。索引表可以帮助租户或用户提高查询宽表中的数据的性能,索引表可以包括了唯一索引、非唯一索引、关系索引(Relat ionships)、名称索引(NameDenom)和模糊索引(Fal lBackIndex),这里的唯一索引和非唯一索引的区别是该表存储的字段值是否唯一的,唯一索引和非唯一索引也可以称为字段索引。关系索引主要用于对象关联查询,关系索引用于标识两条数据记录件的父子关系。名称索引用于基于ID快速名字获取,模糊索引用于基于名字模糊查词,提供union结果,本发明实施例中涉及到字段索引和关系索引。
宽表存储示例如表1所示,在同一个表中,不同租户可以存储着不同业务或者不同类型的业务数据,并且同一列数据字段可以存储不同类型的数据。例如:表1中的字段OrgID可以表示为不同租户ID,从表1中OrgID不同的值可以看出宽表可以存储不同租户数据。ObjID为对象类型标识符,通常来说,不同的对象类型的数据可以用不同逻辑数据表来表示,因此对象表标识符又是表的ID,不同的对象划分根据业务需求来具体划分,比如:将对象划分为提供者(offerinst)和订阅者(subscriberinst)。全球唯一标识符(Globally Unique Identifier,GUID)为一个对象实例的标识符,通常来说,GUID可以作为关键。例如对于offerinst这个对象而言,可能存在多个对象实例,它们的对象实例标识符可以分别为offerinst01、offerinst02、offerinst03…。字段Val0可以表示不同租户下的各个数据的值,可以看出不同租户,该Val0对应的数据类型可以是不同的。
OrgID ObjID GUID Val0
org1 a01 a01…1 Up
org1 a01 a01…2 Flat
org1 a02 a02…1 20080129
org1 a02 a02…2 20080214
org2 a03 a03…1 41.23
org2 a03 a03…2 -10.3
表1
在目前的宽表技术的实现方案,通常包括了3大类型表(元数据表,业务数据表和索引表),9张具体的物理表,包括2张元数据表、2张业务数据表和5张索引表。如果存储一条数据记录时,在业务数据表及索引表都将存储该条数据记录相关内容。以对象类型 OfferInst为例,对象类型标识符OfferInstID为主键,假设该对象类型OfferInst存在1个唯一索引和2个非唯一索引,SubscriberId字段关联到Subscriber表。这样在存储一条有关OfferInst的数据记录时,需要同时存4条索引记录(1个唯一索引记录、2个非唯一索引记录、1个关系索引记录)。也就是说,当写1条OfferInst记录,在宽表中需要写1条数据记录和4条索引记录,是标准表方案的5倍。假设一个Subscriber对象实例与20个OfferInst对象实例相关,查询Subscriber对象实例与OfferInst对象实例之间关系时,需要获取20条关系索引记录。这给数据存储和查询时都带来严重的性能问题。
如图1所示,为本发明实施例的一种可能的系统架构示意图。该架构包括数据处理装置11、缓存装12、数据库13、索引持久化装置14和异常处理装置15。数据库可以用于存储和管理宽表、索引表和元数据表,对数据处理装置提供查询、增加、修改和删除等操作,以及受理索引持久化装置的索引持久化操作,以及在异常情况下的受理异常处理操作。数据处理装置可以用于受理业务软件16的访问、元数据的定义、索引的生成、在缓存装置中进行对索引进行缓存、以及对数据库的访问,实现对数据库存储的数据的查询、增加、修改和删除等操作。缓存装置可以用于缓存数据处理装置发送的索引,以及受理索引持久化装置的访问。索引持久化装置可以用于访问缓存装置,从缓存装置中获取到缓存的索引,并将缓存的索引持久化到数据库中。异常处理装置可以用于当异常出现时,维护数据库的数据的一致性。下面各个实施例将进一步介绍系统中各个网元的具体功能和处理流程。
图2所示为本发明实施例提供的计算机设备示意图。计算机设备200包括至少一个处理器21,通信总线22,存储器23以及至少一个通信接口24。
处理器21可以是一个通用中央处理器(CPU),微处理器,特定应用集成电路(application-specific integrated circuit,ASIC),或一个或多个用于控制本发明方案程序执行的集成电路。
通信总线22可包括一通路,在上述组件之间传送信息。所述通信接口24,使用任何收发器一类的装置,用于与其他设备或通信网络通信,如以太网,无线接入网(RAN),无线局域网(Wireless Local Area Networks,WLAN)等。
存储器23可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储设备,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储设备,也可以是电可擦可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、只读光盘(Compact Disc Read-Only Memory,CD-ROM)或其他光盘存储、光碟存储(包括压缩光碟、激光碟、光碟、数字通用光碟、蓝光光碟等)、磁盘存储介质或者其他磁存储设备、或者能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。存储器可以是独立存在,通过总线与处理器相连接。存储器也可以和处理器集成在一起。
其中,所述存储器23用于存储执行本发明方案的应用程序代码,并由处理器21来控制执行。所述处理器21用于执行所述存储器23中存储的应用程序代码。
在具体实现中,作为一种实施例,处理器21可以包括一个或多个CPU,例如图2中的CPU0和CPU1。
在具体实现中,作为一种实施例,计算机设备200可以包括多个处理器,例如图2中的处理器21和处理器28。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(mult i-CPU)处理器。这里的处理器可以指一个或多个设备、电路、和/或 用于处理数据(例如计算机程序指令)的处理核。
在具体实现中,作为一种实施例,计算机设备200还可以包括输出设备25和输入设备26。输出设备25和处理器21通信,可以以多种方式来显示信息。例如,输出设备25可以是液晶显示器(liquid crystal display,LCD),发光二级管(light emitting diode,LED)显示设备,阴极射线管(cathode ray tube,CRT)显示设备,或投影仪(projector)等。输入设备26和处理器21通信,可以以多种方式接受用户的输入。例如,输入设备26可以是鼠标、键盘、触摸屏设备或传感设备等。
上述的计算机设备200可以是一个通用计算机设备或者是一个专用计算机设备。在具体实现中,计算机设备200可以是台式机、便携式电脑、网络服务器、掌上电脑(Personal Digital Assistant,PDA)、移动手机、平板电脑、无线终端设备、通信设备、嵌入式设备或有图2中类似结构的设备。本发明实施例不限定计算机设备200的类型。
示例性的,图1中的数据处理装置可以为图2所示的设备,数据处理装置的存储器中存储了一个或多个软件模块。数据处理装置可以通过处理器以及存储器中的程序代码来实现软件模块,实现宽表的业务处理。
又或者,图1中的缓存装置可以为图2所示的设备,缓存装置的存储器中存储了一个或多个软件模块。缓存装置可以通过处理器以及存储器中的程序代码来实现软件模块,实现宽表的业务处理。
又或者,图1中的索引持久化装置可以为图2所示的设备,索引持久化装置的存储器中存储了一个或多个软件模块。索引持久化装置可以通过处理器以及存储器中的程序代码来实现软件模块,实现宽表的业务处理。
又或者,图1中的异常处理装置可以为图2所示的设备,异常处理装置的存储器中存储了一个或多个软件模块。异常处理装置可以通过处理器以及存储器中的程序代码来实现软件模块,实现宽表的业务处理。
如图3所示,为本发明实施例提供的数据处理方法流程示意图。该方法可以应用于图1所示的网络架构中。
步骤301,数据处理装置可以预先定义字段元数据和关系元数据,并存储定义好的字段元数据和关系元数据。
字段元数据和关系元数据通常存储在数据处理装置中,当然这类元数据也可以存储在缓存装置或者数据库,这里不做具体限定。后续各个步骤都是以字段元数据和关系元数存储在数据处理装置为例来进行说明的,如果字段元数据和关系元数存储在缓存装置或者数据库,则在使用字段元数据或关系元数据,需要从缓存装置或者数据库中获取。
字段元数据可以用于生成唯一索引和非唯一索引,其中,字段元数据包括:对象类型标识符、字段标识符、字段类型和索引类型。字段标识符用于唯一标识某个字段,字段类型具体可以为字符串,数字型和日期型等通常的数据库字段类型。索引类型可以分为唯一索引和非唯一索引。比如:定义好的对象类型Offer的字段元数据如表2所示。
对象类型标识符 字段标识符 字段类型 索引类型
Offer OfferInstId 字符串 唯一索引
Offer SubscriberId 字符串 非唯一索引
Offer OfferId 字符串 非唯一索引
Subscriber SubscriberId 字符串 唯一索引
Subscriber offerId 字符串 非唯一索引
表2
关系元数据可以用于生成关系索引,其中,关系元数据可以包括父对象和子对象之间的关系,其中所述父对象和子对象之间的关系可以包括:父对象的对象类型标识符、子对象的对象类型标识符、关系类型、父对象关联的字段标识符和子对象关联的字段标识符。其中,关系类型可以为1:n和n:1等。例如:定义好的对象类型Subscriber和对象类型Offer之间的关系元数据如表3所示。
Figure PCTCN2018105875-appb-000001
表3
在本发明实施例中,可能存在级联对象场景,也就是说这些级联对象之间存在一定的映射关系。例如对象类型为Subscriber和对象类型为Offer两者是级联对象,Subscriber是父对象,Offer是子对象,Subscriber和Offer之间可能存在一对多关系。在这种场景下,如果级联对象之一写数据库时,就会有对应的关系索引生成。此外,Offer也可以有自己的子对象,此时最顶层的父对象Subscriber可以称为根对象。
步骤302,数据处理装置接收到业务软件发送的数据插入请求,通常来说,操作处理目的是将根对象的数据记录写入到数据库中。假设根对象(也是父对象)为Subscriber,Offer是Subscriber子对象,而且Offer存在10个子对象实例。数据插入请求包含数据记录,上述数据记录包含对象的对象类型标识符和字段值、字段标识符和对象实例标识符,该对象类型标识符为父对象(或者根对象)的对象类型标识符。数据插入请求可以包含一条数据记录或者多条数据记录。
下面进一步介绍在插入数据记录时可能涉及到的多个操作处理流程,包括步骤303介绍了字段索引生成的流程、步骤304-307介绍了关系索引生成的流程、步骤308-312介绍了写数据记录和写索引记录的流程。
步骤303,数据操作处理装置根据父对象的对象类型标识符获取到字段元数据。数据操作处理装置进一步依据字段元数据、字段值和对象实例标识符,为父对象生成字段索引,如果字段值是唯一的,则生成的字段索引是唯一索引,如果字段值是非唯一的,则生成的字段索引是非唯一索引。字段索引可以包括:对象标识符、字段标识符、字段值和对象实例标识符。例如索引如表4所示。
对象类型标识符 字段标识符 字段值 对象实例标识符
       
表4
步骤304:数据处理装置根据父对象的对象类型标识符,查询关系元数据,获取父对象的关联关系,并获得父对象和子对象之间的关系列表。
例如:源对象类型标识符就是父对象Subscriber的对象类型标识符。查询条件是 SourceObjectID=‘Subscriber’,返回了父对象Subscriber的所有关联关系,关联关系可以包括父对象和子对象(即Subscriber-Offer)之间的关系列表。
步骤305:数据处理装置遍历父对象和子对象之间关系列表,对于每一对父对象实例和子对象实例之间的关系,获取子对象的对象类型标识符,基于子对象的对象类型标识符从父对象实例中获取所有子对象实例列表。
例如:对于Subscriber-Offer关系列表,由于存在10个子对象实例Offer,因此Subscriber-Offer之间的存在10对父对象和子对象之间关系。获取子对象的对象类型标识符Offer,基于父对象实例执行获取其所有子对象实例的操作,这样就分别获取到对象类型为Offer的10个子对象实例列表。
步骤306:数据处理装置根据获取到的各个子对象实例列表,分别遍历各个子对象实例列表,为每对父对象实例和子对象实例生成一个关系索引。表5为两条关系索引的示例。
父对象类型标识符 父对象实例标识符 子对象类型标识符 子对象实例标识符
Subscriber 111111 Offer 200001
Subscriber 111111 Offer 200002
表5
对于每个子对象实例都是按照上述过程进行处理,直到每一对父对象和子对象的关系索引都生成。
步骤307:数据处理装置基于根对象的所有关系索引,生成最终的关系索引记录,包括根对象类型标识符、根对象实例标识符和关系数据。下面以表6为例来说明关系索引记录。
Figure PCTCN2018105875-appb-000002
表6
下面接着介绍数据处理装置开始第一个事务,并将数据记录写入到数据库和索引记录写入到缓存装置。
步骤308:数据处理装置向数据库批量写入级联对象的多条数据记录,向数据库写入数据记录可以理解为将数据记录插入到数据库的数据表中。例如:表6所示,写入对象类型标识符为subscriber和对象实例标识符为11111的记录,以及对象类型标识符为offer和和对象实例标识符为20001的数据记录。
对象类型标识符 对象实例标识符 Value0 Value1…
Subscriber 111111    
Offer 200001    
表7
步骤309:数据处理装置将前面各个步骤生成的字段索引和关系索引等索引记录以及索引记录的操作项写入到缓存装置中,操作项可以包括插入(insert)、删除(delete)和更 新(update)等,并按这些操作项发生的时间先后顺序分别写到缓存装置中。
在缓存装置缓存的关系索引记录可以如表8所示。此处由于是新增对象,所以操作项为insert。
Figure PCTCN2018105875-appb-000003
表8
在缓存装置缓存的字段索引记录可以如表9所示。此处由于是新增对象,所以是insert操作:
Figure PCTCN2018105875-appb-000004
表9
数据处理装置在数据记录写入到数据库和索引记录写入到缓存装置均完成后,结束第一个事务。
索引持久化装置启动定时任务,在预定的时间到达时,启动第二个事务,并将缓存装置中的索引记录写入到数据库中。下面具体介绍索引持久化装置将缓存装置的索引记录写入到数据库的过程。
步骤310:索引持久化装置定时扫描缓存装置中缓存的待更新的索引记录,按时间顺序获取索引记录。
步骤311:索引持久化装置从索引记录中获取操作项,结合索引记录的生成数据库操作语句,索引持久化装置向数据库发送数据库操作语句。例如:数据库操作语句为sql语句,操作类型为insert则生成insert sql语句,操作类型为delete则生成delete sql语句,操作类型为update则生成update sql语句。具体的一个例子:插入关系索引记录的SQL语句示例:insert into relationship(‘Subscriber’,‘111111’,‘(…),(…)’)。
步骤312:数据库接收到索引持久化装置的数据库操作语句,执行相关数据库操作处理,从而实现了对索引记录的数据库操作。
在写宽表数据记录时分成两个阶段,在第一个阶段,将数据记录插入到数据库、将索引记录缓存在缓存装置;在第二个阶段,通过定时任务定时批量从缓存装置将索引记录同步到数据库。从而实现大宽表的高性能写库。另外,在生成关系记录时,现有方案是两个对象间存在关系就会生成一条关系记录,导致关系记录数量庞大。本发明实施例通过将关系记录合并,只保留一条根对象的关系记录,从而提升关系索引的增加,查询或者删除性能。
下面结合图4的流程图进一步介绍查询级联对象的流程。
步骤401:数据处理装置接收业务软件发送的级联对象的数据查询请求,并执行该查询操作,该数据查询请求包含的查询条件为根对象类型标识符和字段标识符。例如:该数据查询请求为具体如下SQL语句:select*from subscriber where SubscriberId=‘xxx’,这里的根对象为Subscriber,可以根据该SQL语句查询到根对象subscriber及根对象的关联子对象Offer,下面继续介绍更加详细的查询过程。
步骤402:数据处理装置根据对象类型标识符和字段标识符查询字段元数据,获取该对 字段的索引类型。例如以对象类型标识符subscriber和字段标识符SubscriberId查询字段元数据,确定该字段的索引类型。数据处理装置生成索引查询请求,索引查询请求中包括对象类型标识符、字段标识符和该字段值,假设这里的字段值为subscriberID=xxx。如果该索引类型是唯一索引,则执行步骤403。如果该索引类型是非唯一索引,则跳转步骤408。
步骤403:数据处理装置向缓存装置发送索引查询请求。
步骤404:缓存装置接收到数据处理装置发送的索引查询请求,根据对象类型标识符、字段标识符和该字段值查询缓存的索引记录,并返回索引查询响应。
如果缓存的索引记录包含了该字段值,则缓存装置向数据处理装置返回的索引响应包含了该字段值对应的对象实例标识符。如果缓存的索引记录没有包含该字段,则缓存装置向数据处理装置返回的索引查询响应,该索引查询响应没有包含该字段值对应的对象实例标识符,例如:索引查询响应可以为空,或者索引查询响应包含表示查询不到该字段值的指示或标识等。
步骤405:数据处理装置接收到缓存装置发送的索引查询响应,数据处理装置判断索引查询响应是否包含对象实例标识符,如果索引查询响应包含了对象实例标识符,则跳转步骤411。如果索引查询响应没有包含对象实例标识符,数据处理装置向数据库发送索引查询请求。
步骤406:数据库接收到该索引查询请求,根据该字段值查询存储的索引记录,并向数据处理装置返回索引查询响应。
步骤407:数据处理装置接收到数据库发送的索引查询响应,数据处理装置判断索引查询响应是否包含对象实例标识符,如果索引查询响应包含了对象实例标识符,则跳转步骤411。如果索引查询响应没有包含对象实例标识符,数据处理装置确认该次查询失败。
步骤408:数据处理装置分别向缓存装置和数据库发送索引查询请求。
步骤409:缓存装置和数据库分别接收到索引查询请求,缓存装置根据对象类型标识符、字段标识符和该字段值查询缓存的索引记录,并向数据处理装置返回索引查询响应。数据库根据对象类型标识符、字段标识符和该字段值查询存储的索引记录,并向数据处理装置返回索引查询响应。索引查询响应可能包含的内容和步骤404中介绍的索引查询响应可能包含的内容相同。
步骤410:数据处理装置分别接收到缓存装置和数据库发送的索引查询响应,数据处理装置判断索引查询响应是否包含对象实例标识符,如果索引查询响应包含了对象实例标识符,获取索引查询响应包含的对象实例标识符,多条对象实例标识符结果集形成对象实例标识符结果集,该结果集包含多条对象类型标识符,并跳转至步骤411。如果索引查询响应没有包含对象实例标识符,则查询失败。
步骤411:数据处理装置基于对象实例标识符或者对象实例标识符集包含的对象实例标识符查询关系元数据,判断该父对象是否具有关联子对象,如果判断该父对象具有关联子对象,跳转步骤412,如果该对象没有关联子对象,则跳转步骤414。
步骤412:数据处理装置向缓存装置发送关系查询请求查询关系数据,所述关系查询请求包含根对象的对象类型标识符和根对象的对象实例标识符。
步骤413:数据处理装置接收缓存装置发送的关系查询响应;当关系查询响应包含关系数据,获取所述关系数据;当关系查询响应没有关系数据,向数据库发送关系查询请求查询关系数据,接收数据库发送的关系查询响应,获取关系数据。
步骤414:数据处理装置基于关系数据获取所有相关的子对象的对象实例标识符,形成对象实例标识符列表。并基于对象实例标识符列表进行数据库的数据查询操作,例如:向数据库发送SQL查询语句。例如:该SQL的查询语句可以为:
Select*from data_table where guid in(‘111111’,’200001’,’200002’…)
步骤415:数据库受理数据处理装置的数据查询操作,获得对象的数据记录集,并向数据库返回数据查询结果,该数据查询结果包含对象的数据记录集。
步骤416:数据处理装置接收数据查询结果,根据每个数据记录及其对象实例标识符,将数据记录转换成对象;并根据关系数据中的关系索引设置对象间的关系,形成最终的级联对象的数据记录。
下面进一步介绍删除级联对象的流程
步骤501:数据处理装置执行由业软软件发起的级联对象的删除操作请求,该删除操作请求包含根对象的对象类型标识符和字段标识符。例如删除Subscriber及其关联对象OfferInst,删除条件为SubscriberId=‘xxx’。
步骤502-513,同查询过程的402-413。
步骤514:数据处理装置基于关系数据获取所有相关的子对象的对象实例标识符,形成对象实例标识符列表。并基于对象实例标识符列表生成数据删除请求,向数据库和缓存模块分别发送该数据删除请求。例如:该数据删除请求的SQL语句可以为:
数据操作模块基于对象实例标识符列表生成数据的SQL删除请求可以为:
delete*from data_table where guid in(‘111111’,‘200001’,‘200002’…)
步骤515:缓存装置和数据库分别受理数据删除操作,删除相应数据和关系索引和字段索引,并向数据处理装置返回删除结果。
下面进一步介绍缓存异常时的索引记录恢复。
步骤601:业务软件或索引持久化装置访问缓存装置异常时,将向索引异常处理装置发送异常通知。
步骤602:索引异常处理装置接收到异常通知后,向索引持久化装置查询最后已入库索引记录缓存的生成时间,根据该生成时间确定数据恢复时间点,数据恢复时间点具体可以为该生成时间减去一个时间间隔(例如1分钟)。
步骤603:索引异常处理装置以该数据恢复时间点查询数据库的数据表,获取需要恢复的数据记录集,需要恢复的数据记录集为该数据恢复时间点之后存储的数据记录。
步骤604:索引异常处理装置从数据记录集获取对象实例标识符列表,向数据库发出索引删除请求,该索引删除请求包含对象实例标识符列表。
步骤605:数据库接收到索引删除请求,删除对象实例标识符列表中所有对象实例标识符对应的索引记录。
步骤606:索引异常处理装置根据对象实例标识符列表,获取每个对象实例的字段元数据和关系元数据,并根据字段元数据对每个无删除标记的数据记录生成字段索引,根据关系元数据对于级联对象的数据记录生成关系索引。
步骤607:索引异常处理装置将唯一索引、非唯一索引或者关系索引分别写入到数据库中的唯一索引表、非唯一索引表、关系索引表。
通过本实施例提供的方法,可以实现索引异常时的数据恢复和索引恢复,保证了数据库 的数据的一致性。
在图3-6所示的实施例中,数据处理装置的动作可以由数据处理装置根据上述提及的存储器中的软件模块来执行。缓存装置的动作可以由缓存装置根据上述提及的存储器中的软件模块来执行。索引持久化装置的动作可以由索引持久化装置根据上述提及的存储器中的软件模块来执行。索引异常处理装置的动作可以由索引异常处理装置根据上述提及的存储器中的软件模块来执行。本申请实施例对此不作任何限制。
上述主要从各个网元之间交互的角度对本发明实施例提供的方案进行了介绍。可以理解的是,上述实现编排设备或网络功能管理设备的设备为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,本发明能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本发明的范围。
本发明实施例可以根据上述方法示例对编排设备或网络功能管理设备进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个处理模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本发明实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。
比如,在采用对应各个功能划分各个功能模块的情况下,图7示出了上述实施例中所涉及的一种实现数据处理装置可能的结构示意图,该装置700包括:接收单元701,生成单元703、数据库处理单元705和缓存处理单元707。
接收单元701,用于接收业务软件发送的数据插入请求,所述数据插入请求包含数据记录,所述数据记录包含对象类型标识符、字段值、字段标识符和对象实例标识符;
生成单元703,用于根据所述对象类型标识符、所述字段值和所述对象实例标识符,生成字段索引;
生成单元703,还用于根据所述对象类型标识符,生成关系索引;
数据库处理单元705,用于向数据库写入所述数据记录;
缓存处理单元707,用于向缓存装置缓存所述索引记录以及索引记录的操作项,所述索引记录包含所述关系索引和字段索引。
在一种可能的实现方式中,该生成单元703,具体用于:根据所述对象类型标识符,获取字段元数据,根据所述字段元数据、所述字段值和所述对象实例标识符,生成字段索引,所述字段索引包括唯一索引或非唯一索引。
在另一种可能的实现方式中,该生成单元703,具体用于:用于根据所述对象类型标识符,获取关系元数据,所述关系元数据包括父对象和子对象之间的关系,其中所述父对象和子对象之间的关系包括父对象的对象类型标识符、子对象的对象类型标识符、父对象关联的字段标识符和子对象关联的字段标识符;从所述关系元数据中获取所述父对象和子对象之间的关系,以及所述子对象的对象类型标识符;根据所述子对象的对象类型标识符从父对象实例中获取所有子对象实例列表;遍历各个子对象实例列表,为每对父对象实例和子对象实例 生成一个关系索引;基于父对象的所有关系索引,生成关系索引记录,所述关系索引记录包括父对象类型标识符、父对象实例标识符和所述父对象的所有关系索引。
在另一种可能的实现方式中,该缓存处理单元707,具体用于按照索引记录的操作项发生的时间先后顺序分别将所述索引记录以及索引记录的操作项缓存到所述缓存装置中。
在另一种可能的实现方式中,接收单元701,还用于接收所述业务软件发生的数据操作请求,所述数据操作请求包含对象类型标识符、字段值和字段标识符;该装置还包括获取单元709,用于根据所述对象类型标识符和字段标识符,获取所述关系数据,其中所述关系数据包括父对象相关联所有子对象的对象实例标识符;获取单元709,还用于根据所述关系数据,获取对象实例标识符列表,其中所述对象实例标识符列表包括所述关系数据中的父对象关联的所有子对象的对象实例标识;数据库处理单元707,还用于根据所述对象实例标识符列表进行数据库的数据操作。
在另一种可能的实现方式中,该获取单元709具体用于:根据所述对象类型标识符和所述字段标识符查询字段元数据,确定字段索引为唯一索引或非唯一索引,生成索引查询请求,所述索引查询请求中包括所述对象类型标识符、所述字段标识符和所述字段值;当所述字段索引是唯一索引,向所述缓存装置发送所述索引查询请求,接收所述缓存装置返回的第一索引查询响应,判断所述第一索引查询响应是否包含所述对象实例标识符;如果所述第一索引查询响应包含所述对象实例标识符,则获取关系数据;如果所述第一索引查询响应没有包含所述对象实例标识符,向所述数据库发送所述索引查询请求;接收所述数据库发送的第二索引查询响应,确定所述第二索引查询响应包含所述对象实例标识符,则获取所述关系数据;当所述字段索引是非唯一索引,分别向所述缓存装置和所述数据库发送索引查询请求;分别接收所述缓存装置发送的第三索引查询响应和接收所述数据库发送的第四索引查询响应;分别获取所述第三索引查询响应包含的对象实例标识符和所述第四索引查询响应包含的对象实例标识符,以及形成对象实例标识符结果集,其中,所述对象实例标识符结果集包含所述第三索引查询响应包含的对象实例标识符和所述第四索引查询响应包含的对象实例标识符,获取所述关系数据。
在另一种可能的实现方式中,该获取单元709,还用于:基于所述对象实例标识符或者所述对象实例标识符集包含的对象实例标识符查询关系元数据,确定所述对象实例标识符对应的对象具有关联子对象,向所述缓存装置发送关系查询请求查询关系数据,接收所述缓存装置发送的第一关系查询响应;当所述第一关系查询响应包含关系数据,获取所述关系数据;当所述关系查询响应没有关系数据,向所述数据库发送关系查询请求查询关系数据,接收所述数据库发送的第二关系查询响应,从所述第二关系查询响应中获取所述关系数据。
在另一种可能的实现方式中,该数据库处理单元707,还用于当所述数据操作请求具体为数据查询请求,根据所述对象实例标识符列表,从所述数据库获取所述对象实例标识符列表中所有对象实例的数据记录集。
在另一种可能的实现方式中,该数据库处理单元707,还用于当所述数据操作请求具体为数据删除请求,基于所述对象实例标识符列表,分别删除所述数据库和所述缓存装置中所述对象实例标识符列表中所有对象实例的索引记录。
其中,上述方法实施例涉及的各步骤的所有相关内容均可以援引到对应功能模块的功能描述,在此不再赘述。
在本实施例中,该实现数据处理的装置以对应各个功能划分各个功能模块的形式来呈 现,或者,该实现数据处理的装置以采用集成的方式划分各个功能模块的形式来呈现。这里的“模块”可以指特定应用集成电路(application-specific integrated circuit,ASIC),电路,执行一个或多个软件或固件程序的处理器和存储器,集成逻辑电路,和/或其他可以提供上述功能的器件。在一个简单的实施例中,本领域的技术人员可以想到实现数据处理的装置700可以采用图2所示的形式。比如,图7中的接收单元701,生成单元703,缓存处理单元705和数据处理单元707或获取单元709可以通过图2的处理器21(和/或处理器28)和存储器23来实现,具体的,接收单元701,生成单元703,缓存处理单元705和数据处理单元707或获取单元709可以通过由处理器21(和/或处理器28)来调用存储器23中存储的应用程序代码来执行,本发明实施例对此不作任何限制。
图8示出了上述实施例中所涉及的一种数据处理系统,该系统包括:数据处理装置801和缓存装置802,
数据处理装置801,用于接收业务软件发送的数据插入请求,所述数据插入请求包含数据记录,所述数据记录包含对象类型标识符、字段值、字段标识符和对象实例标识符;根据所述对象类型标识符、所述字段值和所述对象实例标识符,生成字段索引;根据所述对象类型标识符,生成关系索引;向数据库写入所述数据记录;向缓存装置缓存所述索引记录以及索引记录的操作项,所述索引记录包含所述关系索引和字段索引;
所述缓存装置802,用于缓存所述索引记录以及索引记录的操作项。
在一种具体实现中,还包括:索引持久化装置803,用于在预定的时间到达时,将所述缓存装置中的所述索引记录以及索引记录的操作项写入到所述数据库中。
在一种具体实现中,索引持久化装置803,具体用于按照操作项发生的时间先后顺序,获取缓存装置中存储的所述索引记录以及所述索引记录的操作项;根据所述索引记录以及所述索引记录的操作项,生成数据库操作语句,向所述数据库发送数据库操作语句。
在一种具体实现中,还包括:索引异常处理装置804,用于接收到异常通知后,向所述索引持久化装置查询最后已入库索引记录缓存的生成时间,根据该生成时间确定数据恢复时间点;根据所述数据恢复时间点查询所述数据库的数据表,获取需要恢复的数据记录集,其中,所述需要恢复的数据记录集为所述数据恢复时间点之后存储的数据记录;从所述数据记录集获取对象实例标识符列表,向所述数据库发出索引删除请求,所述索引删除请求包含对所述象实例标识符列表;根据所述对象实例标识符列表,获取每个对象实例的字段元数据和关系元数据,并根据所述字段元数据对每个无删除标记的数据记录生成字段索引,根据所述关系元数据生成关系索引;并将所述字段索引和所述关系索引分别写入到数据库中。
上述方法实施例涉及的各步骤的所有相关内容均可以援引到该系统中各设备,在此不再赘述。
本发明实施例还提供了一种计算机存储介质,用于储存为上述图3-6所示的实现数据处理的装置所用的计算机软件指令,其包含用于执行上述方法实施例所设计的程序代码。通过执行存储的程序代码,可以提高宽表的数据处理性能。
本发明实施例还提供了计算机程序产品。该计算机程序产品包括计算机软件指令,该计算机软件指令可通过处理器进行加载来实现上述方法实施例中的方法。
尽管在此结合各实施例对本发明进行了描述,然而,在实施所要求保护的本发明过程中,本领域技术人员通过查看所述附图、公开内容、以及所附权利要求书,可理解并实现所述公开实施例的其他变化。在权利要求中,“包括”(comprising)一词不排除其他组成部分或 步骤,“一”或“一个”不排除多个的情况。单个处理器或其他单元可以实现权利要求中列举的若干项功能。相互不同的从属权利要求中记载了某些措施,但这并不表示这些措施不能组合起来产生良好的效果。
本领域技术人员应明白,本申请的实施例可提供为方法、装置(设备)、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式,这里将它们都统称为“模块”或“系统”。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。计算机程序存储/分布在合适的介质中,与其它硬件一起提供或作为硬件的一部分,也可以采用其他分布形式,如通过Internet或其它有线或无线电信系统。
本申请是参照本发明实施例的方法、装置(设备)和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管结合具体特征及其实施例对本发明进行了描述,显而易见的,在不脱离本发明的精神和范围的情况下,可对其进行各种修改和组合。相应地,本说明书和附图仅仅是所附权利要求所界定的本发明的示例性说明,且视为已覆盖本发明范围内的任意和所有修改、变化、组合或等同物。显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。

Claims (26)

  1. 一种数据处理方法,其特征在于,包括:
    接收业务软件发送的数据插入请求,所述数据插入请求包含数据记录,所述数据记录包含对象类型标识符、字段值、字段标识符和对象实例标识符;
    根据所述对象类型标识符、所述字段值和所述对象实例标识符,生成字段索引;
    根据所述对象类型标识符,生成关系索引;
    向数据库写入所述数据记录;
    向缓存装置缓存所述索引记录以及索引记录的操作项,所述索引记录包含所述关系索引和字段索引。
  2. 如权利要求1所述的方法,其特征在于,所述根据所述对象类型标识符、所述字段值和所述对象实例标识符,生成字段索引,具体包括:
    根据所述对象类型标识符,获取字段元数据;
    根据所述字段元数据、所述字段值和所述对象实例标识符,生成字段索引,所述字段索引包括唯一索引或非唯一索引。
  3. 如权利要求1所述的方法,其特征在于,所述根据所述对象类型标识符,生成关系索引,具体包括:
    根据所述对象类型标识符,获取关系元数据,所述关系元数据包括父对象和子对象之间的关系,其中所述父对象和子对象之间的关系包括父对象的对象类型标识符、子对象的对象类型标识符、父对象关联的字段标识符和子对象关联的字段标识符;
    从所述关系元数据中获取所述父对象和子对象之间的关系,以及所述子对象的对象类型标识符;
    根据所述子对象的对象类型标识符从父对象实例中获取所有子对象实例列表;
    遍历各个子对象实例列表,为每对父对象实例和子对象实例生成一个关系索引;
    基于父对象的所有关系索引,生成关系索引记录,所述关系索引记录包括父对象类型标识符、父对象实例标识符和所述父对象的所有关系索引。
  4. 如权利要求1所述的方法,其特征在于,所述索引记录的操作项包括包括插入、删除和更新中的一个或多个。
  5. 如权利要求1所述的方法,其特征在于,向缓存装置缓存所述索引记录以及索引记录的操作项,包括:
    按照索引记录的操作项发生的时间先后顺序分别将所述索引记录以及索引记录的操作项缓存到所述缓存装置中。
  6. 如权利要求5所述的方法,其特征在于,还包括:在预定的时间到达时,索引持久化装置将所述缓存装置中的所述索引记录以及索引记录的操作项写入到所述数据库中。
  7. 如权利要求6所述的方法,其特征在于,所述索引持久化装置将缓存装置中的所述索引记录以及索引记录的操作项写入到所述数据库中,包括:
    所述索引持久化装置按照操作项发生的时间先后顺序,获取缓存装置中存储的所述索引记录以及所述索引记录的操作项;
    所述索引持久化装置根据所述索引记录以及所述索引记录的操作项,生成数据库操作语句,向所述数据库发送数据库操作语句。
  8. 如权利要求1所述的方法,其特征在于,还包括:接收所述业务软件发生的数据操作 请求,所述数据操作请求包含对象类型标识符、字段值和字段标识符;
    根据所述对象类型标识符和字段标识符,获取所述关系数据,其中所述关系数据包括父对象相关联所有子对象的对象实例标识符;
    根据所述关系数据,获取对象实例标识符列表,其中,所述对象实例标识符列表包含所述关系数据中的父对象关联的所有子对象的对象实例标识;
    根据所述对象实例标识符列表进行数据库的数据操作。
  9. 如权利要求8所述的方法,其特征在于,所述根据所述对象类型标识符和字段标识符,获取所述关系数据,包括:
    根据所述对象类型标识符和所述字段标识符查询字段元数据,确定字段索引为唯一索引或非唯一索引,生成索引查询请求,所述索引查询请求中包括所述对象类型标识符、所述字段标识符和所述字段值;
    当所述字段索引是唯一索引,向所述缓存装置发送所述索引查询请求,接收所述缓存装置返回的第一索引查询响应,判断所述第一索引查询响应是否包含所述对象实例标识符;如果所述第一索引查询响应包含所述对象实例标识符,则获取关系数据;如果所述第一索引查询响应没有包含所述对象实例标识符,向所述数据库发送所述索引查询请求;接收所述数据库发送的第二索引查询响应,确定所述第二索引查询响应包含所述对象实例标识符,则获取所述关系数据;
    当所述字段索引是非唯一索引,分别向所述缓存装置和所述数据库发送索引查询请求;分别接收所述缓存装置发送的第三索引查询响应和接收所述数据库发送的第四索引查询响应;分别获取所述第三索引查询响应包含的对象实例标识符和所述第四索引查询响应包含的对象实例标识符,以及形成对象实例标识符结果集,其中,所述对象实例标识符结果集包含所述第三索引查询响应包含的对象实例标识符和所述第四索引查询响应包含的对象实例标识符,获取所述关系数据。
  10. 如权利要求9所述的方法,其特征在于,所述获取关系数据,包括:
    基于所述对象实例标识符或者所述对象实例标识符集包含的对象实例标识符查询关系元数据,确定所述对象实例标识符对应的对象具有关联子对象,向所述缓存装置发送关系查询请求查询关系数据,接收所述缓存装置发送的第一关系查询响应;
    当所述第一关系查询响应包含关系数据,获取所述关系数据;
    当所述第一关系查询响应没有关系数据,向所述数据库发送关系查询请求查询关系数据,接收所述数据库发送的第二关系查询响应,从所述第二关系查询响应中获取所述关系数据。
  11. 如权利要求8所述的方法,其特征在于,所述数据操作请求具体为数据查询请求,还包括:
    根据所述对象实例标识符列表,从所述数据库获取所述对象实例标识符列表中所有对象实例的数据记录集。
  12. 如权利要求8所述的方法,其特征在于,当所述数据操作请求具体为数据删除请求,还包括:
    基于所述对象实例标识符列表,分别删除所述数据库和缓存装置中所述对象实例标识符列表中所有对象实例的索引记录。
  13. 一种数据处理装置,其特征在于,包括:
    接收单元,用于接收业务软件发送的数据插入请求,所述数据插入请求包含数据记录,所述数据记录包含对象类型标识符、字段值、字段标识符和对象实例标识符;
    生成单元,用于根据所述对象类型标识符、所述字段值和所述对象实例标识符,生成字段索引;
    所述生成单元,还用于根据所述对象类型标识符,生成关系索引;
    数据库处理单元,用于向数据库写入所述数据记录;
    缓存处理单元,用于向缓存装置缓存所述索引记录以及索引记录的操作项,所述索引记录包含所述关系索引和字段索引。
  14. 如权利要求13所述的装置,其特征在于,所述生成单元具体用于根据所述对象类型标识符,获取字段元数据,根据所述字段元数据、所述字段值和所述对象实例标识符,生成字段索引,所述字段索引包括唯一索引或非唯一索引。
  15. 如权利要求13所述的装置,其特征在于,所述生成单元具体用于根据所述对象类型标识符,获取关系元数据,所述关系元数据包括父对象和子对象之间的关系,其中所述父对象和子对象之间的关系包括父对象的对象类型标识符、子对象的对象类型标识符、父对象关联的字段标识符和子对象关联的字段标识符;从所述关系元数据中获取所述父对象和子对象之间的关系,以及所述子对象的对象类型标识符;根据所述子对象的对象类型标识符从父对象实例中获取所有子对象实例列表;遍历各个子对象实例列表,为每对父对象实例和子对象实例生成一个关系索引;基于父对象的所有关系索引,生成关系索引记录,所述关系索引记录包括父对象类型标识符、父对象实例标识符和所述父对象的所有关系索引。
  16. 如权利要求13所述的装置,其特征在于,所述缓存处理单元具体用于按照索引记录的操作项发生的时间先后顺序分别将所述索引记录以及索引记录的操作项缓存到所述缓存装置中。
  17. 如权利要求13所述的装置,其特征在于,还包括获取单元,其中,
    所述接收单元,还用于接收所述业务软件发生的数据操作请求,所述数据操作请求包含对象类型标识符、字段值和字段标识符;
    获取单元,用于根据所述对象类型标识符和字段标识符,获取所述关系数据,其中所述关系数据包括父对象相关联所有子对象的对象实例标识符;
    所述获取单元,还用于根据所述关系数据,获取对象实例标识符列表,其中所述对象实例标识符列表包括所述关系数据中的父对象关联的所有子对象的对象实例标识;
    所述数据库处理单元,还用于根据所述对象实例标识符列表进行数据库的数据操作。
  18. 如权利要求17所述的装置,其特征在于,所述获取单元具体用于根据所述对象类型标识符和所述字段标识符查询字段元数据,确定字段索引为唯一索引或非唯一索引,生成索引查询请求,所述索引查询请求中包括所述对象类型标识符、所述字段标识符和所述字段值;当所述字段索引是唯一索引,向所述缓存装置发送所述索引查询请求,接收所述缓存装置返回的第一索引查询响应,判断所述第一索引查询响应是否包含所述对象实例标识符;如果所述第一索引查询响应包含所述对象实例标识符,则获取关系数据;如果所述第一索引查询响应没有包含所述对象实例标识符,向所述数据库发送所述索引查询请求;接收所述数据库发送的第二索引查询响应,确定所述第二索引查询响应包含所述对象实例标识符,则获取所述关系数据;当所述字段索引是非唯一索引,分别向所述缓存装置和所述数据库发送索引查询请求;分别接收所述缓存装置发送的第三索引查询响应和接收所述数据库发送的第四索引查询响应;分别获取所述第三索引查询响应包含的对象实例标识符和所述第四索引查询响应包 含的对象实例标识符,以及形成对象实例标识符结果集,其中,所述对象实例标识符结果集包含所述第三索引查询响应包含的对象实例标识符和所述第四索引查询响应包含的对象实例标识符,获取所述关系数据。
  19. 如权利要求18所述的装置,其特征在于,所述获取单元,还用于基于所述对象实例标识符或者所述对象实例标识符集包含的对象实例标识符查询关系元数据,确定所述对象实例标识符对应的对象具有关联子对象,向所述缓存装置发送关系查询请求查询关系数据,接收所述缓存装置发送的第一关系查询响应;当所述第一关系查询响应包含关系数据,获取所述关系数据;当所述关系查询响应没有关系数据,向所述数据库发送关系查询请求查询关系数据,接收所述数据库发送的第二关系查询响应,从所述第二关系查询响应中获取所述关系数据。
  20. 如权利要求17所述的装置,其特征在于,所述数据库处理单元,还用于当所述数据操作请求具体为数据查询请求,根据所述对象实例标识符列表,从所述数据库获取所述对象实例标识符列表中所有对象实例的数据记录集。
  21. 如权利要求17所述的装置,其特征在于,所述数据库处理单元,还用于当所述数据操作请求具体为数据删除请求,基于所述对象实例标识符列表,分别删除所述数据库和所述缓存装置中所述对象实例标识符列表中所有对象实例的索引记录。
  22. 一种数据处理系统,其特征在于,包括:数据处理装置和缓存装置:
    所述数据处理装置,用于接收业务软件发送的数据插入请求,所述数据插入请求包含数据记录,所述数据记录包含对象类型标识符、字段值、字段标识符和对象实例标识符;根据所述对象类型标识符、所述字段值和所述对象实例标识符,生成字段索引;根据所述对象类型标识符,生成关系索引;向数据库写入所述数据记录;向缓存装置缓存所述索引记录以及索引记录的操作项,所述索引记录包含所述关系索引和字段索引;
    所述缓存装置,用于缓存所述索引记录以及索引记录的操作项。
  23. 如权利要求22所述的系统,其特征在于,还包括:索引持久化装置,用于在预定的时间到达时,将所述缓存装置中的所述索引记录以及索引记录的操作项写入到所述数据库中。
  24. 如权利要求23所述的系统,其特征在于,所述索引持久化装置,具体用于按照操作项发生的时间先后顺序,获取缓存装置中存储的所述索引记录以及所述索引记录的操作项;根据所述索引记录以及所述索引记录的操作项,生成数据库操作语句,向所述数据库发送数据库操作语句。
  25. 如权利要求24所述的系统,其特征在于,还包括:索引异常处理装置,用于接收到异常通知后,向所述索引持久化装置查询最后已入库索引记录缓存的生成时间,根据该生成时间确定数据恢复时间点;根据所述数据恢复时间点查询所述数据库的数据表,获取需要恢复的数据记录集,其中,所述需要恢复的数据记录集为所述数据恢复时间点之后存储的数据记录;从所述数据记录集获取对象实例标识符列表,向所述数据库发出索引删除请求,所述索引删除请求包含对所述象实例标识符列表;根据所述对象实例标识符列表,获取每个对象实例的字段元数据和关系元数据,并根据所述字段元数据对每个无删除标记的数据记录生成字段索引,根据所述关系元数据生成关系索引;并将所述字段索引和所述关系索引分别写入到数据库中。
  26. 一种计算机可读存储介质,所述计算机可读存储介质中存储有指令,所述指令用于执行权利要求1-12任一所述的方法。
PCT/CN2018/105875 2017-12-29 2018-09-15 数据处理方法、装置和系统 Ceased WO2019128318A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
EP18895630.4A EP3716090A4 (en) 2017-12-29 2018-09-15 DATA PROCESSING PROCESS, APPARATUS AND SYSTEM
US16/913,600 US11550769B2 (en) 2017-12-29 2020-06-26 Data processing method, apparatus, and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201711487277.1 2017-12-29
CN201711487277.1A CN108228817B (zh) 2017-12-29 2017-12-29 数据处理方法、装置和系统

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US16/913,600 Continuation US11550769B2 (en) 2017-12-29 2020-06-26 Data processing method, apparatus, and system

Publications (1)

Publication Number Publication Date
WO2019128318A1 true WO2019128318A1 (zh) 2019-07-04

Family

ID=62646446

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/105875 Ceased WO2019128318A1 (zh) 2017-12-29 2018-09-15 数据处理方法、装置和系统

Country Status (4)

Country Link
US (1) US11550769B2 (zh)
EP (1) EP3716090A4 (zh)
CN (1) CN108228817B (zh)
WO (1) WO2019128318A1 (zh)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110675054A (zh) * 2019-09-23 2020-01-10 金蝶蝶金云计算有限公司 一种erp系统中数据处理方法、数据处理系统及相关设备
CN111753028A (zh) * 2020-07-02 2020-10-09 上海达梦数据库有限公司 数据传输方法、装置、设备及存储介质
CN112364018A (zh) * 2020-11-02 2021-02-12 上海钐昆网络科技有限公司 一种生成宽表的方法、装置、设备及存储介质
CN112417043A (zh) * 2020-11-19 2021-02-26 百果园技术(新加坡)有限公司 数据处理系统及方法
CN112486979A (zh) * 2019-09-12 2021-03-12 阿里巴巴集团控股有限公司 数据处理方法、装置和系统、电子设备以及计算机可读存储介质
CN113282623A (zh) * 2021-05-20 2021-08-20 浙江网商银行股份有限公司 数据处理方法及装置
CN114625384A (zh) * 2022-03-10 2022-06-14 杭州海康威视数字技术股份有限公司 安装包生成方法、安装方法、装置、设备及存储介质
CN115114319A (zh) * 2022-06-15 2022-09-27 北京快乐茄信息技术有限公司 基于数据宽表进行数据查询的方法、装置及设备
CN115295164A (zh) * 2022-07-21 2022-11-04 泰康保险集团股份有限公司 医保数据的处理方法、装置、电子设备和存储介质
CN115794842A (zh) * 2022-11-02 2023-03-14 北京明朝万达科技股份有限公司 数据处理方法、装置、电子设备及介质
CN116561175A (zh) * 2022-01-29 2023-08-08 中银金融科技有限公司 数据查询方法及装置

Families Citing this family (31)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108228817B (zh) 2017-12-29 2021-12-03 华为技术有限公司 数据处理方法、装置和系统
CN110928867B (zh) * 2018-08-31 2022-09-20 杭州海康威视数字技术股份有限公司 一种数据融合的方法及装置
CN109032590B (zh) * 2018-09-26 2021-11-16 山东鲁能软件技术有限公司 一种可视化开发环境的配置方法、装置、终端及存储介质
CN109815213A (zh) * 2018-12-20 2019-05-28 武汉璞华大数据技术有限公司 一种Append-Only数据库上删除和修改数据的方法及系统
CN109739863B (zh) * 2019-01-22 2021-03-02 威胜集团有限公司 电能表数据管理方法
US11132368B2 (en) * 2019-02-21 2021-09-28 Oracle International Corporation Recursive data traversal model
CN111831878B (zh) * 2019-04-22 2023-09-15 百度在线网络技术(北京)有限公司 构建价值索引关系的方法、索引系统及索引装置
CN110263050B (zh) * 2019-05-06 2023-10-27 创新先进技术有限公司 数据处理方法、装置、设备及存储介质
CN110275901B (zh) * 2019-06-25 2021-08-24 北京创鑫旅程网络技术有限公司 一种缓存数据调取方法及装置
CN111008521B (zh) * 2019-12-06 2023-04-28 北京三快在线科技有限公司 生成宽表的方法、装置及计算机存储介质
CN111339100B (zh) * 2020-02-28 2023-05-26 中国工商银行股份有限公司 数据核对方法及装置
CN113672671B (zh) * 2020-05-15 2024-04-19 西安京迅递供应链科技有限公司 一种实现数据加工的方法和装置
CN114449244B (zh) * 2020-10-31 2023-07-18 华为技术有限公司 一种画质调整方法及装置
CN112506918B (zh) * 2020-11-03 2024-06-04 深圳市宏电技术股份有限公司 数据存取方法、终端及计算机可读存储介质
CN114546982B (zh) * 2020-11-27 2025-07-01 腾讯科技(深圳)有限公司 数据处理方法、装置、计算机可读介质及电子设备
CN112541834B (zh) * 2020-12-08 2022-11-15 南方电网调峰调频发电有限公司 水电工业数字对象的标识符处理方法、装置和系统
US12135798B2 (en) * 2020-12-17 2024-11-05 The Toronto-Dominion Bank Secure resolution of email-based queries involving confidential third-party data
CN112925808B (zh) * 2021-02-23 2023-08-15 上海哔哩哔哩科技有限公司 数据处理方法、装置及电子设备
CN114077606B (zh) * 2021-11-18 2025-04-15 京东科技信息技术有限公司 数据的处理方法、装置、计算机设备及存储介质
CN113918577B (zh) * 2021-12-15 2022-03-11 北京新唐思创教育科技有限公司 数据表识别方法、装置、电子设备及存储介质
US11941029B2 (en) 2022-02-03 2024-03-26 Bank Of America Corporation Automatic extension of database partitions
CN117425887A (zh) * 2022-05-18 2024-01-19 京东方科技集团股份有限公司 数据处理方法、装置、电子设备和计算机可读存储介质
CN115062023B (zh) * 2022-06-20 2025-12-09 平安科技(深圳)有限公司 宽表优化方法、装置、电子设备及计算机可读存储介质
CN115080624A (zh) * 2022-07-12 2022-09-20 小马国炬(玉溪)科技有限公司 一种表单数据填写方法、装置、设备及存储介质
CN115248832A (zh) * 2022-08-01 2022-10-28 中国银行股份有限公司 关联系统查找方法及装置
CN115422213A (zh) * 2022-08-23 2022-12-02 航天信息股份有限公司 一种数据更新的方法、装置及电子设备
CN115640296A (zh) * 2022-10-12 2023-01-24 中信百信银行股份有限公司 一种基于关系型数据库将缓存数据持久化的方法及系统
US12066978B2 (en) * 2022-12-30 2024-08-20 People.ai, Inc. Systems and methods for matching record objects to electronic activities using indexing
CN116186048B (zh) * 2023-03-09 2023-12-15 苏州异格技术有限公司 Fpga的元器件的数据处理方法、装置、电子设备
CN120030053A (zh) * 2023-11-21 2025-05-23 华为技术有限公司 数据查询方法、设备、集群以及可读存储介质
CN117743331B (zh) * 2023-12-12 2026-01-13 天翼云科技有限公司 支持高效访问的元数据存储方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2199935A2 (en) * 2008-12-18 2010-06-23 Sap Ag Method and system for dynamically partitioning very large database indices on write-once tables
CN103853727A (zh) * 2012-11-29 2014-06-11 深圳中兴力维技术有限公司 提高大数据量查询性能的方法及系统
CN104156396A (zh) * 2014-07-16 2014-11-19 成都康赛信息技术有限公司 大数据环境下提高数据库性能的方法及系统
CN105653720A (zh) * 2016-01-07 2016-06-08 北京人大金仓信息技术股份有限公司 一种可灵活配置的数据库分层存储优化方法
CN108228817A (zh) * 2017-12-29 2018-06-29 华为技术有限公司 数据处理方法、装置和系统

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6745189B2 (en) * 2000-06-05 2004-06-01 International Business Machines Corporation System and method for enabling multi-indexing of objects
US7092933B1 (en) * 2002-12-17 2006-08-15 Ncr Corporation Supporting user-defined datatypes
US20090043733A1 (en) * 2007-08-06 2009-02-12 Orchestral Developments Limited Systems and methods for efficiently storing, retrieving and querying data structures in a relational database system
US8122040B2 (en) * 2007-08-29 2012-02-21 Richard Banister Method of integrating remote databases by automated client scoping of update requests over a communications network
US9361346B2 (en) * 2009-04-14 2016-06-07 Oracle America, Inc. Mapping information stored in a LDAP tree structure to a relational database structure
US8606752B1 (en) * 2010-09-29 2013-12-10 Symantec Corporation Method and system of restoring items to a database while maintaining referential integrity
CN104216975A (zh) * 2014-08-29 2014-12-17 天津大学 面向大规模rdf数据的高效语义索引的构建方法
US10877956B2 (en) * 2015-11-24 2020-12-29 Sap Se Transactional cache invalidation for inter-node caching
CN106897335B (zh) * 2016-06-28 2020-11-27 创新先进技术有限公司 一种业务数据的存储方法、记录标识符的生成方法及装置
CN106484684B (zh) * 2016-10-11 2019-04-05 语联网(武汉)信息技术有限公司 一种对数据库中的数据进行术语匹配的方法
CN106599158A (zh) * 2016-12-07 2017-04-26 国家海洋局第二海洋研究所 基于时空双重近似索引的台风海域Argo资料的快速查询方法
US12298984B2 (en) * 2019-12-06 2025-05-13 William J. Ziebell Systems, methods, and media for identification, disambiguation, verification and for communicating knowledge

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2199935A2 (en) * 2008-12-18 2010-06-23 Sap Ag Method and system for dynamically partitioning very large database indices on write-once tables
CN103853727A (zh) * 2012-11-29 2014-06-11 深圳中兴力维技术有限公司 提高大数据量查询性能的方法及系统
CN104156396A (zh) * 2014-07-16 2014-11-19 成都康赛信息技术有限公司 大数据环境下提高数据库性能的方法及系统
CN105653720A (zh) * 2016-01-07 2016-06-08 北京人大金仓信息技术股份有限公司 一种可灵活配置的数据库分层存储优化方法
CN108228817A (zh) * 2017-12-29 2018-06-29 华为技术有限公司 数据处理方法、装置和系统

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3716090A4

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112486979A (zh) * 2019-09-12 2021-03-12 阿里巴巴集团控股有限公司 数据处理方法、装置和系统、电子设备以及计算机可读存储介质
CN112486979B (zh) * 2019-09-12 2023-12-22 阿里巴巴集团控股有限公司 数据处理方法、装置和系统、电子设备以及计算机可读存储介质
CN110675054A (zh) * 2019-09-23 2020-01-10 金蝶蝶金云计算有限公司 一种erp系统中数据处理方法、数据处理系统及相关设备
CN111753028A (zh) * 2020-07-02 2020-10-09 上海达梦数据库有限公司 数据传输方法、装置、设备及存储介质
CN111753028B (zh) * 2020-07-02 2023-08-25 上海达梦数据库有限公司 数据传输方法、装置、设备及存储介质
CN112364018A (zh) * 2020-11-02 2021-02-12 上海钐昆网络科技有限公司 一种生成宽表的方法、装置、设备及存储介质
CN112417043A (zh) * 2020-11-19 2021-02-26 百果园技术(新加坡)有限公司 数据处理系统及方法
CN113282623A (zh) * 2021-05-20 2021-08-20 浙江网商银行股份有限公司 数据处理方法及装置
CN116561175A (zh) * 2022-01-29 2023-08-08 中银金融科技有限公司 数据查询方法及装置
CN114625384A (zh) * 2022-03-10 2022-06-14 杭州海康威视数字技术股份有限公司 安装包生成方法、安装方法、装置、设备及存储介质
CN115114319A (zh) * 2022-06-15 2022-09-27 北京快乐茄信息技术有限公司 基于数据宽表进行数据查询的方法、装置及设备
CN115295164A (zh) * 2022-07-21 2022-11-04 泰康保险集团股份有限公司 医保数据的处理方法、装置、电子设备和存储介质
CN115794842A (zh) * 2022-11-02 2023-03-14 北京明朝万达科技股份有限公司 数据处理方法、装置、电子设备及介质
CN115794842B (zh) * 2022-11-02 2024-04-05 北京明朝万达科技股份有限公司 数据处理方法、装置、电子设备及介质

Also Published As

Publication number Publication date
US20200327107A1 (en) 2020-10-15
CN108228817B (zh) 2021-12-03
EP3716090A1 (en) 2020-09-30
EP3716090A4 (en) 2020-10-21
CN108228817A (zh) 2018-06-29
US11550769B2 (en) 2023-01-10

Similar Documents

Publication Publication Date Title
WO2019128318A1 (zh) 数据处理方法、装置和系统
US10872101B2 (en) Distributed database processing method and device
JP6266630B2 (ja) アーカイブされたリレーションを有する連続クエリの管理
US11030247B2 (en) Layered graph data structure
US10671604B2 (en) Using row value constructor (RVC) based queries to group records of a database for multi-thread execution
US10832309B2 (en) Inventory data model for large scale flash sales
WO2021184761A1 (zh) 数据访问方法和装置、数据存储方法和装置
US10762068B2 (en) Virtual columns to expose row specific details for query execution in column store databases
US12216798B2 (en) Centralized data transformation in a multi-tenant computing environment
CN106933891A (zh) 访问分布式数据库的方法和分布式数据服务的装置
RU2674886C2 (ru) Способ и устройство для определения плана исполнения sql
US11416476B2 (en) Event ordering based on an identifier for a transaction
CN116860700B (zh) 处理分布式文件系统中元数据的方法、装置、设备及介质
US10585896B2 (en) Managing data in relational database management system
US11669547B2 (en) Parallel data synchronization of hierarchical data
CN115374157A (zh) 数据查询方法、装置、电子设备以及存储介质
US11157508B2 (en) Estimating the number of distinct entities from a set of records of a database system
US8799329B2 (en) Asynchronously flattening graphs in relational stores
US11803568B1 (en) Replicating changes from a database to a destination and modifying replication capacity
US11886433B2 (en) Dynamic data batching for graph-based structures
US11816090B2 (en) Selectively processing an event published responsive to an operation on a database record that relates to consent
CN115794849A (zh) 一种基于树形模型的分布式数据的批量更新方法及装置
CN119248881A (zh) 一种多表数据同步方法、设备、介质及产品
US20190303507A1 (en) Database With Time-Dependent Graph Index

Legal Events

Date Code Title Description
NENP Non-entry into the national phase

Ref country code: DE

ENP Entry into the national phase

Ref document number: 2018895630

Country of ref document: EP

Effective date: 20200624

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

Ref document number: 18895630

Country of ref document: EP

Kind code of ref document: A1