Method and device for updating object

By using a mapping mechanism between a pre-defined database table and a mapping record table, the problem of needing to modify program code to update attribute types in existing technologies is solved, achieving seamless updates of attribute types and reducing the complexity of system and database operations.

CN112749173BActive Publication Date: 2025-01-07BEIJING GRIDSUM TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201911039331.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-10-29
Publication Date
2025-01-07
Estimated Expiration
2039-10-29

AI Technical Summary

Technical Problem

In existing technologies, when the type of an object's attributes increases, the program code needs to be modified to update the attribute types, which makes the operation complex.

Method used

Based on a preset database table and a mapping record table, the system detects whether the attribute types of the target object have increased, updates the mapping record table based on the increased attribute types, and maps the attribute values ​​corresponding to the increased attribute types to the preset database table.

Benefits of technology

Attribute type updates can be achieved without modifying program code, reducing the complexity of system operations and database data migration.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112749173B_ABST
    Figure CN112749173B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for updating an object. The method comprises: detecting whether the attribute type of a target object is increased based on a preset database table and object information of a preset object under a preset platform, wherein the preset database table has multiple redundant columns, and each row of data in the preset database table constitutes a target object; obtaining the increased attribute type when the attribute type of the target object is detected to be increased; updating a mapping record table based on the increased attribute type, wherein the mapping record table stores the mapping relationship between each attribute type of the target object and the corresponding column in the preset database table; mapping the attribute value corresponding to the increased attribute type to the preset database table based on the mapping record table. The present invention solves the technical problem in the prior art that when the attribute type of an object is increased, the program code needs to be changed to realize the update of the attribute type, resulting in complicated operations.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet, and in particular to a method and device for updating an object. Background Art

[0002] We are now in a society of science and technology information and an era of data analysis. In terms of online marketing, people can understand customer needs by analyzing user access behaviors through the Internet, and then recommend products to customers based on their needs, so as to improve customer experience. Among them, people can obtain user access records through some online platforms (such as WeChat, Weibo, etc.) and analyze the access records.

[0003] Taking WeChat as an example, each user who follows a WeChat public account is a fan, and the attribute data of the same fan under multiple WeChat public accounts can be associated to obtain customer attributes, where the customer attributes may include but are not limited to the contents shown in Table 1.

[0004] Table 1

[0005] Nick name gender nation province City Xiaoxian male China Guangdong Shenzhen

[0006] In the prior art, when extracting fan attributes, the extracted fan attributes are usually used to completely overwrite the corresponding data of the customer. For example, when generating customer attributes, all of the fan data is extracted to the nickname, gender, country, province, and city corresponding to the customer. If the second fan is also identified as the same customer, the fan attributes identified later will overwrite the customer's old attribute data when extracted. For example, the first fan and the second fan are the same customer, the fan attributes of the first fan include nickname, gender, and country, and the fan attributes of the second fan include nickname, gender, province, and city. When extracting the fan attributes of the second fan, the attribute data corresponding to the fan attributes of the second fan will overwrite the attribute data corresponding to the fan attributes of the first fan. That is, after extracting the fan attributes of the second fan, the attribute data corresponding to the fan attribute "country" corresponding to the customer is blank.

[0007] Moreover, when extracting attributes in the prior art, only the fan attributes corresponding to the customer attributes can be extracted. The parsed customer attributes are not dynamically read when the program is running. If a certain attribute in the fan cannot be matched to the existing customer attributes, for example, the attribute of the constellation does not appear in the customer attributes, then the attribute of the constellation cannot be extracted. If data extraction of the attribute of the constellation is required, the program code needs to be modified.

[0008] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0009] The embodiments of the present invention provide a method and device for updating an object, so as to at least solve the technical problem in the prior art that when the attribute types of an object are increased, the program code needs to be changed to implement the update of the attribute types, which causes complicated operations.

[0010] According to one aspect of an embodiment of the present invention, a method for updating an object is provided, comprising: detecting whether an attribute type of a target object is increased based on a preset database table and object information of a preset object under a preset platform, wherein the preset database table has multiple redundant columns, and each row of data in the preset database table constitutes a target object; in the case where an increase in the attribute type of the target object is detected, obtaining the increased attribute type; updating a mapping record table based on the increased attribute type, wherein the mapping record table stores a mapping relationship between each attribute type of the target object and a corresponding column in the preset database table; and mapping attribute values ​​corresponding to the increased attribute type to the preset database table based on the mapping record table.

[0011] Furthermore, the method for updating the object also includes: before detecting whether the attribute type of the target object is increased based on the preset database table, obtaining the object information of the preset object under the preset platform; detecting whether the preset object matches the target object based on the object information; and when the two match, obtaining multiple first attribute types of the preset object under the preset platform.

[0012] Furthermore, the method for updating the object also includes: detecting whether each first attribute type matches the attribute type of the target object in a preset database; when detecting a first attribute type that does not match the attribute type, determining that the attribute type of the target object is increased to obtain a second attribute type, wherein the second attribute type is the first attribute type that does not match the attribute type.

[0013] Furthermore, the method for updating an object further includes: determining that the second attribute type is an added attribute type.

[0014] Furthermore, the method for updating the object also includes: obtaining a target data type corresponding to the added attribute type; obtaining a target field identifier corresponding to a redundant column of a preset database table that meets preset conditions; associating the added attribute type with the target field identifier to obtain a mapping record; and updating a mapping record table based on the mapping record.

[0015] Furthermore, the method for updating an object also includes: obtaining a candidate field in a preset database table whose data type is a target data type and whose occupation state is an idle state; and determining a field identifier of the candidate field as a target field identifier.

[0016] Furthermore, the method for updating an object also includes: in the case where there are multiple candidate fields, sorting the multiple candidate fields based on field identifiers to obtain a sorting result; and determining the field identifier of the candidate field located at the first position as the target field identifier according to the sorting result.

[0017] According to another aspect of an embodiment of the present invention, a device for updating an object is also provided, including: a detection module, which is used to detect whether the attribute type of the target object has increased based on a preset database table and object information of the preset object under a preset platform, wherein the preset database table has multiple redundant columns, and each row of data in the preset database table constitutes a target object; an acquisition module, which is used to acquire the increased attribute type when it is detected that the attribute type of the target object has increased; an update module, which is used to update a mapping record table based on the increased attribute type, wherein the mapping record table stores a mapping relationship between each attribute type of the target object and the corresponding column in the preset database table; a mapping module, which is used to map the attribute value corresponding to the increased attribute type to the preset database table based on the mapping record table.

[0018] According to another aspect of an embodiment of the present invention, a storage medium is provided. The storage medium includes a stored program, wherein when the program is running, the device where the storage medium is located is controlled to execute the above-mentioned method for updating an object.

[0019] According to another aspect of an embodiment of the present invention, an electronic device is also provided, which includes at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other through the bus; the processor is used to call program instructions in the memory to execute the above-mentioned method of updating the object.

[0020] In an embodiment of the present invention, a method of mapping and recording fan attributes and customer attributes is adopted, and whether the attribute type of the target object is increased is detected based on the preset database table and the object information of the preset object under the preset platform. When it is detected that the attribute type of the target object has increased, the increased attribute type is obtained, and then the mapping record table is updated based on the increased attribute type. Finally, the attribute value corresponding to the increased attribute type is mapped to the preset database table based on the mapping record table.

[0021] From the above content, it can be seen that in the above process, when the attribute type of the target object increases, the value corresponding to the increased attribute type can be extracted without modifying the program code, thereby reducing the complexity of system operation. In addition, in the above process, when the attribute type in the preset database table increases, it is only necessary to map the attribute through the mapping record table, thereby reducing the complexity of database data migration.

[0022] It can be seen that the solution provided by the present application achieves the purpose of updating the attribute type without modifying the program code, thereby achieving the technical effect of reducing the complexity of database operations, and further solving the technical problem in the prior art that when the attribute type of the object increases, the program code needs to be changed to realize the complex operation caused by the update of the attribute type. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0024] Figure 1 is a flow chart of a method for updating an object according to an embodiment of the present invention;

[0025] Figure 2 is a schematic diagram of a device for updating an object according to an embodiment of the present invention; and

[0026] Figure 3 is a schematic diagram of a computing device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0029] Example 1

[0030] According to an embodiment of the present invention, a method embodiment for updating an object is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0031] Figure 1 is a flow chart of a method for updating an object according to an embodiment of the present invention. Figure 1 As shown, the method comprises the following steps:

[0032] Step S102 , based on the preset database table and the object information of the preset object under the preset platform, it is detected whether the attribute type of the target object is increased, wherein the preset database table has multiple redundant columns, and each row of data in the preset database table constitutes a target object.

[0033] In step S102, the preset database table may be a table in a database, wherein each column in the preset database table corresponds to a data type, for example, a string type, a numeric type, etc. Optionally, all columns in the preset database table except for the columns that already have attribute types are redundant columns. For example, in Table 2, columns 1 to 5 all have corresponding attribute types, and column 6 does not have a corresponding attribute type, so column 6 is a redundant column. In addition, each redundant column has a corresponding data type. For example, the data type of column 6 is a numeric type, and the data type of column 7 is a string type. In the preset database table, all columns except the redundant columns are provided with corresponding data types, and the data type of each redundant column can be set by itself.

[0034] Table 2

[0035] 1 2 3 4 5 6 7 Nick name gender nation province City Xiaoxian male China Guangdong Shenzhen

[0036] In addition, in step S102, the target object is an object composed of attribute data of the same fan under multiple preset platforms, wherein each row of data in the preset database table constitutes a target object. The above-mentioned preset platform can be an instant messaging platform, a shopping platform, etc. The preset object can be a fan who follows the preset platform, for example, a fan who follows a WeChat public account. Among them, the object information of the preset object may include but is not limited to an object identifier (for example, a nickname, a WeChat account, an avatar, an associated telephone number, etc.), an object browsing record (for example, a record of browsing articles under a WeChat public account), attention (for example, attention in a Weibo scenario), the number of fans, etc.

[0037] Optionally, the attribute type of each fan under each preset platform can be compared with the attribute type of the target object. If the attribute type of the target object does not contain a certain attribute type of the fan corresponding to the target object under a certain preset platform, it can be determined that the attribute type of the target object has increased. For example, fan A is a fan corresponding to the target object in Table 2, and fan A also has the attribute of constellation under the WeChat public account, then it can be determined that the attribute type of the target object has increased.

[0038] Step S104: when it is detected that the attribute type of the target object is increased, the increased attribute type is obtained.

[0039] Still taking Table 2 as an example, fan A is the fan corresponding to the target object in Table 2. Fan A also has the attribute "constellation" under the WeChat public account. It can be determined that the attribute type of the target object has increased, and the increased attribute type "constellation" can be extracted.

[0040] Step S106: updating the mapping record table based on the added attribute type, wherein the mapping record table stores the mapping relationship between each attribute type of the target object and the corresponding column in the preset database table.

[0041] Optionally, Table 3 shows an optional mapping record table, the first column of which indicates the attribute type of the target object, and the second column indicates the column of the attribute type in the preset database table. For example, the attribute type "nickname" is in the first column of the preset database table. In addition, when it is determined that the attribute type of the target object has been increased, the increased attribute type and the column number corresponding to the column in the preset database table are filled in the mapping record table. For example, in Table 3, "constellation" is a newly added attribute type, and the column number in the preset database table is 7.

[0042] Table 3

[0043] Nick name 1 gender 2 nation 3 province 4 City 5 constellation 7

[0044] It should be noted that the mapping record table may be a table in a preset database. In addition, the above Table 3 is only an example of a mapping record table. In practical applications, the mapping record table is not limited to the form shown in Table 3, but may also be in other forms.

[0045] Step S108: Map the attribute value corresponding to the added attribute type to the preset database table based on the mapping record table.

[0046] Optionally, after updating the mapping record table, the position of the added attribute type in the preset database table can be determined through the updated mapping record table, and then the attribute value corresponding to the added attribute type is extracted from the fan data. For example, the attribute value corresponding to "constellation" is extracted from the fan data, and the attribute value is mapped to the preset database table. The preset database table can be as shown in Table 4.

[0047] Table 4

[0048] 1 2 3 4 5 6 7 Nick name gender nation province City constellation Xiaoxian male China Guangdong Shenzhen Aries

[0049] Based on the scheme defined in the above steps S102 to S108, it can be learned that by mapping and recording the fan attributes and the customer attributes, it is detected whether the attribute type of the target object has increased based on the preset database table and the object information of the preset object under the preset platform. When it is detected that the attribute type of the target object has increased, the increased attribute type is obtained, and then the mapping record table is updated based on the increased attribute type. Finally, the attribute value corresponding to the increased attribute type is mapped to the preset database table based on the mapping record table.

[0050] It is easy to notice that in the above process, when the attribute type of the target object increases, the value corresponding to the increased attribute type can be extracted without modifying the program code, which reduces the complexity of system operation. In addition, in the above process, when the attribute type in the preset database table increases, it is only necessary to map the attribute through the mapping record table, thereby reducing the complexity of database data migration.

[0051] It can be seen that the solution provided by the present application achieves the purpose of updating the attribute type without modifying the program code, thereby achieving the technical effect of reducing the complexity of database operations, and further solving the technical problem in the prior art that when the attribute type of the object increases, the program code needs to be changed to realize the complex operation caused by the update of the attribute type.

[0052] In an optional embodiment, before detecting whether the attribute type of the target object is increased based on the preset database table, it is necessary to determine whether the preset object under the preset platform belongs to the same object as the target object. Specifically, firstly obtain the object information of the preset object under the preset platform, and then detect whether the preset object matches the target object based on the object information, wherein, if the two match, obtain multiple first attribute types of the preset object under the preset platform.

[0053] Optionally, the object identifier of the preset object can be compared with the object identifier of the target object to determine whether the two match. For example, the phone number associated with the WeChat ID of the preset object is compared to see whether it is consistent with the phone number associated with the WeChat ID of the target object. If they are consistent, it is determined that the target object in the preset database table corresponds to the relevant information of the preset object. Further, if it is determined that the two match, it is possible to further compare whether the first attribute type corresponding to the preset object matches the attribute type of the target object.

[0054] Further, in the process of detecting whether the attribute type of the target object is increased based on the preset database table and the object information of the preset object under the preset platform, firstly, it is detected whether each first attribute type matches the attribute type of the target object in the preset database, and when the first attribute type that does not match the attribute type is detected, it is determined that the attribute type of the target object is increased, and the second attribute type is obtained, and the second attribute type is determined to be the increased attribute type. Wherein, the second attribute type is the first attribute type that does not match the attribute type, for example, the attribute type of the target object includes: nickname, gender, country, province, city, and the first attribute type of the preset object includes: nickname, gender, country, number of fans, and attention, then each first attribute type is compared with the attribute type of each target object respectively, for example, the first attribute type "nickname" is compared with all the attribute types of the target object, and the comparison result indicates that the attribute type of the target object includes the "nickname" attribute, then the first attribute type "gender" is continuously detected until it is detected that the attribute "number of fans" does not exist in all the attribute types of the target object, then the "number of fans" is determined to be the second attribute type, and the "number of fans" is the increased attribute type.

[0055] Furthermore, after the added attribute type is determined, the mapping record table is updated based on the added attribute type. Specifically, first obtain the target data type corresponding to the added attribute type, and obtain the target field identifier corresponding to the redundant column of the preset database table that meets the preset conditions, then associate the added attribute type with the target field identifier to obtain a mapping record, and finally update the mapping record table based on the mapping record. For example, for the added attribute type of "number of fans", the corresponding target data type is numeric. Then detect the redundant columns in the preset database table whose data type is numeric. For example, if it is detected that the data type of the 8th column of the preset database table is numeric, then set the attribute type of the column to "number of fans", and record the mapping record of "number of fans" and the 8th column of the preset database table in the mapping record table.

[0056] It should be noted that, in the above process, the target field identifier may be, but is not limited to, the column number corresponding to the redundant column. For example, in the above example, the target field identifier is 8.

[0057] Optionally, before associating the added attribute type with the target field identifier, the target field identifier must be determined first. Specifically, first obtain a candidate field whose data type is the target data type and whose occupancy status is the idle status in the preset database table, and then determine the field identifier of the candidate field as the target field identifier. Among them, the first field whose data type is the target data type in the preset database table can be first obtained, and then the second field whose occupancy status is the idle status can be searched from the first field. For example, if the target data type is a numeric type, and the data types of the 7th, 8th and 9th columns of the redundant columns in the preset database table are numeric types, then the 7th, 8th and 9th columns can be determined to be the above-mentioned first field. However, since the 7th column has been occupied by "attention" and the 8th column is in an idle state, the identifier corresponding to the 8th column is used as the target field identifier. In addition, the second field in the preset database table can be first obtained, and then the first field whose data type is the target data type can be obtained from the second field, and the field identifier of the first field can be determined as the target field identifier. In addition, the second field and the first field whose data type is the target data type can be obtained from the preset database table respectively, and then the field identifiers of the candidate fields that are both in an idle state and whose data type is the target data type are determined as the target field identifiers. For example, the field identifiers of the second field are 7 and 9, and the field identifiers of the field whose data type is the target data type are 8 and 9, then field identifier 9 is determined as the target field identifier.

[0058] In addition, when there are multiple candidate fields, the multiple candidate fields can be sorted based on the field identifier to obtain the sorting result, and the field identifier of the candidate field located in the first position is determined as the target field identifier according to the sorting result. For example, the data types of the 7th, 8th and 9th columns of the redundant column are numeric, the 7th column is already occupied by "attention", and the 8th and 9th columns are idle and can be used as "number of fans". Since the 8th column is located before the 9th column, the identifier corresponding to the 8th column is used as the target field identifier.

[0059] From the above content, it can be seen that the method provided in the present application realizes the mapping of attribute types in the preset database table through a mapping record table. Therefore, when the attribute types are increased, the attribute types can be increased and the attributes can be extracted without rewriting the code or restarting the server, thereby reducing the complexity of database data migration.

[0060] Example 2

[0061] According to an embodiment of the present invention, there is also provided an embodiment of a device for updating an object, wherein: Figure 2 is a schematic diagram of a device for updating an object according to an embodiment of the present invention, such as Figure 2 As shown, the device includes: a detection module 201, an acquisition module 203, an update module 205 and a mapping module 207.

[0062] Among them, the detection module 201 is used to detect whether the attribute type of the target object is increased based on the preset database table and the object information of the preset object under the preset platform, wherein the preset database table has multiple redundant columns, and each row of data in the preset database table constitutes a target object; the acquisition module 203 is used to obtain the increased attribute type when it is detected that the attribute type of the target object is increased; the update module 205 is used to update the mapping record table based on the increased attribute type, wherein the mapping record table stores the mapping relationship between each attribute type of the target object and the corresponding column in the preset database table; the mapping module 207 is used to map the attribute value corresponding to the increased attribute type to the preset database table based on the mapping record table.

[0063] In an optional embodiment, the device for updating the object further includes: a first acquisition module, a first detection module, and a second acquisition module. The first acquisition module is used to acquire object information of the preset object under the preset platform before detecting the attribute type of the target object based on the preset database table; the first detection module is used to detect whether the preset object matches the target object based on the object information; and the second acquisition module is used to acquire multiple first attribute types of the preset object under the preset platform if the two match.

[0064] In an optional embodiment, the detection module includes: a second detection module and a first determination module. The second detection module is used to detect whether each first attribute type matches the attribute type of the target object in the preset database; the first determination module is used to determine that the attribute type of the target object is increased to obtain a second attribute type when a first attribute type that does not match the attribute type is detected, wherein the second attribute type is the first attribute type that does not match the attribute type.

[0065] In an optional embodiment, the device for updating the object further includes: a second determining module, configured to determine that the second attribute type is an added attribute type.

[0066] In an optional embodiment, the update module includes: a third acquisition module, a fourth acquisition module, an association module and a first update module. The third acquisition module is used to acquire the target data type corresponding to the added attribute type; the fourth acquisition module is used to acquire the target field identifier corresponding to the redundant column of the preset database table that meets the preset conditions; the association module is used to associate the added attribute type with the target field identifier to obtain a mapping record; and the first update module is used to update the mapping record table based on the mapping record.

[0067] In an optional embodiment, the fourth acquisition module includes: a fifth acquisition module, a sixth acquisition module and a third determination module. The fifth acquisition module is used to acquire a candidate field in a preset database table whose data type is a target data type and whose occupation state is an idle state; and the third determination module is used to determine that the field identifier of the candidate field is the target field identifier.

[0068] In an optional embodiment, the device for updating the object further includes: a sorting module and a fourth determination module. The sorting module is used to sort the multiple candidate fields based on the field identifiers to obtain a sorting result when there are multiple candidate fields; and the fourth determination module is used to determine the field identifier of the candidate field located at the first position as the target field identifier according to the sorting result.

[0069] It should be noted that the above-mentioned device for updating the object includes a processor and a memory, and the above-mentioned detection module, acquisition module, update module and mapping module are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize the corresponding functions.

[0070] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and by adjusting kernel parameters, the value corresponding to the added attribute type can be extracted without modifying the program code, reducing the complexity of system operation.

[0071] Example 3

[0072] An embodiment of the present invention provides a storage medium on which a program is stored. When the program is executed by a processor, the method for updating an object in the above embodiment is implemented.

[0073] Example 4

[0074] An embodiment of the present invention provides a processor, and the processor is used to run a program, wherein the method for updating an object in the above embodiment is executed when the program is run.

[0075] Example 5

[0076] An embodiment of the present invention provides a computing device, such as Figure 3 The schematic diagram of the computing device shown is composed of Figure 3 It can be seen that the computing device 30 includes a bus 301, at least one processor 302, and at least one memory 303 connected to the bus; wherein the processor and the memory communicate with each other through the bus; the processor is used to call the program instructions in the memory to execute the above-mentioned method of updating the object. The device in this article can be a server, PC, PAD, mobile phone, etc.

[0077] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program that is initialized with the following method steps: detecting whether the attribute type of the target object has increased based on a preset database table and object information of a preset object under a preset platform, wherein the preset database table has multiple redundant columns, and each row of data in the preset database table constitutes a target object; when it is detected that the attribute type of the target object has increased, obtaining the increased attribute type; updating a mapping record table based on the increased attribute type, wherein the mapping record table stores a mapping relationship between each attribute type of the target object and the corresponding column in the preset database table; and mapping the attribute value corresponding to the increased attribute type to the preset database table based on the mapping record table.

[0078] When executed on a data processing device, the above-mentioned computer program product is also suitable for executing a program initialized with the following method steps: before detecting the attribute type of the target object based on the preset database table, obtaining the object information of the preset object under the preset platform; based on the object information, detecting whether the preset object matches the target object; if the two match, obtaining multiple first attribute types of the preset object under the preset platform.

[0079] When executed on a data processing device, the above-mentioned computer program product is also suitable for executing a program initialized with the following method steps: detecting whether each first attribute type matches the attribute type of the target object in a preset database; when detecting a first attribute type that does not match the attribute type, determining that the attribute type of the target object is increased to obtain a second attribute type, wherein the second attribute type is the first attribute type that does not match the attribute type.

[0080] When executed on a data processing device, the above-mentioned computer program product is further adapted to execute a program which is initialized with the following method steps: Determining the second attribute type as an added attribute type.

[0081] When executed on a data processing device, the above-mentioned computer program product is also suitable for executing a program initialized with the following method steps: obtaining a target data type corresponding to an added attribute type; obtaining a target field identifier corresponding to a redundant column of a preset database table that meets preset conditions; associating the added attribute type with the target field identifier to obtain a mapping record; and updating a mapping record table based on the mapping record.

[0082] When executed on a data processing device, the above-mentioned computer program product is also suitable for executing a program initialized with the following method steps: obtaining a candidate field in a preset database table whose data type is a target data type and whose occupancy state is an idle state; determining that the field identifier of the candidate field is the target field identifier.

[0083] When executed on a data processing device, the above-mentioned computer program product is also suitable for executing a program initialized with the following method steps: when there are multiple candidate fields, the multiple candidate fields are sorted based on field identifiers to obtain a sorting result; and the field identifier of the candidate field located in the first position is determined as the target field identifier based on the sorting result.

[0084] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0085] In a typical configuration, the device includes one or more processors (CPU), memory and bus. The device may also include input / output interface, network interface and the like.

[0086] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip. The memory is an example of a computer-readable medium.

[0087] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules 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 disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0088] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0089] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0090] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for updating an object, characterized in that: include: Detecting whether the attribute type of the target object is increased based on the object information of the preset database table and the preset object under the preset platform, wherein the preset database table has multiple redundant columns, and each row of data in the preset database table constitutes a target object; When detecting that the attribute type of the target object is increased, acquiring the increased attribute type; Based on the added attribute type, a mapping record table is updated, wherein the mapping record table stores a mapping relationship between each attribute type of the target object and a corresponding column in the preset database table; Mapping the attribute value corresponding to the added attribute type to the preset database table based on the mapping record table; Before detecting whether the attribute type of the target object is increased based on the preset database table and the object information of the preset object under the preset platform, the method further includes: obtaining the object information of the preset object under the preset platform; detecting whether the preset object matches the target object based on the object information; and if the two match, obtaining a plurality of first attribute types of the preset object under the preset platform; Wherein, detecting whether the attribute type of the target object is increased based on the preset database table and the object information of the preset object under the preset platform includes: detecting whether each of the first attribute types matches the attribute type of the target object in the preset database table; when detecting the first attribute type that does not match the attribute type of the target object, determining that the attribute type of the target object is increased, and obtaining a second attribute type, wherein the second attribute type is the first attribute type that does not match the attribute type of the target object; and determining that the second attribute type is the increased attribute type; Wherein, updating the mapping record table based on the added attribute type includes: obtaining a target data type corresponding to the added attribute type; obtaining a target field identifier corresponding to a redundant column of the preset database table that meets a preset condition; associating the added attribute type with the target field identifier to obtain a mapping record; and updating the mapping record table based on the mapping record; Obtaining the target field identifier corresponding to the redundant column of the preset database table that meets the preset conditions includes: obtaining a candidate field in the preset database table whose data type is the target data type and whose occupancy state is an idle state; and determining the field identifier of the candidate field as the target field identifier.

2. The method according to claim 1, characterized in that The method further comprises: In the case where there are multiple candidate fields, sorting the multiple candidate fields based on the field identifiers to obtain a sorting result; The field identifier of the candidate field located at the first position is determined as the target field identifier according to the sorting result.

3. A device for updating an object, characterized in that: include: A detection module, used to detect whether the attribute type of the target object is increased based on a preset database table and object information of a preset object under a preset platform, wherein the preset database table has a plurality of redundant columns, and each row of data in the preset database table constitutes a target object; An acquisition module, configured to acquire the added attribute type when detecting that the attribute type of the target object is increased; An updating module, configured to update a mapping record table based on the added attribute type, wherein the mapping record table stores a mapping relationship between each attribute type of the target object and a corresponding column in the preset database table; A mapping module, used to map the attribute value corresponding to the added attribute type to the preset database table based on the mapping record table; The device for updating an object further includes: a first acquisition module, used to acquire object information of a preset object under a preset platform before detecting whether the attribute type of the target object is increased based on the preset database table and the object information of the preset object under the preset platform; a first detection module, used to detect whether the preset object matches the target object based on the object information; and a second acquisition module, used to acquire multiple first attribute types of the preset object under the preset platform if the two match; The detection module includes: a second detection module, used to detect whether each of the first attribute types matches the attribute type of the target object in the preset database table; a first determination module, used to determine that the attribute type of the target object is increased when a first attribute type that does not match the attribute type of the target object is detected, and obtain a second attribute type, wherein the second attribute type is the first attribute type that does not match the attribute type of the target object; and a second determination module, used to determine that the second attribute type is the increased attribute type; The update module includes: a third acquisition module for acquiring a target data type corresponding to the added attribute type; a fourth acquisition module for acquiring a target field identifier corresponding to a redundant column of the preset database table that meets a preset condition; an association module for associating the added attribute type with the target field identifier to obtain a mapping record; and a first update module for updating the mapping record table based on the mapping record. Among them, the fourth acquisition module includes: a fifth acquisition module, used to obtain a candidate field in the preset database table whose data type is the target data type and whose occupancy status is an idle status; a third determination module, used to determine that the field identifier of the candidate field is the target field identifier.

4. A storage medium, characterized in that: The storage medium includes a stored program, wherein when the program is executed, the device where the storage medium is located is controlled to execute the method for updating an object as claimed in any one of claims 1 to 2.

5. An electronic device, characterized in that: The electronic device includes at least one processor, and at least one memory and a bus connected to the processor; Wherein, the processor and the memory communicate with each other through the bus; The processor is used to call the program instructions in the memory to execute the method for updating an object as described in any one of claims 1 to 2.

Citation Information

Patent Citations

  • Field adding method and system of database

    CN104063409A

  • Dynamic field implementation method for database table in customer service center

    CN1253342A