CN106897335B - Service data storage method, record identifier generation method and device - Google Patents

Service data storage method, record identifier generation method and device Download PDF

Info

Publication number
CN106897335B
CN106897335B CN201610488018.XA CN201610488018A CN106897335B CN 106897335 B CN106897335 B CN 106897335B CN 201610488018 A CN201610488018 A CN 201610488018A CN 106897335 B CN106897335 B CN 106897335B
Authority
CN
China
Prior art keywords
service
data
value
record identifier
identification field
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
CN201610488018.XA
Other languages
Chinese (zh)
Other versions
CN106897335A (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 CN201610488018.XA priority Critical patent/CN106897335B/en
Publication of CN106897335A publication Critical patent/CN106897335A/en
Application granted granted Critical
Publication of CN106897335B publication Critical patent/CN106897335B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/986Document structures and storage, e.g. HTML extensions

Landscapes

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

Abstract

The application discloses a business data storage method, a record identifier generation method and a record identifier generation device. The service data storage method comprises the following steps: determining a record identifier according to the value of the data identification field in the identification database; and storing the record identifier and the acquired service data in a service database corresponding to the service data so as to uniquely identify the service data in the service database through the record identifier. Furthermore, in order to enable the business data to be uniquely identified by the record identifier in the business database, it is generally necessary to change the value for determining the record identifier after determining the record identifier, and since the record identifier is determined by a value in an identification database other than the business database and the value is unique due to the change, the determined record identifier is unique in each business database storing the business data of the business, thereby solving the problems in the prior art.

Description

Service data storage method, record identifier generation method and device
Technical Field
The present application relates to the field of database technologies, and in particular, to a method for storing service data, a method for generating a record identifier, and an apparatus for generating a record identifier.
Background
With the continuous development of internet technology, more and more internet-based services are emerging, and these services generate service data in the process of service processing. For an enterprise, the behavioral preferences of the target users can be determined, typically by analyzing the business data. Therefore, how to store the service data effectively is an important technical problem in the process of storing the service data.
In the prior art, service data generated by service processing is stored in a service database as a record, and a corresponding number is assigned to the record in the storage process. Since the number has uniqueness in the service database, the record can be uniquely represented in the service database by the number. For example, when storing service data generated by the a service performed by the user a, the service data is stored as a record (referred to as record X herein) in a service database, and the record X is assigned with the number "317", and the record X can be uniquely represented by the number "317" in the service database.
In practical applications, when the traffic volume of a service reaches a certain scale, it is usually necessary to store the service data of the service through a plurality of parallel service databases. When the prior art is adopted to store the service data in parallel, numbers are independently distributed in each service database, and the service data storage mode can cause the numbers in different service databases to be repeated, so that the condition that the records cannot be uniquely represented by the numbers exists in the different service databases storing the service data of the service.
Disclosure of Invention
The embodiment of the application provides a method for storing service data, a method for generating a record identifier and a device thereof, which are used for solving the problem that in the prior art, numbers and records in a plurality of different service databases storing the service data of the same service correspond to each other.
The embodiment of the application provides a method for storing service data, which comprises the following steps:
determining a record identifier according to the value of the data identification field in the identification database;
and storing the record identifier and the acquired service data in a service database corresponding to the service data so as to uniquely identify the service data in the service database through the record identifier.
Preferably, the determining the record identifier according to the value of the data identification field in the identification database specifically includes:
determining a value of a data identification field in the identification database as a record identifier; or the like, or, alternatively,
and calculating the information abstract of the value of the data identification field in the identification database, and determining the information abstract as the record identifier.
Preferably, after determining the record identifier according to the value of the data identification field in the identification database, the method further comprises:
the value used to determine the record identifier is monotonically changed so that a new record identifier can be determined from the monotonically changed value.
Preferably, after determining the record identifier according to the value of the data identification field in the identification database, the method further comprises:
the value used for determining the record identifier is marked as a first state, so that, among the various values of the data identification field identifying the database, a new record identifier can be determined from the value marked as a second state, the second state being a state not used for determining the record identifier.
Preferably, the service data includes a service identifier, the identifier database further includes a service identifier field, and a value of the service identifier field corresponds to the service identifier;
before determining the record identifier from the value identifying the data identification field in the database, the method further comprises:
and determining the value of the data identification field corresponding to the value of the service identification field according to the value of the service identification field corresponding to the service identification in the service data.
Preferably, the identification database is constructed by the following method:
creating a blank data table and constructing a service identification field and a data identification field in the data table;
initializing the value of the service identification field as the service identification;
and initializing the value of the data identification field to a preset value.
The embodiment of the present application further provides a method for generating a record identifier, where the method includes:
receiving a service request for generating a record identifier;
generating a record identifier according to a value of a data identification field in an identification database, and the value of the data identification field changes monotonically after the record identifier is determined;
and responding to the service request.
The embodiment of the present application further provides a method for generating a record identifier, where the record identifier is used to identify service data, where the service data includes a service identifier, and the method includes:
receiving a service request for generating a record identifier;
determining the value of a data identification field corresponding to the value of a service identification field in an identification database according to the value of the service identification field corresponding to the service identification in the service data;
generating a record identifier by a value of the data identification field, and the value of the data identification field changes monotonically upon determining the record identifier;
and responding to the service request.
An embodiment of the present application further provides a device for storing service data, where the device includes: a determination unit and a storage unit, wherein:
the determining unit determines a record identifier according to the value of the data identification field in the identification database;
the storage unit stores the record identifier and the acquired service data in a service database corresponding to the service data, so that the service data is uniquely identified in the service database through the record identifier.
An embodiment of the present application further provides an apparatus for generating a record identifier, where the apparatus includes: receiving unit, generating unit and response unit, wherein:
the receiving unit receives a service request for generating a record identifier;
the generating unit generates a record identifier according to a value of a data identification field in an identification database, and the value of the data identification field changes monotonically after the record identifier is determined;
and the response unit responds to the service request.
The embodiment of the application adopts at least one technical scheme which can achieve the following beneficial effects:
after the business data is obtained, determining a record identifier according to the value of the data identification field in the identification database, and then storing the record identifier and the business data in a corresponding business database so as to enable the business data to be uniquely identified in the business database through the record identifier. Furthermore, in order to enable the business data to be uniquely identified by the record identifier in the business database, it is generally necessary to change the value for determining the record identifier after determining the record identifier, and since the record identifier is determined by a value in an identification database other than the business database and the value is unique due to the change, the determined record identifier is unique in each business database storing the business data of the business, thereby solving the problems in the prior art.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic flowchart illustrating a specific implementation process of a method for storing service data according to an embodiment of the present application;
fig. 2 is a schematic flowchart illustrating a specific implementation process of a method for storing service data according to an embodiment of the present application;
fig. 3 is a schematic diagram of interaction at each end of a method for storing service data according to an embodiment of the present application;
fig. 4 is a schematic flowchart of a specific implementation of a method for generating a record identifier according to an embodiment of the present application;
FIG. 5 is a schematic diagram of order number generation provided by an embodiment of the present application;
fig. 6 is a schematic structural diagram of a service data storage device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a record identifier generation apparatus according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of another recording identifier generation apparatus according to an embodiment of the present application.
Detailed Description
As described above, in the internet-based service, how to store service data efficiently is an important technical problem.
In the prior art, service data generated by each service processing is stored in a service database as an independent record, and a corresponding number is further allocated to the record in the storage process, so that the number can uniquely identify the record in the service database. For example, in the prior art, in the storage process, service data (referred to as service data zhang) generated by electronic payment service of zhangsan and service data (referred to as service data lie iv) generated by electronic payment service of lie si are stored in a service database a as one record respectively, and each record is also assigned with a number.
In practical applications, a situation that the traffic volume of a certain service is large usually occurs, and at this time, it is necessary to store the service data of the service through a plurality of parallel service databases. However, in the service data storage method of the prior art, in which numbers are independently allocated in service databases, numbers in a plurality of service databases may be repeated, so that a number in each service database storing service data of the service cannot uniquely represent one record. Taking the storage of the service data zhangsan and the service data lie four as an example, when the service database a and the service database B are both used for storing the service data of the electronic payment service, if the number allocated when the service data zhangsan is stored in the service database a is aa, and the number allocated when the service data lie four is stored in the service database B is bb, since the service database a and the service database B are respectively and independently allocated with numbers, the case where aa and bb are the same (for example, aa and bb are both "473") may occur, and at this time, the number cannot uniquely represent one record.
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
Example 1
Embodiment 1 provides a method for storing service data, which can be used for a server and can solve the problems in the prior art. The specific flow diagram of the method is shown in fig. 1, and the method comprises the following steps:
step S11: and acquiring service data.
The service data is usually generated in the service processing process, where the acquiring of the service data may be acquiring the service data in real time in the service processing process, or acquiring the service data from a database storing the service data afterwards, or acquiring the service data by other means. The server generally acquires the service data as well as receiving the service data. For example, for business data for acquiring electronic payment in real time, the business data may be business data sent from a financial system such as a bank to a server; when a server has a plurality of servers for providing services, a certain server can receive service data sent by other servers.
In practical applications, service data is diversified according to different services. For example, in the instant messaging service process, service data is generated, and the service data generally includes pictures, audio, video, characters, and the like; business data can also be generated in the electronic payment process, and the business data are usually forms, bank running accounts and the like; for other types of services, there will usually be corresponding service data in the service processing process.
Generally, for an enterprise, the behavior preference of a target user can be determined through analysis of business data, for example, the enterprise can analyze the preference and the bias of the user through the business data of online shopping of the user, so that the business data has a great application value to the enterprise.
Step S12: the record identifier is determined from a value identifying a data identification field in the database.
The identification database is independent of a service database for storing service data, and can be functionally used for determining a record identifier according to the identification database, and in practical application, the identification database can be in an Oracle database form, a MySQL database form, or an Excel or other database form.
In practical applications, the record identifier may be in various forms, and may generally be in a digital form (e.g., "517"), an alphabetical form (e.g., "acd"), a chinese kanji form (e.g., "a"), a combination of various forms as the record identifier (e.g., "a 189"), or other forms of record identifiers.
There are many ways to determine record identifiers, usually based on the value of the data identification field in the identification database, and several preferred schemes are listed below:
preferably, the value for identifying the data identification field in the database is determined as the record identifier.
For example, if the value identifying the data identification field in the database is "a 178", the record identifier generated is "a 178".
The method for directly using the value of the data identification field in the identification database as the record identifier is simple and easy to implement, and is suitable for application scenes with low safety requirements.
And in the second preferred scheme, the value of the data identification field in the identification database is combined with the time information generated by the service data to generate the record identifier, and the mode for generating the record identifier can integrate the time information and is suitable for some scenes needing to record service processing time.
For example, if the transaction processing time is 11/2014, the target attribute value is "813", and the generated record identifier may be "20141111813". It should be noted that, of course, this example only illustrates the date generated in conjunction with the business data, and the record identifier may also be generated in conjunction with the target attribute value for the time (e.g., 9 am). The time information may be embodied as year, month, day, hour, minute, and/or second, etc. according to actual needs, and is not limited herein.
In addition, according to actual needs, the target attribute value may also be combined with other information (for example, a region where the user performs a service, etc.) to generate a record identifier, which is not listed here.
And calculating the information abstract of the value of the data identification field in the identification database, and determining the information abstract as the record identifier, wherein the method is more suitable for the scene needing to be kept secret.
In practical applications, there are various ways to calculate the message digest of the value of the data identification field in the identification database, and the message digest may be calculated by using Md5, a hash algorithm, or other ways.
In practical applications, the form of the identification database may be various, and as shown in table 1, the identification database is a form in which only one value is recorded in the data identification field.
Table 1: first kind identification database in practical application
Data identification field
489
In the identification database shown in table 1, the data identification field records only one value from which a record identifier can be determined. It should be noted that, after the record identifier is determined according to the value, in order to ensure the uniqueness of the determined record identifier, the value of the data identification field in the identification database needs to be changed, so that the value of the data identification field in the identification database corresponds to the determined record identifier one to one.
The value identifying the data identification field in the database after determining the record identifier may typically change monotonically, either monotonically increasing or monotonically decreasing.
For example, after determining a record identifier from a value identifying a data identification field in a database, the value is monotonically changed using the following formula: r' ═ α × R + β; wherein: r is a value when the record identifier is determined, R' is a new value obtained by monotone change after the record identifier is determined, alpha and beta are preset coefficients, alpha is not equal to 0, and beta is not equal to 0 when alpha is equal to 1.
Monotonically decreasing when α is less than 0; when α is greater than 0, it is monotonically increasing. In addition, both α and β may be set to 1 in general, which may be used to record the number of generated record identifiers.
Shown in table 2 is another form of identification database having a plurality of different values recorded in the data identification field.
Table 2: second kind identification database in practical application
Figure BDA0001033205590000081
Figure BDA0001033205590000091
In the identification database shown in table 2, the data identification field records a plurality of different values, and after the record identifier is determined, values that are not used for determining the record identifier can be screened from among the values, and when a new record identifier is required, the new record identifier can be determined according to the screened values.
To facilitate practical operation, values that are not used to determine the record identifier are filtered out of the various values of the data identification field of the identification database, and the values of the data identification field in the identification database used to determine the record identifier may be marked, typically after the record identifier is determined, as a first state that has been used to determine the record identifier, i.e., the first state reflects that the corresponding value has been used to determine the record identifier. In this way, when a new record identifier needs to be determined, the new record identifier may be determined from the value marked as the second state, which is a state that is not used to determine the record identifier.
For example, the value of the data identification field in Table 2 is a positive integer between 1 and n, where 1 through 1456 have been used to determine a record identifier, which may be marked as a first state (e.g., red, etc.); 1457 to n are not used for determining the record identifier, and may be marked as the second state (as distinguished from the first state). Thus, it is possible to prevent the occurrence of,
when determining a new target attribute value, the record identifier may be determined according to any positive integer between 1457 and n.
Step S13: and storing the record identifier and the acquired service data in a corresponding service database so as to uniquely identify the service data in the service database through the record identifier.
The corresponding service database referred to herein means a service database corresponding to the service data. In practical applications, different service data are required to be stored in different service databases, for example, the instant messaging service data is stored in the instant messaging service database.
In practical applications, when the record identifier and the service data are stored in the service database, the record identifier and the service data may be generally stored in the service database as a service record, and the record identifier may also be used as a primary key of the service record for the convenience of distinguishing through the record identifier.
In addition, it should be noted that, in practical applications, a situation may occur that the same service data is split into multiple sub-service data, and the sub-service data are stored in different service databases, at this time, each sub-service data may be stored in a corresponding service database in combination with the record identifier, and the record identifier may also be used as a main key for storing the records.
In general, in order to enable service data to be uniquely identified by a record identifier in a service database, the record identifier needs to be unique in each service database storing the service data of the service. For example, the service database storing the service data of the service includes a service database X and a service database Y, and the record identifier is "689", and if "689" has uniqueness in both the service database X and the service database Y, then one service data can be uniquely identified by "689" in both the service database X and the service database Y.
In practical applications, in order to make the record identifier unique in each service database storing the service data, after the record identifier is determined, a value (referred to as a target value herein) of a data identification field in the identification database for determining the record identifier may be changed, so that when the record identifier is determined again, a new record identifier may be determined according to the new target value. The manner of changing the target value according to the disuse of the identification database may be similar to step S12, and will not be described herein.
It should be noted that, the target value may be changed and the sequence of storing the record identifier and the service data in the service database may be changed, that is, after the record identifier is determined according to the target value, the target value may be changed first, and then the record identifier and the service data are stored in the service database, or the record identifier and the service data may be stored in the service database first, and then the target value is changed, which does not affect the technical effect of the present invention.
Further, the order of step S11 and step S12 may be exchanged, that is, the record identifier may be determined first and then the service data may be obtained, or the service data may be obtained first and then the record identifier may be determined, which does not affect the implementation of the technical effect of the present invention.
By using the service storage method provided in embodiment 1, after the service data is acquired, the record identifier is determined according to the value of the data identification field in the identification database, and then the record identifier and the service data are stored in the corresponding service database, so that the service data can be uniquely identified in the service database by the record identifier. Furthermore, in order to enable the business data to be uniquely identified by the record identifier in the business database, it is generally necessary to change the value for determining the record identifier after determining the record identifier, and since the record identifier is determined by a value in an identification database other than the business database and the value is unique due to the change, the determined record identifier is unique in each business database storing the business data of the business, thereby solving the problems in the prior art.
For example, the service database storing service data of a certain service includes a service database M and a service database N, the service data to be stored includes service data a and service data B, and if the service data a is stored in the service database M (referred to as record a), the service data B is stored in the service database N (referred to as record B). When storing according to the prior art, because the service database M and the service database N are respectively and independently assigned with numbers, the numbers of the record a and the record B may be the same, so that the numbers cannot uniquely represent the service data in the process of storing the service data of the service. However, according to the embodiment of the present application, since record identifiers are generated for the record a and the record B by the identification database P other than the service database M and the service database N, respectively, and the value used for generating the record identifier is changed after one record identifier is generated, so that the generated record identifiers of the record a and the record B are not identical and both have uniqueness, the record identifier can uniquely identify the record a or the record B (that is, can uniquely identify service data).
As can be seen from the foregoing, in the embodiment of the present application, a new database, i.e., an identification database, is provided in addition to the service database, that is, the present application is provided in addition to the service database in the prior art, and a new database is also constructed, where the database (identification database) includes a data identification field, and a record identifier can be determined according to a value in the data identification field, and the record identifier has uniqueness in each service database storing the service data of the service.
Example 2
In practical applications, a same enterprise usually operates a plurality of different services, and when storing service data generated by these different services, in order to make a record identifier unique in the service data of a certain service, the service data storage method of embodiment 2 may be generally adopted for storage. As shown in fig. 2, the method steps of example 2 are as follows:
step S21: and acquiring service data, wherein the service data comprises a service identifier of a corresponding service.
For example, service data of the electronic payment service is obtained, where the service data includes a service identifier of the electronic payment service, and the service identifier can identify that the service data is service data of the electronic payment service.
Step S22: and in an identification database, determining the value of a data identification field corresponding to the value of the service identification field according to the value of the service identification field corresponding to the service identification in the service data.
The identification database here comprises, in addition to the data identification field mentioned in embodiment 1, a service identification field, the value of which corresponds to the service identification in the received service data.
As shown in table 3, the identification database in practical application includes a service identification field and a data identification field.
Table 3: third identification database in practical application
Service identification field Data identification field
DZZF 148
JSTX 217
As shown in table 3, the service identifier field has values of "dzjf" (service identifier for electronic payment) and "JSTX" (service identifier for instant messaging), and the data identifier field has corresponding values.
In practical applications, in step S22, after the service data is obtained, the service identifier in the service data is matched with each value of the service identifier field in the identifier database, the value of the corresponding service identifier field is determined according to the matching result, and then the value of the corresponding data identifier field is determined according to the value of the service identifier field.
For example, according to the data provided in table 3, after the service data of the electronic payment service is acquired, the service identifier ("dzmf") in the service data is matched with each value of the service identifier field in the identifier database to determine the corresponding value "dzmf", and then the value of the data identifier field is determined to be "148" by "dzmf".
It should be noted that, the value of the service identifier field corresponds to the service identifier in the service data, and there are various corresponding manners. For example, in the above example, the value of the service identification field is the same as the service identification; according to actual needs, the value of the service identifier after Md5 is performed can be used as the value of the service identifier field; of course, the value of the service identifier field and the service identifier may also adopt other corresponding manners.
Step S23: determining a record identifier by a value of the data identification field.
Here, the manner of determining the record identifier by the value of the data identification field is the same as that of step S12, and is not described in detail here.
Of course, after the record identifier is determined, the value of the data identification field used to determine the record identifier may also be changed.
Step S24: storing the record identifier and the acquired service data in a corresponding service database so that the service data can be uniquely identified in the service database by the record identifier.
By adopting the method provided by the embodiment 2, since the identification database includes the data identification field and the service identification field, after the service data is acquired, the value of the corresponding data identification field is determined by the value of the service identification field corresponding to the service identification in the service data, so as to determine the record identifier and store the service data.
It should be further noted that, in embodiment 2, the storage of the service data of different services is implemented by an identification database, which includes a service identification field and a data identification field. In practical applications, when an enterprise operates a plurality of services, other manners may be used to store service data generated by the services. For example, corresponding identification databases may be established for different services, where the identification databases only need to include a data identification field, and when service data of a certain service is acquired, a record identifier is generated by the identification database corresponding to the service, so that the generated record identifier has uniqueness in each service database storing the service data of the service.
In addition, in practical application, before acquiring the service data, the identification database in embodiment 2 may be constructed by the following method:
step S31: creating a blank data table and constructing a service identification field and a data identification field in the data table.
In practical application, the blank data table may be created through Excel, or may be created through Oracle, or may be created through MySQL, or may be created in other manners, and the manner of creating the blank data table is not limited herein.
And creating a service identification field and a data identification field in the created blank data table.
Step S32: and initializing the value of the service identification field into the service identification of each service.
Step S33: and initializing the value of the data identification field to a preset value.
Initialization as used herein refers to the initial assignment. The preset value may be set according to actual needs, and each value of the data identification field may be initialized to the same preset value (for example, the preset values are all set to "1"), or may be set to be different.
For example, Table 4 shows an identification database created for practical applications
Table 4: identification database created in practical application
Service identification field Data identification field
Instant messaging sign 1
Electronic payment identifier 1
In table 4, the values of the service identification field are initialized to "instant messenger identification" and "electronic payment identification", and the values of the data identification field are both initialized to "1".
To facilitate understanding of the present solution, the following may specifically describe, for example, generating an identification database, determining a record identifier by using the identification database, and storing the business data.
First, the generation of the identification database will be explained:
1. newly building a data table a;
the data table a and the service database are independent from each other, the type of the data table a is not required to be limited, and the data table a comprises 2 fields which are respectively a service identification field and a data identification field;
2. initializing a data table a;
the service identification field is initialized to each service identification, and the data identification field is initialized to "1". As shown in table 5, is an example of table a in practical application.
Table 5: table a example in practical application
Service identification field Data identification field
Order identification 1
Secondly, after the identification database (data table a) is generated, a unique identifier is generated according to the identification database;
3. acquiring service data of order service, wherein the service data comprises an order mark;
4. matching the 'order mark' with the service attribute value of the service mark field in the table a, determining the corresponding value 'order mark', wherein the value of the data mark field corresponding to the 'order mark' is '1', and the service identifier determined according to '1' is '1'.
5. The value of the data identification field (i.e., "1") is monotonically changed.
For example, a "1" may be changed to a "2" by incrementing (e.g., by 1).
6. The service identifier "1" is stored with the service data of the order service as a service record in a service database.
Fig. 3 is a schematic diagram illustrating interaction between a server and a user side and storage of service data in an interaction process. The schematic diagram includes a user side, a server, an identification database, a service database 1 to a service database N.
Step S41 is an interaction process between the user side and the server. In the process, a service processing request can be submitted to the server for the user side, and the server performs service processing according to the service processing request and responds to a result of the service processing, so that service data can be generated in the processes.
It should be noted that, the hardware device used in the process of the interaction between the user side and the server may be a mobile phone, a Personal Computer (PC), a tablet computer, and the like, which is not limited herein.
Step S42 is a process in which the server determines a record identifier from the identification database. According to the service data storage method of embodiment 2, the identification database includes a service identification field and a data identification field. The server can determine the value of the corresponding data identification field according to the matching result of the service identification in the service data and the value of the service identification field, so as to determine the record identifier.
Step S43 is the interaction process between the server and each service database. After determining the record identifier, the server may generally store the record identifier and the service data as a service record in a service database, and use the record identifier as a primary key of the service record. After storing the service data, the server may also query the service database for the service record according to the record identifier.
Example 3
Embodiment 4 of the present application provides a method for generating a record identifier, where the record identifier generated by the method can be used for storing service data in the embodiment of the present application. As shown in fig. 4, the method includes:
step S51: a service request to generate a record identifier is received.
In practical applications, not only does the storage of the business data require that the business data be uniquely identified by a record identifier, but in other application scenarios, such as a transaction process, the product or service typically identifies each transaction by an order number, which may be the generated record identifier.
Step S52: a record identifier is determined from a value identifying a data identification field in a database, and the value of the data identification field changes monotonically upon determining the record identifier.
The value of the data identification field herein changes monotonically after determining the record identifier, and the manner of the monotonic change may be the same as that in embodiment 1, and in addition, the manner of determining the record identifier according to the value of the data identification field may also be the same as that in real-time embodiment 1, and details thereof are not repeated here.
Step S53: and responding to the service request.
After determining the record identifier, responding to the service request.
By adopting the method provided by the embodiment 3 of the application, the value of the data identification field is changed after the record identifier is determined, so that the record identifier generated according to the value has uniqueness, and a foundation is laid for solving the problems in the prior art.
Fig. 5 is a schematic diagram illustrating the record identifier (order number) generated by the method during the actual goods (or services) transaction. In fig. 5, the salesperson a determines the record identifier from the identification database by means of a computing device B (which may be a PC, a mobile phone, etc.).
It should be noted that the record identifier generated in embodiment 3 may be used to identify the service data in the storage process of the service data, and generally, the service data includes a service identifier of a corresponding service. At this time, the identification database includes a data identification field and a service identification field, and a value of the service identification field corresponds to a service identification in the service data.
Then, after receiving the service request for generating the record identifier at step S51, before determining the record identifier according to the target attribute value at step S52, the method further includes: and in an identification database, determining the value of a data identification field corresponding to the value of the service identification field according to the value of the service identification field corresponding to the service identification in the service data.
Therefore, the record identifiers of the service data of different services can be generated through the same identification database, and the practical application is facilitated.
Example 4
Embodiment 4 of the present application provides a storage device for business data, which can be used to solve the problems in the prior art. As shown in fig. 6, the apparatus 60 includes: a determination unit 601 and a storage unit 602, wherein:
the determining unit 601 determines a record identifier according to a value of a data identification field in the identification database;
the storage unit 602 stores the record identifier and the obtained service data in a service database corresponding to the service data, so that the service data is uniquely identified in the service database by the record identifier.
With the apparatus 60 provided in embodiment 3 of the present application, since the apparatus 60 employs the same inventive concept as embodiment 1, the same technical effects as embodiment 1 can be obtained. In addition, the apparatus 60 may also be combined with specific hardware devices to achieve other advantages in practical applications. For example, the server may store the identifier database in a cluster cache manner, so that the access speed to the identifier database may be increased, and the record identifier may be determined according to the identifier database, thereby increasing the storage speed of the service data.
In practical applications, the determining unit 601 may include a determining subunit 6011 configured to determine a value of a data identification field in the identification database as a record identifier. In practical applications, this way of determining the record identifier is convenient to implement.
The determining unit 601 may further include a determining subunit 6012 configured to calculate an information digest of values of data identification fields in the identification database, and determine the information digest as a record identifier. The information abstract obtained by calculation is used as a record identifier, and can be used in a scene with high safety requirements.
The apparatus 60 may further comprise a first changing unit 603 after said determining unit 601, which monotonically changes said value for determining the record identifier, so as to be able to determine a new record identifier from the monotonically changed value.
The apparatus 60 may further comprise a second changing unit 604 after said determining unit 601, for marking said value for determining the record identifier as the first state, so that, among the different values of the data identification field identifying the database, a new record identifier can be determined from the value marked as the second state, said second state being a state not used for determining the record identifier.
By the first changing unit 603 or the second changing unit 604, after the record identifier is determined by the value of the data identification field in the identification database, the value for determining the record identifier is changed so that when the record identifier is determined again, a new record identifier can be directly determined from the changed record identifier.
Example 5
Embodiment 5 of the present application provides a device for generating a record identifier. As shown in fig. 7, the apparatus 70 includes: a receiving unit 701, a generating unit 702, and a responding unit 703, wherein:
the receiving unit 701 receives a service request for generating a record identifier;
the generating unit 702 generates a record identifier according to a value of a data identification field in an identification database, and the value of the data identification field changes monotonically after the record identifier is determined;
the response unit 703 responds to the service request.
With the apparatus 70 provided in embodiment 5 of the present application, since the apparatus 70 employs the same inventive concept as embodiment 3, the effects of embodiment 3 can be obtained. In addition, in practical applications, the apparatus 70 achieves other implementation effects by combining hardware devices. For example, during the storage process of the service data, the device 70 may be disposed in a server outside the service server, and the service data is stored by the record identifier generated by the device 70 in the server in association with the service server, so that the storage rate of the service data can be increased.
It should be noted that, when the record identifier generated by the device 70 is used for storing the service data, the device 70 may also be the device 80 in practical applications, because the service data usually includes a service identifier of a corresponding service. As shown in fig. 8, the apparatus 80 includes: a second receiving unit 801, a target value determining unit 802, a second generating unit 803, and a second responding unit 804, wherein:
a second receiving unit 801 that receives a service request for generating a record identifier;
a target value determining unit 802, configured to determine, in an identifier database, a value of a data identifier field corresponding to a value of a service identifier field in the service data according to the value of the service identifier field corresponding to the service identifier in the service data;
a second generating unit 803 which generates a record identifier by a value of the data identification field, and the value of the data identification field changes monotonically upon determining the record identifier;
a second response unit 804, responding to the service request.
The device 70 can generate record identifiers of service data of different services through the same identification database, which is convenient for practical application.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
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 computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (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 that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, 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 process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (8)

1. A method for storing service data is characterized by comprising the following steps:
determining a value of a data identification field corresponding to a value of a service identification field according to the value of the service identification field corresponding to the service identification in the obtained service data in an identification database, wherein the service data comprises the service identification of the corresponding service, the identification database comprises the service identification field and the data identification field, and the value of the service identification field corresponds to the service identification;
determining a record identifier according to the value of the data identification field, wherein the value of the data identification field for determining the record identifier is changed after the record identifier is determined, so that the value of the data identification field in the identification database is in one-to-one correspondence with the determined record identifier;
and storing the record identifier and the service data in service databases corresponding to the service data so as to uniquely identify the service data through the record identifier in each service database storing the service data of the service.
2. The method of claim 1, wherein the determining the record identifier based on the value identifying the data identification field in the database specifically comprises:
determining a value of a data identification field in the identification database as a record identifier; or the like, or, alternatively,
and calculating the information abstract of the value of the data identification field in the identification database, and determining the information abstract as the record identifier.
3. The method of claim 1, wherein after determining the record identifier based on a value identifying a data identification field in the database, the method further comprises:
monotonically changing a value of the data identification field used to determine the record identifier, so that a new record identifier can be determined from the monotonically changed value.
4. The method of claim 1, wherein after determining the record identifier based on a value identifying a data identification field in the database, the method further comprises:
the value of the data identification field used for determining the record identifier is marked in a first state, so that, among the various values of the data identification field identifying the database, a new record identifier can be determined from the value marked in a second state, which is a state not used for determining the record identifier.
5. The method of claim 1, wherein the identification database is constructed by:
creating a blank data table and constructing a service identification field and a data identification field in the data table;
initializing the value of the service identification field as the service identification;
and initializing the value of the data identification field to a preset value.
6. A method for generating a record identifier, wherein the record identifier is used to identify service data, and the service data includes a service identifier of a corresponding service, the method comprising:
receiving a service request for generating a record identifier;
determining a value of a data identification field corresponding to a value of a service identification field in the service data according to the value of the service identification field corresponding to the service identification in the identification database, wherein the identification database comprises the service identification field and the data identification field, and the value of the service identification field corresponds to the service identification;
generating a record identifier by the value of the data identification field, and the value of the data identification field changes monotonically after the record identifier is determined, so that the value of the data identification field in the identification database corresponds to the determined record identifier one to one;
and responding to the service request.
7. A device for storing service data, comprising: a determination unit and a storage unit, wherein:
the determining unit is configured to determine, in an identification database, a value of a data identification field corresponding to a value of a service identification field corresponding to a service identification in the acquired service data according to the value of the service identification field, and determine a record identifier according to the value of the data identification field, where the service data includes a service identification corresponding to a service, the identification database includes the service identification field and the data identification field, the value of the service identification field corresponds to the service identification, and the value of the data identification field for determining the record identifier is changed after the record identifier is determined, so that the value of the data identification field in the identification database corresponds to the determined record identifier one to one;
the storage unit stores the record identifier and the service data in service databases corresponding to the service data, so that the service data is uniquely identified by the record identifier in each service database storing the service data of the service.
8. An apparatus for generating a record identifier, comprising: a second receiving unit, a target value determining unit, a second generating unit and a second responding unit, wherein:
the second receiving unit receives a service request for generating a record identifier, where the record identifier is used to identify service data, and the service data includes a service identifier of a corresponding service;
the target value determining unit is used for determining a value of a data identification field corresponding to a value of a service identification field in the service data according to the value of the service identification field corresponding to the service identification in the service data, wherein the identification database comprises the service identification field and the data identification field, and the value of the service identification field corresponds to the service identification;
the second generating unit generates a record identifier according to the value of the data identification field, and the value of the data identification field changes monotonically after the record identifier is determined, so that the value of the data identification field in the identification database corresponds to the determined record identifier one to one;
and the second response unit responds to the service request.
CN201610488018.XA 2016-06-28 2016-06-28 Service data storage method, record identifier generation method and device Active CN106897335B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610488018.XA CN106897335B (en) 2016-06-28 2016-06-28 Service data storage method, record identifier generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610488018.XA CN106897335B (en) 2016-06-28 2016-06-28 Service data storage method, record identifier generation method and device

Publications (2)

Publication Number Publication Date
CN106897335A CN106897335A (en) 2017-06-27
CN106897335B true CN106897335B (en) 2020-11-27

Family

ID=59190557

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610488018.XA Active CN106897335B (en) 2016-06-28 2016-06-28 Service data storage method, record identifier generation method and device

Country Status (1)

Country Link
CN (1) CN106897335B (en)

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107622079A (en) * 2017-07-28 2018-01-23 阿里巴巴集团控股有限公司 Data storage, querying method and device
CN110020040B (en) * 2017-08-17 2021-07-06 北京京东尚科信息技术有限公司 Method, device and system for querying data
CN108228817B (en) * 2017-12-29 2021-12-03 华为技术有限公司 Data processing method, device and system
CN108446371B (en) * 2018-03-15 2020-10-27 平安科技(深圳)有限公司 Data back-leading method and device, computer equipment and storage medium
CN109710609B (en) * 2018-12-14 2023-08-08 中国平安人寿保险股份有限公司 Method and device for generating data table identification
CN110096436A (en) * 2019-04-12 2019-08-06 深圳壹账通智能科技有限公司 Test method, device, medium and equipment based on data-pushing compensation function
CN110263816B (en) * 2019-05-28 2024-01-19 创新先进技术有限公司 Enterprise classification method and device
CN111930738A (en) * 2020-01-16 2020-11-13 杭州隼目信息科技有限公司 Intelligent shunting processing method for form data
CN113742334A (en) * 2020-06-29 2021-12-03 北京沃东天骏信息技术有限公司 Data processing method and device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102035865A (en) * 2009-09-30 2011-04-27 阿里巴巴集团控股有限公司 Data storing and addressing methods, systems and equipment
CN102436479A (en) * 2011-10-12 2012-05-02 远光软件股份有限公司 Method and system for generating globally unique data identifier
CN104769555A (en) * 2012-06-18 2015-07-08 艾克特菲欧有限公司 Enhanced data management virtualization system
CN105447023A (en) * 2014-08-25 2016-03-30 阿里巴巴集团控股有限公司 Service identifier generation method and apparatus

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102035865A (en) * 2009-09-30 2011-04-27 阿里巴巴集团控股有限公司 Data storing and addressing methods, systems and equipment
CN102436479A (en) * 2011-10-12 2012-05-02 远光软件股份有限公司 Method and system for generating globally unique data identifier
CN104769555A (en) * 2012-06-18 2015-07-08 艾克特菲欧有限公司 Enhanced data management virtualization system
CN105447023A (en) * 2014-08-25 2016-03-30 阿里巴巴集团控股有限公司 Service identifier generation method and apparatus

Also Published As

Publication number Publication date
CN106897335A (en) 2017-06-27

Similar Documents

Publication Publication Date Title
CN106897335B (en) Service data storage method, record identifier generation method and device
CN106547784B (en) Data splitting and storing method and device
CN110287197B (en) Data storage method, migration method and device
CN107220266B (en) Method and device for creating service database, storing service data and determining service data
CN110413634B (en) Data query method, system, device and computer readable storage medium
WO2020139514A1 (en) Blockchain-based recordkeeping method and apparatus
CN107346463B (en) Method and device for training risk control model and determining model input data
JP2018514019A (en) Method and system for identifying unique mobile devices based on changes in mobile device attributes over time
CN106375360B (en) Graph data updating method, device and system
CN106529953B (en) Method and device for risk identification of business attributes
WO2018072619A1 (en) Resource scheduling method, device, and system
CN112346717A (en) Micro service system creating method, device, equipment, medium and micro service system
CN106875182B (en) Service processing method and device
CN111709769A (en) Data processing method and device
CN111506613A (en) Method, system, device and equipment for querying incidence relation of data record
CN110347678A (en) A kind of storage method of finance data, system, device and equipment
CN114153860A (en) Business data management method and device, electronic equipment and storage medium
CN110532248B (en) CMDB-based server application information acquisition and adjustment method
CN110943903B (en) Information processing method and device
CN109614548B (en) Information display method and device based on service user number change rate and storage medium
CN111177093A (en) Method, device and medium for sharing scientific and technological resources
CN111143546A (en) Method and device for obtaining recommendation language and electronic equipment
CN106874327B (en) Counting method and device for business data
CN114138787A (en) Bar code identification method, equipment and medium
CN112286976A (en) Order processing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
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: 20200924

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

Applicant after: Innovative advanced technology Co.,Ltd.

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

Applicant before: Advanced innovation technology Co.,Ltd.

Effective date of registration: 20200924

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman, British 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