Detailed Description
To make the objects, technical solutions and advantages of the present disclosure clearer, the present disclosure will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present disclosure, rather than all embodiments. All other embodiments, which can be derived by one of ordinary skill in the art from the embodiments disclosed herein without making any creative effort, shall fall within the scope of protection of the present disclosure.
The terminology used in the embodiments of the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in the disclosed embodiments and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise, and "a plurality" typically includes at least two.
It should be understood that the term "and/or" as used herein is merely one type of association that describes an associated object, meaning that three relationships may exist, e.g., a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
It should be understood that although the terms first, second, third, etc. may be used to describe technical names in embodiments of the present disclosure, the technical names should not be limited to the terms. These terms are only used to distinguish between technical names. For example, a first check signature may also be referred to as a second check signature, and similarly, a second check signature may also be referred to as a first check signature, without departing from the scope of embodiments of the present disclosure.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrases "if determined" or "if detected (a stated condition or event)" may be interpreted as "when determined" or "in response to a determination" or "when detected (a stated condition or event)" or "in response to a detection (a stated condition or event)", depending on the context.
It is also noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that an article or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such article or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in the article or device in which the element is included.
Alternative embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
A first embodiment, namely, an embodiment of a method of data processing, is provided for the present disclosure.
The embodiment of the present disclosure is described in detail below with reference to fig. 1, where fig. 1 is a flowchart of a method for processing data provided by the embodiment of the present disclosure.
Step S101, first query information is obtained.
Wherein the first query information includes virtual table identification information, query field information, a query value, and a constraint validation time threshold.
Typically, each record is stored horizontally in a data table. However, this storage method has a problem that the table structure is not flexible enough to be expanded. The disclosed embodiment provides a universal metadata table, the table structure of the metadata table is fixed, however, the contents of all the data tables are stored in the metadata table, and each record is stored in a longitudinal mode, i.e. a longitudinal record table.
When one of the metadata tables is operated, it is necessary to convert the record of the longitudinal record table into a horizontal storage manner, that is, a virtual table stored in the memory, then operate the virtual table, and write the content of the operation into the longitudinal record table corresponding to the metadata table.
That is, identification information in the metadata table representing the table being queried. For example, the table identification information 100 in the metadata table represents a person table, that is, the virtual table identification information is 100; by referring to the record in which all the table identification information in the metadata table is 100, a virtual table of a person table can be created.
The query field information may be a plurality of field information and corresponding query values.
And step S102, acquiring a longitudinal record table from the metadata table record according to the virtual table identification information.
Wherein the metadata table includes: table identification information, table horizontal record identification, table longitudinal field information, table longitudinal field values corresponding to the table longitudinal field information, table record effective time field information and table record effective time; the longitudinal record table comprises: the virtual table record system comprises a table horizontal record identifier corresponding to the table horizontal record identifier, virtual table vertical field information corresponding to the table vertical field information, a virtual table vertical field value corresponding to the table vertical field value, virtual table record effective time field information corresponding to the table record effective time field information and virtual table record effective time corresponding to the table record effective time.
Since each record information of the metadata table represents only one field information of one actual record, and one actual record is stored longitudinally in the metadata table, that is, a plurality of records in the metadata table constitute one actual record. And the metadata table can simultaneously store the information of different data tables in the metadata table or simultaneously store the information of different field lengths of the same data table in different periods. In order to distinguish which table each record belongs to, the embodiment of the present disclosure sets table identification information, and distinguishes the metadata table by different table identification information. The vertical field information and the field value of the actual record in the metadata table can be identified through the table horizontal record identification, and an actual record can be formed.
Table vertical field information indicates field information of one actual record.
The table record effective time field information indicates the time format and field name adopted by the time.
The table record effective time is a value of the table record effective time field information. When two identical objects are active at the same time, then the table record validation time indicates that one is currently in use, while the other will validate at a future table record validation time. For example, department information, one of which is information being used, and the other of which has a table record of the time of validity of 1 month and 1 day in 2050, indicates that the department information is automatically valid by 2050. Therefore, the information can be configured in a preset mode, and work pause caused by temporary configuration of object information is avoided.
Since records having the same table identification information in the metadata table are records in the same data table. Therefore, the record contents in the longitudinal record table are the contents of the same data table.
Step S103, generating each first horizontal record in the first virtual table according to the virtual table vertical field information with the same horizontal record identification in the vertical record table.
The first lateral recording comprising: a plurality of virtual table horizontal field values respectively associated with the virtual table vertical field values and a horizontal record validation time associated with the virtual table record validation time.
The first virtual table is a relational data table in which each piece of information is stored in a horizontal manner.
The purpose of this step is to convert the record value stored longitudinally in the metadata table into the normal horizontal storage mode of the relational data table. The first horizontal record is an actual record in the first virtual table.
Optionally, the generating each first horizontal record in the first virtual table according to the virtual table vertical field information having the same horizontal record identifier in the vertical record table includes the following steps:
step S103-1, generating each first horizontal record in the first virtual table according to the virtual table vertical field information, the virtual table vertical field value, the virtual table record effective time field information and the virtual table record effective time which have the same horizontal record identifier in the vertical record table.
And step S104, retrieving the first transverse record according to the query field information, the query value and the constraint effective time threshold value, and acquiring a first result.
Optionally, the metadata table further includes: table longitudinal field operation type and table longitudinal field operation time; the longitudinal record table further comprises: the virtual table longitudinal field operation type corresponding to the table longitudinal field operation type and the virtual table longitudinal field operation time corresponding to the table longitudinal field operation time; the longitudinal field operation type or the virtual table longitudinal field operation type comprises an adding type, a deleting type and a modifying type.
Generating each first horizontal record in the first virtual table according to the virtual table longitudinal field information, the virtual table longitudinal field value, the virtual table record effective time field information and the virtual table record effective time which have the same horizontal record identifier in the longitudinal record table, and further comprising the following steps:
step S103-1-1, generating each first horizontal record in the first virtual table according to the virtual table vertical field information, the virtual table vertical field value, the virtual table record effective time field information, the virtual table record effective time, the virtual table vertical field operation type and the virtual table vertical field operation time which have the same horizontal record identification in the vertical record table.
The operation type and the operation time of the virtual table longitudinal field are used in the step, so that the operation type information and the operation time of each field in the record can be obtained.
Optionally, the generating each first horizontal record in the first virtual table according to the virtual table longitudinal field information, the virtual table longitudinal field value, the virtual table record effective time field information, the virtual table record effective time, the virtual table longitudinal field operation type, and the virtual table longitudinal field operation time with the same horizontal record identifier in the vertical record table includes the following steps:
and 103-1-1-1, acquiring a second longitudinal record temporary table from the longitudinal record table according to the same transverse record identifier.
Wherein the second longitudinal record temporary table comprises: the second record validation time corresponding to the virtual table record validation time field information, the second record validation time corresponding to the virtual table record validation time, the second longitudinal field operation type corresponding to the virtual table longitudinal field operation type and the second longitudinal field operation time corresponding to the virtual table longitudinal field operation time.
The horizontal record mark is the mark of the same actual record in the metadata table, so that the second vertical record temporary table stores the table which stores the same actual record vertically.
Step 103-1-1-2, acquiring a second longitudinal field information queue including the second longitudinal field information according to the second longitudinal field information of the second longitudinal record temporary table.
Because there are cases where there are multiple modifications to the field value of the same field information, or cases where the field value has been deleted. Therefore, the unicity of the second longitudinal field information in the second longitudinal field information queue is ensured, and the efficiency of generating the first virtual table can be improved.
The modification of the data in the metadata table is not actually modified on the basis of the original value, but a new field value is added to the same field, and the modification type is recorded on the operation type. Deletion of data in the metadata table is also a recording of a deletion type on the operation type. Any historical data can thus be traced back.
Because a large amount of repeated information may exist in the same field information, each field information in the queue is ensured to appear only once through a mode of establishing the queue, and thus the efficiency of processing the table can be improved.
And 103-1-1-3, sequentially acquiring the second longitudinal field information from the second longitudinal field information queue.
103-1-1-4, respectively acquiring the last operation time and the last operation type from a second longitudinal record temporary table according to the second longitudinal field information; the last operation time is the maximum second longitudinal field operation time corresponding to the second longitudinal field information; the last operation type is the second longitudinal field operation type corresponding to the last operation time.
Step 103-1-1-5, determining all second longitudinal field information according to the mismatch relationship between the last operation type and the deletion type, and inserting the corresponding second longitudinal field value and the second record effective time into the first virtual table to generate a first transverse record.
Optionally, in step 103-1-1-4, the last operation time is the maximum second longitudinal field operation time corresponding to the second longitudinal field information within the constraint effective time threshold.
Because the embodiment of the disclosure does not delete the record, the record of the table structure which is used historically can be conveniently inquired. For example, the B field of the a table is currently marked as a deletion type, and when the a table is currently queried, the information of the B field cannot be displayed; but the B field is marked as a class addition type or a modification type within the constraint effective time threshold range, and when the A table is queried, the information of the B field is displayed.
The data processing method provided by the embodiment of the disclosure improves the flexibility of data application.
Optionally, the first horizontal recording further includes: the operation type of the horizontal field of the virtual table corresponding to the operation type of the vertical field of the virtual table and the operation time of the horizontal field of the virtual table corresponding to the operation time of the vertical field of the virtual table.
Determining all second longitudinal field information according to the mismatch relationship between the last operation type and the deletion type, and inserting the corresponding second longitudinal field value and the second record effective time into the first virtual table to generate a first transverse record, including:
step 103-1-1-5-1, determining all second longitudinal field information according to the mismatch relationship between the last operation type and the deletion type, and inserting the corresponding second longitudinal field value, the second longitudinal field operation type, the corresponding second longitudinal field operation time and the second record effective time into the first virtual table to generate a first horizontal record.
The embodiment of the disclosure saves the information of asynchronous time in the same metadata table, and the data records are saved in a longitudinal storage mode. The field information in the metadata table can be changed at any time. The flexibility of data application is improved. Meanwhile, a plurality of asynchronous time can exist at the same time, so that the asynchronous time information is simple and convenient to query.
Corresponding to the first embodiment provided by the present disclosure, the present disclosure also provides a second embodiment, that is, an apparatus for data processing. Since the second embodiment is basically similar to the first embodiment, the description is simple, and the relevant portions should be referred to the corresponding description of the first embodiment. The device embodiments described below are merely illustrative.
Fig. 2 shows an embodiment of a data processing apparatus provided by the present disclosure. Fig. 2 is a block diagram of units of a data processing apparatus according to an embodiment of the present disclosure.
Referring to fig. 2, the present disclosure provides a data processing apparatus, including: query information acquiring unit 201, longitudinal record table acquiring unit 202, transverse record generating unit 203, and result acquiring unit 204.
An obtain query information unit 201, configured to obtain first query information, where the first query information includes virtual table identification information, query field information, a query value, and a constraint validation time threshold;
an obtaining longitudinal record table unit 202, configured to obtain a longitudinal record table from a metadata table record according to the virtual table identification information;
a transverse record generating unit 203, configured to generate each first transverse record in a first virtual table according to the virtual table longitudinal field information in the longitudinal record table having the same transverse record identifier;
and a result obtaining unit 204, configured to retrieve the first transverse record according to the query field information, the query value, and the constraint validation time threshold, and obtain a first result.
Optionally, the metadata table includes: table identification information, table horizontal record identification, table longitudinal field information, table longitudinal field values corresponding to the table longitudinal field information, table record effective time field information and table record effective time; the longitudinal record table comprises: the virtual table record system comprises a table horizontal record identifier corresponding to the table horizontal record identifier, virtual table vertical field information corresponding to the table vertical field information, a virtual table vertical field value corresponding to the table vertical field value, virtual table record effective time field information corresponding to the table record effective time field information and virtual table record effective time corresponding to the table record effective time.
Optionally, the generating transverse recording unit 203 includes:
and a first sub-unit for generating horizontal records, configured to generate each first horizontal record in the first virtual table according to the virtual table longitudinal field information, the virtual table longitudinal field value, the virtual table record effective time field information, and the virtual table record effective time that have the same horizontal record identifier in the longitudinal record table.
Optionally, the first horizontal recording includes: a plurality of virtual table horizontal field values respectively associated with the virtual table vertical field values and a horizontal record validation time associated with the virtual table record validation time.
Optionally, the metadata table further includes: table longitudinal field operation type and table longitudinal field operation time; the longitudinal record table further comprises: the virtual table longitudinal field operation type corresponding to the table longitudinal field operation type and the virtual table longitudinal field operation time corresponding to the table longitudinal field operation time; the longitudinal field operation type or the virtual table longitudinal field operation type comprises an adding type, a deleting type and a modifying type;
in the generating a transverse record first subunit, comprising:
and a second sub-unit for generating horizontal records, configured to generate each first horizontal record in the first virtual table according to the virtual table longitudinal field information, the virtual table longitudinal field value, the virtual table record effective time field information, the virtual table record effective time, the virtual table longitudinal field operation type, and the virtual table longitudinal field operation time that have the same horizontal record identifier in the longitudinal record table.
Optionally, in the second subunit for generating the horizontal records, the method includes:
the acquisition second longitudinal record temporary table subunit is used for acquiring a second longitudinal record temporary table from the longitudinal record table according to the same transverse record identifier; wherein the second longitudinal record temporary table comprises: second longitudinal field information corresponding to the virtual table longitudinal field information, second longitudinal field information corresponding to the virtual table longitudinal field value, second record effective time field information corresponding to the virtual table record effective time field information, second record effective time corresponding to the virtual table record effective time, second longitudinal field operation type corresponding to the virtual table longitudinal field operation type and second longitudinal field operation time corresponding to the virtual table longitudinal field operation time;
an obtaining information queue subunit, configured to obtain, according to the second longitudinal field information of the second longitudinal record temporary table, a second longitudinal field information queue including the second longitudinal field information;
the second longitudinal field information acquiring subunit is configured to acquire the second longitudinal field information from the second longitudinal field information queue in sequence;
the operation type obtaining subunit is configured to obtain a last operation time and a last operation type from a second longitudinal record temporary table according to the second longitudinal field information; the last operation time is the maximum second longitudinal field operation time corresponding to the second longitudinal field information; the last operation type is the second longitudinal field operation type corresponding to the last operation time;
and the effective transverse record obtaining subunit is used for determining all second longitudinal field information according to the mismatching relation between the last operation type and the deletion type, and inserting the corresponding second longitudinal field value and the second record effective time into the first virtual table to generate a first transverse record.
Optionally, the last operation time is the maximum second longitudinal field operation time corresponding to the second longitudinal field information within the constraint effective time threshold range.
Optionally, the first horizontal recording further includes: the virtual table horizontal field operation type corresponding to the virtual table vertical field operation type and the virtual table horizontal field operation time corresponding to the virtual table vertical field operation time;
in the acquiring valid transverse recording subunit, the method includes:
and the effective time obtaining subunit is configured to determine all second longitudinal field information according to the mismatch relationship between the last operation type and the deletion type, insert the corresponding second longitudinal field value, the second longitudinal field operation type, the corresponding second longitudinal field operation time, and the second record effective time into the first virtual table, and generate a first horizontal record.
The embodiment of the disclosure saves the information of asynchronous time in the same metadata table, and the data records are saved in a longitudinal storage mode. The field information in the metadata table can be changed at any time. The flexibility of data application is improved. Meanwhile, a plurality of asynchronous time can exist at the same time, so that the asynchronous time information is simple and convenient to query.
The third embodiment of the present disclosure provides an electronic device, which is used in a data processing method, and includes: at least one processor; and a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the one processor to cause the at least one processor to perform the method of data processing according to the first embodiment.
The present disclosure provides a fourth embodiment, that is, a computer storage medium for data processing, where the computer storage medium stores computer-executable instructions, and the computer-executable instructions can execute the method for data processing described in any of the above method embodiments.
Referring to fig. 3, a schematic structural diagram of an electronic device suitable for implementing an embodiment of the disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 3, the electronic device may include a processing device (e.g., a central processing unit, a graphic processor, etc.) 301 that may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)302 or a program loaded from a storage device 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data necessary for the operation of the electronic apparatus are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
Generally, the following devices may be connected to the I/O interface 305: input devices 306 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 307 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage devices 308 including, for example, magnetic tape, hard disk, etc.; and a communication device 309. The communication means 309 may allow the electronic device to communicate wirelessly or by wire with other devices to exchange data. While fig. 3 illustrates an electronic device having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 309, or installed from the storage means 308, or installed from the ROM 302. The computer program, when executed by the processing device 301, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring at least two internet protocol addresses; sending a node evaluation request comprising the at least two internet protocol addresses to node evaluation equipment, wherein the node evaluation equipment selects the internet protocol addresses from the at least two internet protocol addresses and returns the internet protocol addresses; receiving an internet protocol address returned by the node evaluation equipment; wherein the obtained internet protocol address indicates an edge node in the content distribution network.
Alternatively, the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a node evaluation request comprising at least two internet protocol addresses; selecting an internet protocol address from the at least two internet protocol addresses; returning the selected internet protocol address; wherein the received internet protocol address indicates an edge node in the content distribution network.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".