CN110032562B - Method and device for storing business records - Google Patents

Method and device for storing business records Download PDF

Info

Publication number
CN110032562B
CN110032562B CN201910089240.6A CN201910089240A CN110032562B CN 110032562 B CN110032562 B CN 110032562B CN 201910089240 A CN201910089240 A CN 201910089240A CN 110032562 B CN110032562 B CN 110032562B
Authority
CN
China
Prior art keywords
tag
category
label
field
binary
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.)
Active
Application number
CN201910089240.6A
Other languages
Chinese (zh)
Other versions
CN110032562A (en
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.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Advanced New 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 Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201910089240.6A priority Critical patent/CN110032562B/en
Publication of CN110032562A publication Critical patent/CN110032562A/en
Application granted granted Critical
Publication of CN110032562B publication Critical patent/CN110032562B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2291User-Defined Types; Storage management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2457Query processing with adaptation to user needs
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]

Abstract

A method and apparatus for storing a service record are disclosed. For each tag category, a corresponding configuration table is created for the tag category in advance and is used for storing each tag content belonging to the tag category and the number of each tag content. Thus, when a business record for a business event needs to be constructed, the number of each tag content allocated for the business event can be written into the tag field of the business record. When the tag content needs to be read later, firstly, the number is read from the tag field of the service record, and based on the read number, the corresponding tag content is read from the pre-created configuration table.

Description

Method and device for storing business records
Technical Field
Embodiments of the present disclosure relate to the field of information technologies, and in particular, to a method and an apparatus for storing a service record.
Background
During service operation, it is often necessary to write the generated service record into a database for storage. In some business scenarios, a business record not only contains several fields for recording business event information, but also needs to contain fields for recording tag content corresponding to the business event information.
For example, assuming that there is a second-hand transaction platform for a commodity, the user Zhang Sanyu issues the commodity a to be sold on the platform on 1 st 2019, the platform may determine "Zhang san, 2019.1.1, and commodity a" as the business event information, and then determine 3 tag contents (which may be determined by the platform analysis or may be specified by the user Zhang san) corresponding to the business event information as follows: zhejiang province, digital products, 95. The 3 label contents show that the user is located in Zhejiang province, commodity A belongs to a digital product, and the color of commodity A is 95 new. Further, the platform constructs a service record based on the fields containing the service event information and the fields containing the tag content, and writes the service record into the database.
In practical application, for at least two service records, part or all of tag contents contained in the service records may be the same, and as the service volume increases, the database can repeatedly store the same tag content for multiple times, so that more storage resources are consumed.
Disclosure of Invention
In order to solve the problem of wasting storage resources in the existing method for storing tag contents, the embodiment of the present disclosure provides a method and an apparatus for storing and reading tag contents, where the technical scheme is as follows:
According to the 1 st aspect of the embodiments of the present disclosure, there is provided a method for storing a service record, where each pre-created configuration table corresponds to each tag class one by one, and for each tag class, the configuration table corresponding to the tag class is used to store each tag content belonging to the tag class and a number of each tag content; any two tag contents belonging to the same tag category are different in number;
the method comprises the following steps:
acquiring business event information and distributing at least one tag content for the business event information;
determining the number of each tag content corresponding to the business event information according to a pre-established configuration table;
determining a tag field; the tag field contains the serial number of each tag content corresponding to the business event information;
and constructing and storing a business record based on the business event information and the label field.
According to the 2 nd aspect of the embodiments of the present specification, there is provided a method for reading tag content corresponding to service event information, including:
reading a service record and extracting a tag field in the service record; the business record is stored by the method of the 1 st aspect;
Reading the number contained in the tag field;
and reading tag content from a pre-created configuration table based on the number contained in the tag field.
According to the 3 rd aspect of the embodiments of the present specification, there is provided a device for storing a service record, where each pre-created configuration table corresponds to each tag class one by one, and for each tag class, the configuration table corresponding to the tag class is used to store each tag content belonging to the tag class and a number of each tag content; any two tag contents belonging to the same tag category are different in number;
the device comprises:
the acquisition module acquires service event information and distributes at least one tag content for the service event information;
the number determining module is used for determining the number of each tag content corresponding to the business event information according to a pre-established configuration table;
a field determining module for determining a tag field; the tag field contains the serial number of each tag content corresponding to the business event information;
and the storage module is used for constructing and storing a business record based on the business event information and the tag field.
According to a 4 th aspect of the embodiments of the present specification, there is provided an apparatus for reading tag content corresponding to service event information, including:
The field extraction module is used for reading the service record and extracting a label field in the service record; the business record is stored by the method of the 1 st aspect;
the number reading module is used for reading the numbers contained in the tag fields;
and the tag content reading module reads tag content from a pre-created configuration table based on the number contained in the tag field.
According to the technical scheme provided by the embodiment of the specification, a corresponding configuration table is created for each label category in advance and is used for storing each label content belonging to the label category and the number of each label content. Thus, when a business record for a business event needs to be constructed, the number of each tag content allocated for the business event can be written into the tag field of the business record. When the tag content needs to be read later, firstly, the number is read from the tag field of the service record, and based on the read number, the corresponding tag content is read from the pre-created configuration table. That is, although the tag field does not specifically tag content, the corresponding tag content may be queried from the configuration table with the number in the tag field as a clue.
On the one hand, by means of creating the configuration table, only one time of storage is needed for each configuration information under each label category, and a lot of storage resources are not consumed. On the other hand, in the business record written into the database, the tag field only contains the number used for inquiring the tag content, and the occupied storage space is small.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the embodiments of the disclosure.
Further, not all of the effects described above need be achieved in any of the embodiments of the present specification.
Drawings
In order to more clearly illustrate the embodiments of the present description or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present description, and other drawings may be obtained according to these drawings for a person having ordinary skill in the art.
FIG. 1 is a flow chart of a method for storing business records according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a method for reading tag content corresponding to service event information according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a tag field template provided by an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a tag field provided by an embodiment of the present description;
FIG. 5 is a schematic diagram of a category field template provided by an embodiment of the present disclosure;
FIG. 6 is a schematic diagram of a category field provided by an embodiment of the present description;
FIG. 7 is a schematic diagram of the tag field of case 1 provided by an embodiment of the present disclosure;
FIG. 8 is a schematic diagram of the tag field of case 2 provided by an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of an apparatus for storing business records according to an embodiment of the present disclosure;
fig. 10 is a schematic structural diagram of an apparatus for reading tag content corresponding to service event information according to an embodiment of the present disclosure;
fig. 11 is a schematic structural view of an apparatus for configuring the method of the embodiment of the present specification.
Detailed Description
In the prior art, the tag field in the service record typically stores specific tag content. See table 1 below for examples, supra.
Name of name Publication time Commodity name Label (Label)
Zhang San 2019.1.1 A Zhejiang province, digital product and 95 adult new
Li Si 2018.12.2 B Fujian province, clothing and 99 new technology
Wang Wu 2018.10.7 C New digital product 95 of Shandong province
TABLE 1
As shown in table 1, each row is a business record, wherein the first three fields of each business record are used to record business event information, such as the name of the merchandise issuer, the merchandise issue time, and the merchandise name. The fourth field (tag field) of each service record is used for recording tag contents allocated for service event information, namely provinces where the commodity issuer is located, commodity types and commodity colors.
Note that, when there are a plurality of tag contents included in each service record, the tag categories to which the plurality of tag contents belong are often different. For example, for the commodity a, the label category to which "Zhejiang province" belongs is province, the label category to which "digital product" belongs is commodity type, the label category to which "95" is new "belongs is color forming, and 3 label contents of the commodity a respectively belong to different label categories.
With continued reference to Table 1, the associated article color of article A and article C are the same as the label content of the article type. That is, the platform needs to repeatedly store the "digital product" and the "95" twice. In practical applications, there are often more label categories, and there may be more label categories in addition to the provinces, the commodity types, and the commodity color forming. This means that with the increase of service records in table 1, many tag contents may be stored repeatedly thousands of times, which consumes a large storage space.
It is well known that data is actually stored in a binary form in a database. For a Chinese character, the memory space occupied is 2 bytes (i.e. 16 binary digits). For a number, after it is converted to binary form, the length of the binary number is the memory space it occupies. Taking the commodity A in table 1 as an example, the label content "Zhejiang province, digital product, 95" corresponding to the commodity A comprises 9 Chinese characters and 1 number (i.e. 95). These 9 chinese characters need to occupy 16×9=144 binary digits, the binary form of the number 95 is 1011111, and 7 binary digits need to be occupied. That is, the tag content corresponding to the commodity a needs to occupy 151 binary digits.
In table 1, there are only 3 tag categories, and if there are more tag categories, the storage space occupied by the tag content in each service record is larger, and further, the storage resources consumed for repeatedly storing the tag content are huge.
In one or more embodiments of the present disclosure, on the one hand, each tag content and the number of each tag content under each tag category are stored in the configuration table, and on the other hand, specific tag content is not written in each service record, but a clue for querying the tag content, that is, the number of the tag content is written.
On the one hand, by means of the configuration table, only one time of storage is needed for each configuration information, so that storage resources are effectively saved, and on the other hand, the storage space occupied by the number is often smaller (which is far smaller than the storage space occupied by the tag content), so that the purpose of saving the storage resources can be achieved.
In order for those skilled in the art to better understand the technical solutions in the embodiments of the present specification, the technical solutions in the embodiments of the present specification will be described in detail below with reference to the drawings in the embodiments of the present specification, and it is apparent that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments obtained by a person skilled in the art based on the embodiments in the present specification shall fall within the scope of protection.
The following describes in detail the technical solutions provided by the embodiments of the present specification with reference to the accompanying drawings.
Fig. 1 is a flowchart of a method for storing a service record according to an embodiment of the present disclosure, including the following steps:
s100: and acquiring the business event information and distributing at least one tag content for the business event information.
In the embodiment of the present specification, a configuration table corresponding to each tag class may be stored in advance. For each tag category, the configuration table corresponding to the tag category is used for storing each tag content belonging to the tag category and the number of each tag content.
In the embodiment of the present specification, if there is only one tag category, the numbers of any two tag contents belonging to the tag category must not be the same, so that the corresponding tag contents can be uniquely determined according to a certain number. If there is more than one tag category, then the numbers of any two tag contents belonging to that tag category must not be the same, while it is also generally required that the numbers of any two tag contents belonging to different tag categories must not be the same. In addition, in the following, two preferred embodiments are provided, in which the numbers of any two tag contents belonging to different tag categories may be the same or different.
In the embodiment of the present specification, if the numbers of any two tag contents belonging to different tag categories are required to be different, then, in fact, for any tag content in each of the configuration tables created in advance, the number of the tag content is actually a unique number that can uniquely identify the tag content.
For example, each tag class may be assigned a different number first, and assuming that the number of each tag class is a 3-digit number, then for each tag class the first 3 digits of the tag class's tag content number are the tag class's number. Assuming that there are 3 tag categories, the 3 tag categories are numbered 1, 2, 3, respectively, then the second tag content under the tag category numbered 1 may be numbered 102, and the first tag content under the tag category numbered 2 may be numbered 201. Tables 2 to 4 below exemplarily show configuration tables corresponding to 3 tag categories, respectively.
TABLE 2
TABLE 3 Table 3
TABLE 4 Table 4
Of course, the number assigned to each tag content belonging to the tag category is not necessarily a serial number, and may be assigned according to an arbitrary rule, as long as the numbers of the tag contents belonging to the same tag category are not repeated. For example, table 2 may be modified, the number of "foci province" may be 111, the number of "Zhejiang province" may be 105, and the number of "shandong province" may be 101, as shown in table 5 below.
TABLE 5
In the embodiment of the present specification, the service event information refers to information related to any service event that occurs and needs to be recorded. For example, in the scenario of the commodity second hand transaction described above, the business event may be "the user Zhang Sanyu issues the commodity a to be sold on 1 month 1 day 2019", and the corresponding business event information is "Zhang three, 2019.1.1, commodity a".
In general, at least one tag content corresponding to the service event information may be analyzed according to the service event information, or a plurality of alternative tag contents may be provided to the user, and the user may select the tag content as the tag content corresponding to the service event information.
Here, if at least two tag contents are allocated to the service event information, the tag categories to which the tag contents corresponding to the service event information belong are different.
S102: and determining the number of each tag content corresponding to the business event information according to a pre-created configuration table.
In the embodiment of the present disclosure, for each tag class, all the tag contents and numbers that are known to belong to the tag class may be written in advance into the configuration table corresponding to the tag class. Thus, in step S102, for each tag content corresponding to the service event information, a corresponding number may be read from the configuration table storing the tag content according to the tag content.
Further, for each tag category, any content may not be written into the configuration table corresponding to the tag category in advance, and when the method shown in fig. 1 is actually executed, for each tag content corresponding to the business event information, if the tag content appears for the first time, a number is allocated to the tag content, and the tag content and the number thereof are stored in the configuration table corresponding to the tag category to which the tag content belongs.
Specifically, when executing step S102, it may be determined, for each tag content corresponding to the service event information, whether a configuration table corresponding to a tag category to which the tag content belongs stores the tag content; if yes, reading the number of the tag content from a configuration table corresponding to the tag category to which the tag content belongs; otherwise, the label content is allocated with a number, and the label content and the number of the label content are stored in a configuration table corresponding to the label category to which the label content belongs.
S104: a tag field is determined.
In this embodiment of the present disclosure, the tag field is a field for recording a number of a tag content corresponding to the service event information in a service record that is constructed later. That is, the determined tag field contains a number of each tag content corresponding to the business event information.
Taking tables 2 to 4 as an example, assuming that the tag content allocated for the service event information is new in Zhejiang province, digital products and 95, the tag content "Zhejiang province" may be determined to have a number 102 according to table 2, the tag content "digital products" may be determined to have a number 201 according to table 3, and the tag content "95" may be determined to have a new number 301 according to table 3. The tag field containing the three numbers queried may then be found as "102, 201, 301". Since 102 corresponds to a binary number 1100110 (7 bits), 201 corresponds to a binary number 11001001 (8 bits), and 301 corresponds to a binary number 100101101 (9 bits), the memory space occupied by the tag field is approximately 24 bits, which is far less than the number of bits (151 bits, as described above) required to write the contents of the three tag contents into the tag field.
S106: and constructing and storing a business record based on the business event information and the label field.
In the embodiment of the present disclosure, after the tag field is obtained, a plurality of service fields storing the service event information and the tag field may be encapsulated into a service record and written into the database for storage.
See table 6, where "name", "release time", "commodity name" is a service field, and "tag content" is a tag field.
Name of name Publication time Commodity name Tag content
Zhang San 2019.1.1 A 102、201、301
TABLE 6
Though the tag field is not specific to tag content by the method shown in fig. 1, the tag field is taken as a clue, and the corresponding tag content can be queried from a pre-created configuration table. On the one hand, in the mode of the configuration table, each configuration information under each tag class is only required to be stored once, and a lot of storage resources are not consumed. On the other hand, in the business record written into the database, the tag field only contains the number used for inquiring the tag content, and the occupied storage space is small.
Corresponding to the method for storing tag content shown in fig. 1, the embodiment of the present disclosure further correspondingly provides a method for reading tag content corresponding to service event information, as shown in fig. 2, including:
s201: and reading the service record and extracting a tag field in the service record.
S202: and reading the number contained in the tag field.
S204: and reading tag content from a pre-created configuration table based on the number contained in the tag field.
In the embodiment of the present disclosure, when the tag content corresponding to each service event needs to be read, the tag field in the service record may be first acquired. The tag field does not contain specific tag content, but a number.
The corresponding tag content can be queried from the pre-stored configuration tables with each number in the tag field as a clue. Specifically, since the numbers corresponding to the tag contents are not repeated, for each number included in the tag field, the configuration table recording the number may be located, and then the configuration information corresponding to the number may be read from the configuration table recording the number.
For example, referring to table 6, 3 numbers, 102, 201, 301 respectively, are first read from table 6. Then, the tag content "Zhejiang province" corresponding to the number 102 is read from table 2, the tag content "digital product" corresponding to the number 201 is read from table 3, and the tag content "95" corresponding to the number 301 is read from table 4.
In addition, in the embodiment of the present specification, the tag content and the number thereof are stored in a manner of a configuration table corresponding to each tag category one by one, so that the following technical effects can be achieved:
1. When new tag content needs to be added for a certain tag class, only one tag content needs to be added in a configuration table corresponding to the tag class, and a binary number is allocated to the tag content.
For example, referring to table 3, assuming that a new commodity type "book" needs to be added, table 3 may be changed to table 9 below.
TABLE 7
2. When a new tag class needs to be added, a configuration table only needs to be built for the tag class. For a subsequently occurring business event, the business event may be assigned a richer (more tag categories) tag content.
For example, the newly added tag category "payment method" may be added with a configuration table corresponding to "payment method" based on tables 2 to 4, as shown in table 8 below.
TABLE 8
Accordingly, after adding the configuration table, tag contents related to payment means may be allocated to the business event. For example, the user Zhu Liu issues the commodity D2 in 2019, and the corresponding tag content may be shandong province, clothing, 99 new, electronic payment. Then, based on tables 2 to 4, table 8, a service record may be added on the basis of table 6, as shown in table 9 below.
Name of name Publication time Commodity name Tag content
Zhang San 2019.1.1 A 102、201、301
Zhu Liu 2019.2.2 D 103、202、302、、401
TABLE 9
In summary, the core idea of the invention is: on one hand, specific tag contents are separated from service records, and the tag contents are stored independently in a mode of using a configuration table corresponding to each tag category, so that the same tag contents are prevented from being stored repeatedly for a plurality of times, and storage resources are saved; on the other hand, the number of the tag content (instead of the tag content itself) recorded in the configuration table is written into the tag field in the service record, so as to save storage resources. Thus, when the tag content in the service record is to be read, the corresponding tag content can be queried from the configuration table by taking the number in the tag field as a clue.
Any specific embodiment based on the above technical ideas adopted by the person skilled in the art should be within the technical scope of the present invention as claimed.
In the following, the embodiments of the present specification exemplarily give two preferred embodiments to achieve a better saving of storage space.
First, in order to implement the two preferred embodiments, the numbers stored in the configuration table corresponding to each tag class may be specifically binary numbers, and the binary numbers of the tag contents belonging to the same tag class should contain the same number of binary bits. That is, for each tag category, the configuration table corresponding to the tag category is used to store each tag content belonging to the tag category and the binary number of each tag content.
In both preferred embodiments, the numbering of any two tag contents belonging to different tag categories may be different or the same.
Further, for each tag category, the binary number of each tag content belonging to the tag category is determined by:
according to the sequence of writing each label content belonging to the label category into the configuration table corresponding to the label category, sequencing each label content belonging to the label category from first to second;
for each tag content belonging to the tag category, if the tag content is the q-th tag content in the configuration table corresponding to the tag category, the binary number of the tag content is q in a binary form; q is E (0, ++).
Tables 10 to 12 below are configuration tables corresponding to label types (province, commodity type, color formation), respectively.
Table 10
TABLE 11
Table 12
Description of the preferred embodiments
For convenience of description, the number of tag categories is assumed to be S, and then the number of configuration tables is also assumed to be S, and each configuration table corresponds to each tag category one by one. Assuming that the label categories have a sequence, a natural number i epsilon (0, S+1) is set, and the binary bit number of the binary number of the label content belonging to the ith label category is recorded as M i
In the embodiment of the present specification, the following pre-deployment may be further performed:
creating a tag field template containing N binary bits, wherein a plurality of bit segments exist in the N binary bits, and each bit segment comprises a plurality of binary bits. Wherein, for the ith tag category, the tag field template has a bit section corresponding to the ith tag category only, if the binary number of the tag content belonging to the ith tag category has M i A binary bit, wherein the bit segment corresponding to the ith tag class in the tag field template contains P i A binary bit. And also needs to satisfy M i ≤P i And, in addition,
theoretically, M i And P i The closer (and/or N is toMore closely), the fewer redundant bits in the tag field, based on the tag fieldThe fewer bits occupied by the tag field obtained by the template, the more memory resources can be saved.
It should be noted that, in practice, the number of binary digits supported by a data type commonly found in a database generally includes at least the following cases: support to store 8-bit binary numbers (byte type), support to store 16-bit binary numbers (short type), support to store 32-bit binary numbers (int type), support to store 64-bit binary numbers (long type). Since the tag field template may be composed of one or more data types, the value of N is generally any one of 8, 16, 32, and 64, or may be a value obtained by adding any one of 8, 16, 32, and 64 to k×64, where k is a natural number greater than 0.
Herein, a bit segment refers to a segment containing at least one binary bit divided among N consecutive binary bits. The bit section can be planned in the tag field template according to actual needs. The binary bit of the interval can be arranged between each bit section in the label field template, or the binary bit of the interval can be absent; each bit segment in the tag field may run out of N bits exactly, or there may be some redundancy of bits.
Theoretically, the fewer redundant binary bits in the tag field template, the less memory space is occupied by the tag field obtained based on the tag field template. For example, assuming that 3 bit segments are required to be divided, 8 binary bits are occupied in total, the most economical strategy is to use one 8-bit byte type data as a tag field template (i.e., n=8), so after the three bit segments are divided, redundant binary bits just do not exist, and only 8 binary bits are occupied in the tag field obtained later. If there are alternate binary bits between the 3 divided bit segments, it is obviously insufficient to use an 8-bit byte type data as the tag field template, so that a 16-bit short type data has to be used as the tag field template, and there is a certain binary bit redundancy, and the tag field obtained later occupies 16 binary bits.
In the first preferred embodiment, when M i =P i When the bit section corresponding to the ith label category in the label field template comprises the (x+1) th to (x+Mi) th binary bits in the label field template, wherein if i=1, x=0; if i is more than or equal to 2, x is the sum of the numbers of binary bits contained in bit segments corresponding to the first i-1 tag categories respectively.
FIG. 3 is a schematic diagram of a tag field template provided by an embodiment of the present disclosure. As shown in fig. 3, assuming that the binary numbers of tag contents belonging to 3 tag categories all have 3 binary bits, the tag field template may be 16 binary bits of short type data (N is 16). At these 16 binary bits, 3 bit segments are divided, each bit segment comprising 3 binary bits. In addition, the remaining 7 binary bits are not divided into bit segments, and are redundant binary bits.
For any configuration table, if the binary numbers of the tag contents in the configuration table are sequentially allocated (i.e., are serial numbers), the binary number of the binary number in the configuration table needs to be enough to accommodate the binary number of the last tag content in the configuration table. On the premise of meeting the condition, the smaller the binary number of the binary number is, the smaller the binary number occupied by the corresponding bit segment is, and the smaller the storage space occupied by the tag field obtained based on the tag field template is.
For example, assuming that all the provinces in China (34 total) are required to be exhausted in Table 10, and tables 3 and 4 are unchanged, then the binary number corresponding to the last configuration information in Table 10 is actually a binary form of 34, namely 100010 (6 binary bits), and therefore, for Table 2, the binary number recorded needs to support at least 6 binary bits, as shown in Table 13.
TABLE 13
Furthermore, in a preferred embodiment, the tag field template should include a number of bits sufficient to accommodate S different binary numbers (the S bit numbers belonging to S configuration tables). In this manner, the tag field templates can accommodate the binary number of each tag content even though there are S tag contents allocated for the business event information (one tag content is determined under each tag category).
In a preferred mode one, a position is reserved for each tag category in the tag field template, and for each tag content corresponding to the business event information, the binary number of the tag content is written into a bit segment corresponding to the tag category to which the tag content belongs in the tag field template. In a preferred embodiment, the binary number of a certain tag content in one tag category may be repeated with the binary number of a certain tag content in the other tag category for any two tag categories. However, since a position is reserved for each tag class in the tag field template, confusion is not caused even if binary numbers of two tag contents belonging to different tag classes are repeated.
Wherein the bit segments (and redundant binary bits) in the tag field where no binary number is written may be null. Thus, in the tag field, the bit segment where the number is written is a valid bit segment, the bit segment that is empty is an invalid bit segment, and the binary bit that is empty is a redundant binary bit.
In addition, if the numbering rule for the tag content is that the binary number of the tag content is greater than 0, then, before the tag field is obtained, the bit segments and/or binary bits in the tag field template other than the bit segment corresponding to the hit tag class may be filled with 0. The hit tag class is the tag class to which the tag content corresponding to the business event information belongs. Thus, in the tag field, either a bit segment of 0 or a valid bit segment, a bit segment of 0 is an invalid bit segment, and the remaining bits of 0 are redundant bits.
For example, based on tables 2 to 4, assuming that the tag content allocated for the service event information is a number of shandong province, the tag field obtained based on the tag field template may be as shown in fig. 4. Note that, since the tag content related to the tag type (color formation) corresponding to the bit segment 3 is not included in the tag content set, it is also necessary to write 0 to the bit segment 3. In addition, it is also necessary to fill in the writing of 0 to binary bits (redundant binary bits) that are not scratched into any bit segment. In this way, the final stored business record may be as follows
Shown in table 14.
Name of name Publication time Commodity name Tag content
Zhang San 2019.1.1 A 0110010000000000
TABLE 14
Thus, when the tag content needs to be read, each valid bit segment (i.e., bit segment 1 and bit segment 2 in fig. 4) in the tag field may be first determined in step S202. Wherein the valid bit segment is a bit segment to which a binary number has been written. Specifically, the first bit of the binary value of the tag field in Table 12 is read, and the bit segment corresponding to tag class 1 is read first (due to M 1 =3, thus reading 3 bits), 011 as a binary number in the first bit segment (corresponding to tag class 1, also the valid bit segment), and then, again reads the bit segment corresponding to tag class 2 (due to M) 2 =3, thus reading 3 bits), 001 is obtained as a binary in the second bit segment (corresponding to tag class 2, also the valid bit segment)Numbering is then performed, and the corresponding bit of tag class 3 is read (due to M 3 =3, thus reading 3 bits), 000, is determined as an invalid bit segment (corresponding to tag class 3, indicating that article a does not have tag content under tag class 3), and so far, 3 bit segments have been read.
Then, for each valid bit segment, reading the binary number contained in the valid bit segment, and reading the label content corresponding to the binary number from the configuration table of the label class corresponding to the valid bit segment. Referring to fig. 4, namely, the tag content "shandong province" corresponding to the binary number "011" is read from the configuration table (table 10) corresponding to the tag class 1, and the tag content "number" corresponding to the binary number "001" is read from the configuration table (table 11) corresponding to the tag class 2.
Second preferred mode
In the second preferred embodiment, similarly, assuming that the number of tag categories is S, the number of configuration tables is also S, and each configuration table corresponds to each tag category one by one. Assuming that the label categories have a sequence, a natural number i epsilon (0, S+1) is set, and the binary bit number of the binary number of the label content belonging to the ith label category is recorded as M i
In the embodiment of the present specification, the following pre-deployment may be further performed:
a category field template containing F binary digits is created in advance, and S is less than or equal to F. For the ith tag category, a binary bit corresponding to only the ith tag category exists in the tag field template. Creating a label field template containing N binary digits in advance;
in the second preferred embodiment, unlike the first preferred embodiment, the bit section is not divided in the tag field template, but a category field template is created separately from the tag field template. And, S binary digits are required to be designated in the category field template, and the corresponding relation between the S binary digits and S label categories is established.
Theoretically, F is equal toThe closer S is, the fewer redundant binary digits in the category field are, the fewer binary digits occupied by the category field obtained based on the category field template are, and the more memory resources can be saved. In addition, N is equal to The closer the more closely the redundant bits in the tag field are, the fewer the bits occupied by the tag field obtained based on the tag field template are, and the more memory resources can be saved.
In a second preferred embodiment, F is one of the following values: 8. 16, 32, 64. Or, F is a value obtained by adding any one of values 8, 16, 32, and 64 to k×64, and k is a natural number greater than 0.
In a second preferred mode, the first S binary digits in the class field template may correspond to the S label classes one-to-one, that is, the binary digit in the class field template corresponding to the ith label class is the ith binary digit in the class field template.
For example, referring to fig. 5, assuming that there are 3 tag categories, the 1 st binary bit in the category field template may be used as the binary bit corresponding to the tag category 1, the 2 nd binary bit in the category field template may be used as the binary bit corresponding to the tag category 2, and the 3 rd binary bit in the category field template may be used as the binary bit corresponding to the tag category 3.
Based on the second preferred embodiment, in step S102, for each tag content allocated for the service event information, the tag category to which the tag content belongs may be determined as a valid tag category. And then, writing a first appointed numerical value into a binary bit corresponding to each valid tag category in the category field template, wherein the first appointed numerical value is 0 or 1. And writing the binary number of each tag content corresponding to the business event information into the tag field template to obtain a tag field. Wherein, for each valid tag category, the more front the binary bit corresponding to the valid tag category in the category field, the more front the binary number of the tag content belonging to the valid tag category in the tag field.
In the tag field, there may be a space between binary numbers in the tag field. The binary bits of the space may be either null or padded with 0. If the interval binary bit is filled with 0 s, the number of interval binary bits between any two adjacent binary numbers in the tag field needs to be the same for the accuracy of reading the binary numbers.
If the maximum efficiency is desired to utilize the binary bits in the tag field template, the binary numbers of the tag contents corresponding to the business event information can be spliced into a digital string and written into the tag field template. Thus, there are no intervening binary digits between any two adjacent binary numbers in the tag field.
Further, before obtaining the category field, writing a second designated numerical value into other binary digits except for the binary digits corresponding to the valid tag category in the category field template; wherein if the first specified value is 1, the second specified value is 0, and if the first specified value is 0, the second specified value is 1.
See, for example, fig. 6. 3 tag categories are preset, and two tag contents are allocated to the business event information and respectively belong to the tag category 1 and the tag category 3. Therefore, the tag class 1 and the tag class 3 are determined as valid tag classes, and then, in the class field template, binary bits corresponding to the tag class 1 and the tag class 3 are written into 1, and the rest binary bits are written into 0, so that a class field is obtained. Then, according to the sequence of the tag class 1 and the tag class 3, firstly, the binary number (011) of the tag content (assumed to be in Shandong province) belonging to the tag class 1 corresponding to the business event information is written, then, the binary number (001) corresponding to the tag content (assumed to be 95 new) belonging to the tag class 3 corresponding to the business event information is written, and the rest binary digits are written into 0.
As such, in step S104, a service record needs to be constructed and stored based on the service event information, the category field, and the tag field. The final stored business record may be as shown in table 15 below.
Name of name Publication time Commodity name Label category Tag content
Zhang San 2019.1.1 A 10100000 0110010000000000
TABLE 15
When the tag content needs to be read, a category field in the service record may be first extracted, and each valid bit in the category field may be determined. Wherein the valid bit is a binary bit to which the first specified value has been written. Specifically, the tag class corresponding to the binary bit having a value of 1 is determined as the valid bit by starting reading from the first bit of the binary value of the class field in table 15. It can be seen that the valid bit is a valid bit corresponding to tag class 1 and a valid bit corresponding to tag class 3.
Then, the numbering in the read tag field is divided into the following two cases:
1. it is assumed that there are alternate binary digits between any two adjacent binary numbers in the tag field, and that the binary digits not written are all blank, as shown in fig. 7. In this case, the binary number in the tag field is highlighted. Therefore, let the natural number j e [1, L ], L be the number of valid bits in the class field, and the j-th binary number in the tag field may be used as the binary number corresponding to the j-th valid bit in the class field.
2. It is assumed that there are a specified number (which may be 0 or other number) of spaced bits between any two adjacent binary numbers in the tag field, and that the value of the bits for which no binary number is written is 0, as shown in fig. 8. In this case, in practice, the number of bits requiring the space existing between any two adjacent binary numbers in the tag field is the same. Thus, the binary number of the tag content assigned to the tag category corresponding to the jth valid bit in the category field has M j A number of binary bits; c+y+1 to c+y+m in the tag field j The binary value corresponding to the binary bit is determined as the binary number corresponding to the j-th valid bit and is read; wherein: if j=1, y=0; if j is greater than or equal to 2, y is the sum of the numbers of binary digits of binary numbers corresponding to the first j-1 valid digits.
Then, for both case 1 and case 2, for the jth valid bit in the class field, the tag content corresponding to the binary number corresponding to the jth valid bit may be read from the configuration table corresponding to the tag class corresponding to the jth valid bit.
Specifically, the tag content "Shandong province" with binary number 011 is read from the configuration table (table 10) corresponding to the tag class 1, and the tag content "digital number" with binary number 001 is read from the configuration table (table 11) corresponding to the tag class 3.
In the second preferred embodiment, the binary number of a certain tag content in one tag category may be repeated with the binary number of a certain tag content in the other tag category for any two tag categories. However, since a position is reserved for each tag class in the class field template, confusion is not caused even if binary numbers of two tag contents belonging to different tag classes are repeated.
In addition, in the embodiment of the present specification, when a tag content is newly added to a certain tag category, if the number of bits of the binary number allocated to the newly added tag content is greater than the number of bits supported at present, the binary number in the configuration table corresponding to the tag category may be increased by one bit.
For example, assuming that the binary number assigned to the tag content "book" newly added to table 11 is 1000 (decimal 8), table 11 is changed to table 16 below, and tables 10 and 12 can be maintained unchanged.
TABLE 14
In addition, for the above preferred mode one, assuming that a tag class is newly added (a configuration table is newly added accordingly), a bit section corresponding to the tag class needs to be newly divided in the tag field template.
For the above-described preferred mode two, assuming that a tag class is newly added (a configuration table is newly added accordingly), then a binary bit corresponding to the class field needs to be newly specified in the class field template.
Fig. 9 is a schematic structural diagram of an apparatus for storing service records provided in the embodiment of the present disclosure, where each pre-created configuration table corresponds to each tag class one by one, and for each tag class, the configuration table corresponding to the tag class is used to store each tag content belonging to the tag class and a number of each tag content; any two tag contents belonging to the same tag category are different in number;
the device comprises:
the acquiring module 901 acquires service event information and distributes at least one tag content for the service event information;
a number determining module 902, configured to determine, according to a pre-created configuration table, a number of each tag content corresponding to the service event information;
a field determination module 903 for determining a tag field; the tag field contains the serial number of each tag content corresponding to the business event information;
and a storage module 904, configured to construct and store a service record based on the service event information and the tag field.
Any two tag contents belonging to different tag categories are numbered differently.
For each tag category, the configuration table corresponding to the tag category is used for storing each tag content belonging to the tag category and the number of each tag content, which is specifically implemented as follows:
for each tag category, the configuration table corresponding to the tag category is used for storing each tag content belonging to the tag category and the binary number of each tag content; wherein the binary numbers of the tag contents belonging to the same tag class contain the same number of binary bits.
For each tag category, the binary number of each tag content attributed to that tag category is determined by:
according to the sequence of writing each label content belonging to the label category into the configuration table corresponding to the label category, sequencing each label content belonging to the label category from first to second;
for each tag content belonging to the tag category, if the tag content is the q-th tag content in the configuration table corresponding to the tag category, the binary number of the tag content is q in a binary form; q is E (0, ++).
The pre-created label field template contains N binary digits, and a natural number i epsilon [1, S is set]S is the number of label categories, and for the ith label category, the bit section only corresponding to the ith label category exists in the label field template, and the binary number of the label content belonging to the ith label category is set to contain M i A binary bit, wherein the bit segment corresponding to the ith tag class in the tag field template contains P i Binary bits, M i ≤P i
The field determining module 903 writes, for each tag content corresponding to the service event information, a binary number of the tag content into a bit segment corresponding to a tag category to which the tag content belongs in the tag field template, so as to obtain a tag field.
If M i =P i The bit section corresponding to the ith label category in the label field template contains the (x+1) -th to (x+Mi) -th binary bits in the label field template; wherein:
if i=1, x=0;
if i is more than or equal to 2, x is the sum of the numbers of binary bits contained in bit segments corresponding to the first i-1 tag categories respectively.
The binary number of any tag content is greater than 0;
the field determining module 903 fills 0 into bit segments and/or binary bits in the tag field template except for the bit segment corresponding to the hit tag class before obtaining the tag field; the hit tag class is the tag class to which the tag content corresponding to the business event information belongs.
N is one of the following values: 8. 16, 32, 64;
or (b)
N is a value obtained by adding any one of values 8, 16, 32, and 64 to k×64, and k is a natural number greater than 0.
The pre-created category field template comprises category field templates of F binary digits, and a natural number i E [1, S is set]S is the number of label categories, S is less than or equal to F, and for the ith label category, binary digits only corresponding to the ith label category exist in the category field template; the pre-created tag field template contains N binary digits, and the binary number of the tag content belonging to the ith tag class contains M i The number of binary bits is one,
the field determining module 903 determines, for each tag content corresponding to the service event information, a tag class to which the tag content belongs as an effective tag class; writing a first appointed numerical value into a binary bit corresponding to each effective label category in the category field template to obtain a category field; the first specified value is 0 or 1; writing the binary number of each tag content corresponding to the business event information into the tag field template to obtain a tag field; wherein, for each valid tag category, the more front the binary bit corresponding to the valid tag category in the category field, the more front the binary number of the tag content belonging to the valid tag category in the tag field.
The binary bit corresponding to the ith label category in the category field template is the ith binary bit in the category field template.
The field determining module 903 splices the binary numbers of the tag contents corresponding to the service event information into a number string and writes the number string into the tag field template.
The field determining module 903 writes a second specified value into other binary digits except the binary digits corresponding to the valid tag class in the class field template before obtaining the class field; wherein if the first specified value is 1, the second specified value is 0, and if the first specified value is 0, the second specified value is 1.
F is one of the following values: 8. 16, 32, 64;
or (b)
F is a value obtained by adding any one of values 8, 16, 32, and 64 to k×64, and k is a natural number greater than 0.
The storage module 904 constructs and stores a service record based on the service event information, the category field, and the tag field.
The number determining module 902 determines, for each tag content corresponding to the service event information, whether a configuration table corresponding to a tag category to which the tag content belongs stores the tag content; if yes, reading the number of the tag content from a configuration table corresponding to the tag category to which the tag content belongs; otherwise, the label content is allocated with a number, and the label content and the number of the label content are stored in a configuration table corresponding to the label category to which the label content belongs.
Fig. 10 is a schematic structural diagram of an apparatus for reading tag content corresponding to service event information corresponding to the method shown in fig. 2 according to an embodiment of the present disclosure, where the apparatus includes:
the field extraction module 1001 reads a service record and extracts a tag field in the service record; the business record is stored by any one of the methods;
a number reading module 1002, configured to read a number included in the tag field;
the tag content reading module 1003 reads tag content from a pre-created configuration table based on the number contained in the tag field.
Any two tag contents belonging to different tag categories are different in number;
the tag content reading module 1003 determines, for each number included in the tag field, a configuration table in which the number is stored from among configuration tables created in advance; and reading the label content corresponding to the number from the determined configuration table.
The number reading module 1002 determines each valid bit segment in the tag field; wherein the valid bit segment is a bit segment to which a binary number has been written; for each valid bit segment, reading a binary number contained in the valid bit segment;
the number reading module 1002 determines a bit segment having a value other than 0 included in the tag field as a valid bit segment.
The tag content reading module 1003 determines, for each valid bit segment, a tag class corresponding to the valid bit segment; and reading the tag content corresponding to the binary number contained in the valid bit section from the configuration table corresponding to the determined tag category.
The field extracting module 1001 extracts a category field in the service record; determining each valid bit in the category field; the valid bit is a binary bit to which the first specified value has been written;
the number reading module 1002 sets a natural number j e 1, L]L is the number of valid bits in the category field, and the binary number of the tag content belonging to the tag category corresponding to the j-th valid bit in the category field is set to have M j A number of binary bits; c+y+1 to c+y+m in the tag field j The binary value corresponding to the binary bit is determined as the binary number corresponding to the j-th valid bit and is read; wherein: c is a natural number; if j=1, y=0; if j is greater than or equal to 2, y is the sum of the numbers of binary digits of binary numbers corresponding to the first j-1 valid digits.
The tag content reading module 1003 reads, for the jth valid bit in the class field, the tag content corresponding to the binary number corresponding to the jth valid bit from the configuration table corresponding to the tag class corresponding to the jth valid bit.
The embodiments of the present disclosure also provide a computer device at least including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the method shown in fig. 1 and/or 2 when executing the program.
FIG. 11 illustrates a more specific hardware architecture diagram of a computing device provided by embodiments of the present description, which may include: processor 1510, memory 1520, input/output interface 1530, communication interface 1540, and bus 1550. Wherein processor 1510, memory 1520, input/output interface 1530, and communication interface 1540 enable communication connections among each other within the device via bus 1550.
The processor 1510 may be implemented by a general-purpose CPU (Central Processing Unit ), microprocessor, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc. for executing relevant programs to implement the technical solutions provided in the embodiments of the present disclosure.
The Memory 1520 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory ), a static storage device, a dynamic storage device, or the like. Memory 1520 may store an operating system and other application programs, related program code is stored in memory 1520 and invoked for execution by processor 1510 when the technical solutions provided by the embodiments of the present specification are implemented in software or firmware.
The input/output interface 1530 is used for connecting input/output modules to achieve information input and output. The input/output module may be configured as a component in a device (not shown) or may be external to the device to provide corresponding functionality. Wherein the input devices may include a keyboard, mouse, touch screen, microphone, various types of sensors, etc., and the output devices may include a display, speaker, vibrator, indicator lights, etc.
Communication interface 1540 is for connecting a communication module (not shown) to enable communication interaction of the device with other devices. The communication module may implement communication through a wired manner (such as USB, network cable, etc.), or may implement communication through a wireless manner (such as mobile network, WIFI, bluetooth, etc.).
Bus 1550 includes a path to transfer information between components of the device (e.g., processor 1510, memory 1520, input/output interface 1530, and communication interface 1540).
It should be noted that although the above-described device only shows the processor 1510, the memory 1520, the input/output interface 1530, the communication interface 1540, and the bus 1550, the device may include other components necessary to achieve normal operation in a specific implementation. Furthermore, it will be understood by those skilled in the art that the above-described apparatus may include only the components necessary to implement the embodiments of the present description, and not all the components shown in the drawings.
The present description also provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the method shown in fig. 1 and/or 2.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
From the foregoing description of embodiments, it will be apparent to those skilled in the art that the present embodiments may be implemented in software plus a necessary general purpose hardware platform. Based on such understanding, the technical solutions of the embodiments of the present specification may be embodied in essence or what contributes to the prior art in the form of a software product, which may be stored in a storage medium, such as a ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method described in the embodiments or some parts of the embodiments of the present specification.
The system, method, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. A typical implementation device is a computer, which may be in the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or a combination of any of these devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the method embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points. The above-described method embodiments are merely illustrative, in that the modules illustrated as separate components may or may not be physically separate, and the functions of the modules may be implemented in the same piece or pieces of software and/or hardware when implementing the embodiments of the present disclosure. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
The foregoing is merely a specific implementation of the embodiments of this disclosure, and it should be noted that, for a person skilled in the art, several improvements and modifications may be made without departing from the principles of the embodiments of this disclosure, and these improvements and modifications should also be considered as protective scope of the embodiments of this disclosure.

Claims (16)

1. A method for storing business records, each pre-created configuration table corresponds to each label category one by one, and for each label category, the configuration table corresponding to the label category is used for storing each label content belonging to the label category and the number of each label content; any two tag contents belonging to the same tag category are different in number;
the method comprises the following steps:
acquiring business event information and distributing at least one tag content for the business event information;
determining the number of each tag content corresponding to the business event information according to a pre-established configuration table;
determining a tag field; the tag field contains the serial number of each tag content corresponding to the business event information;
constructing and storing a service record based on the service event information and the tag field;
for each tag category, the configuration table corresponding to the tag category is used for storing each tag content belonging to the tag category and the number of each tag content, which is specifically implemented as follows:
for each tag category, the configuration table corresponding to the tag category is used for storing each tag content belonging to the tag category and the binary number of each tag content; wherein the binary numbers of the tag contents belonging to the same tag class contain the same number of binary bits;
For each tag category, the binary number of each tag content attributed to that tag category is determined by:
according to the sequence of writing each label content belonging to the label category into the configuration table corresponding to the label category, sequencing each label content belonging to the label category from first to second;
for each tag content belonging to the tag category, if the tag content is the q-th tag content in the configuration table corresponding to the tag category, the binary number of the tag content is q in a binary form; q is E (0, ++);
the pre-created label field template contains N binary digits, and a natural number i epsilon [1, S is set]S is the number of label categories, and for the ith label category, the bit section only corresponding to the ith label category exists in the label field template, and the binary number of the label content belonging to the ith label category is set to contain M i A binary bit, wherein the bit segment corresponding to the ith tag class in the tag field template contains P i The number of binary bits is one,
the determining a tag field specifically includes:
and writing the binary number of the label content into a bit section corresponding to the label category to which the label content belongs in the label field template for each label content corresponding to the business event information to obtain a label field.
2. The method of claim 1, if M i =P i The bit section corresponding to the ith label category in the label field template contains the (x+1) -th to (x+Mi) -th binary bits in the label field template; wherein:
if i=1, x=0;
if i is more than or equal to 2, x is the sum of the numbers of binary bits contained in bit segments corresponding to the first i-1 tag categories respectively.
3. The method of claim 1, further comprising:
the pre-created category field template comprises category field templates of F binary digits, and a natural number i E [1, S is set]S is the number of label categories, S is less than or equal to F, and for the ith label category, binary digits only corresponding to the ith label category exist in the category field template; the pre-created tag field template contains N binary digits, and the binary number of the tag content belonging to the ith tag class contains M i The number of binary bits is one,
the determining a tag field specifically includes:
for each tag content corresponding to the business event information, determining the tag category to which the tag content belongs as an effective tag category;
writing a first appointed numerical value into a binary bit corresponding to each effective label category in the category field template to obtain a category field; the first specified value is 0 or 1;
Writing the binary number of each tag content corresponding to the business event information into the tag field template to obtain a tag field; wherein, for each valid tag category, the more front the binary bit corresponding to the valid tag category in the category field, the more front the binary number of the tag content belonging to the valid tag category in the tag field.
4. The method of claim 3, wherein the binary bit in the category field template corresponding to the ith tag category is the ith binary bit in the category field template.
5. The method of claim 3, writing the binary number of each tag content corresponding to the business event information into the tag field template, specifically comprising:
and splicing binary numbers of the tag contents corresponding to the business event information into a digital string and writing the digital string into the tag field template.
6. The method of claim 3, wherein the constructing and storing a service record based on the service event information and the tag field specifically includes:
and constructing and storing a business record based on the business event information, the category field and the label field.
7. A method for reading tag content corresponding to business event information comprises the following steps:
reading a service record and extracting a tag field in the service record; the business record is stored by the method of any one of claims 1 to 6;
reading the number contained in the tag field;
and reading tag content from a pre-created configuration table based on the number contained in the tag field.
8. The method of claim 7, wherein any two tag contents belonging to different tag categories are numbered differently;
reading tag content from a pre-created configuration table based on the number contained in the tag field, specifically including:
for each number contained in the tag field, determining a configuration table storing the number from the pre-created configuration tables;
and reading the label content corresponding to the number from the determined configuration table.
9. The method of claim 7, wherein the reading the number contained in the tag field specifically comprises:
determining each valid bit segment in the tag field; wherein the valid bit segment is a bit segment to which a binary number has been written;
for each significant bit segment, the binary number contained in that significant bit segment is read.
10. The method according to claim 9, reading tag content from a pre-created configuration table based on the number contained in the tag field, comprising in particular:
determining a label category corresponding to each valid bit segment;
and reading the tag content corresponding to the binary number contained in the valid bit section from the configuration table corresponding to the determined tag category.
11. The method of claim 7, the method further comprising:
extracting a category field in the service record;
determining each valid bit in the category field; the valid bit is a binary bit to which the first specified value has been written;
reading the number contained in the tag field specifically includes:
let natural number j E [1, L]L is the number of valid bits in the category field, and the binary number of the tag content belonging to the tag category corresponding to the j-th valid bit in the category field is set to have M j A number of binary bits;
c+y+1 to c+y+m in the tag field j The binary value corresponding to the bit is determined as the binary code corresponding to the j-th significant bitNumber and read;
wherein: c is a natural number; if j=1, y=0; if j is greater than or equal to 2, y is the sum of the numbers of binary digits of binary numbers corresponding to the first j-1 valid digits.
12. The method according to claim 11, reading tag content from a pre-created configuration table based on the number contained in the tag field, comprising in particular:
and for the j-th valid bit in the class field, reading the label content corresponding to the binary number corresponding to the j-th valid bit from the configuration table corresponding to the label class corresponding to the j-th valid bit.
13. A device for storing business records, wherein each pre-created configuration table corresponds to each label category one by one, and the configuration table corresponding to each label category is used for storing each label content belonging to the label category and the number of each label content; any two tag contents belonging to the same tag category are different in number;
the device comprises:
the acquisition module acquires service event information and distributes at least one tag content for the service event information;
the number determining module is used for determining the number of each tag content corresponding to the business event information according to a pre-established configuration table;
a field determining module for determining a tag field; the tag field contains the serial number of each tag content corresponding to the business event information;
The storage module is used for constructing and storing a service record based on the service event information and the tag field;
for each tag category, the configuration table corresponding to the tag category is used for storing each tag content belonging to the tag category and the number of each tag content, which is specifically implemented as follows:
for each tag category, the configuration table corresponding to the tag category is used for storing each tag content belonging to the tag category and the binary number of each tag content; wherein the binary numbers of the tag contents belonging to the same tag class contain the same number of binary bits;
for each tag category, the binary number of each tag content attributed to that tag category is determined by:
according to the sequence of writing each label content belonging to the label category into the configuration table corresponding to the label category, sequencing each label content belonging to the label category from first to second;
for each tag content belonging to the tag category, if the tag content is the q-th tag content in the configuration table corresponding to the tag category, the binary number of the tag content is q in a binary form; q is E (0, ++);
The pre-created label field template contains N binary digits, and a natural number i epsilon [1, S is set]S is the number of label categories, and for the ith label category, the bit section only corresponding to the ith label category exists in the label field template, and the binary number of the label content belonging to the ith label category is set to contain M i A binary bit, wherein the bit segment corresponding to the ith tag class in the tag field template contains P i The number of binary bits is one,
the determining a tag field specifically includes:
and writing the binary number of the label content into a bit section corresponding to the label category to which the label content belongs in the label field template for each label content corresponding to the business event information to obtain a label field.
14. An apparatus for reading tag content corresponding to service event information, comprising:
the field extraction module is used for reading the service record and extracting a label field in the service record; the business record is stored by the method of any one of claims 1 to 6;
the number reading module is used for reading the numbers contained in the tag fields;
and the tag content reading module reads tag content from a pre-created configuration table based on the number contained in the tag field.
15. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any one of claims 1 to 6 when the program is executed by the processor.
16. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 7 to 12 when the program is executed by the processor.
CN201910089240.6A 2019-01-30 2019-01-30 Method and device for storing business records Active CN110032562B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910089240.6A CN110032562B (en) 2019-01-30 2019-01-30 Method and device for storing business records

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910089240.6A CN110032562B (en) 2019-01-30 2019-01-30 Method and device for storing business records

Publications (2)

Publication Number Publication Date
CN110032562A CN110032562A (en) 2019-07-19
CN110032562B true CN110032562B (en) 2023-10-27

Family

ID=67235512

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910089240.6A Active CN110032562B (en) 2019-01-30 2019-01-30 Method and device for storing business records

Country Status (1)

Country Link
CN (1) CN110032562B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111522840B (en) * 2020-04-27 2023-08-11 平安科技(深圳)有限公司 Label configuration method, device, equipment and computer readable storage medium
CN114185890B (en) * 2021-12-09 2022-11-01 北京航星永志科技有限公司 Database retrieval method and device, storage medium and electronic equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030055838A1 (en) * 2000-03-22 2003-03-20 Barbara Rosen Data storing method and data storing structure
CN102438080A (en) * 2011-08-19 2012-05-02 北京沃泰丰通信技术有限公司 Call detail record synthesizing method and device
CN106919637A (en) * 2016-07-04 2017-07-04 阿里巴巴集团控股有限公司 Unique index is created and uniqueness querying method and device
CN107220266A (en) * 2016-03-22 2017-09-29 阿里巴巴集团控股有限公司 It is a kind of to create Service Database, business datum storage and the method and device for determining business datum

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030055838A1 (en) * 2000-03-22 2003-03-20 Barbara Rosen Data storing method and data storing structure
CN102438080A (en) * 2011-08-19 2012-05-02 北京沃泰丰通信技术有限公司 Call detail record synthesizing method and device
CN107220266A (en) * 2016-03-22 2017-09-29 阿里巴巴集团控股有限公司 It is a kind of to create Service Database, business datum storage and the method and device for determining business datum
CN106919637A (en) * 2016-07-04 2017-07-04 阿里巴巴集团控股有限公司 Unique index is created and uniqueness querying method and device

Also Published As

Publication number Publication date
CN110032562A (en) 2019-07-19

Similar Documents

Publication Publication Date Title
CN110648138B (en) Transaction query and transaction data processing method, device and equipment based on block chain
CN108491333A (en) Method for writing data, device, equipment and the medium of buffer circle
EP3252592A1 (en) Method and device for storing and reading data
CN109614372B (en) Object storage and reading method and device and service server
CN111352935B (en) Index creating method, device and equipment in block chain type account book
CN103559184B (en) The display packing of forms pages and device
CN111680061A (en) Data access method, device, equipment and storage medium
CN110032562B (en) Method and device for storing business records
CN110750530B (en) Service system and data checking method thereof
CN110781183A (en) Method and device for processing incremental data in Hive database and computer equipment
CN107943542A (en) A kind of configuration information management method, device, computer-readable recording medium and storage control
CN106648569A (en) Target serialization achieving method and device
CN112445729A (en) Operation address determination method, PCIe system, electronic device and storage medium
CN108804561A (en) Method of data synchronization and device
CN101201829A (en) Chinese character library system as well as character code display method thereof
CN104064220A (en) Random Fuse Sensing
CN114692581A (en) Electronic form sub-table display method, device, equipment and storage medium
CN107436918B (en) Database implementation method, device and equipment
CN110083416B (en) Resource loading method and device
CN112402955B (en) Game log recording method and system
CN107515816A (en) The method and server of a kind of data statistics
CN111352622B (en) Method for acquiring component height, page rendering method and related device
CN114692583A (en) Electronic form approval serial number generation method, device, equipment and storage medium
CN117973322A (en) Serialization method and device, deserialization method and device, and computer equipment
CN112732174A (en) Data processing method and device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20201015

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20201015

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

GR01 Patent grant
GR01 Patent grant