CN116303369A - Automatic coding method and device based on database, electronic equipment and medium - Google Patents

Automatic coding method and device based on database, electronic equipment and medium Download PDF

Info

Publication number
CN116303369A
CN116303369A CN202310530824.9A CN202310530824A CN116303369A CN 116303369 A CN116303369 A CN 116303369A CN 202310530824 A CN202310530824 A CN 202310530824A CN 116303369 A CN116303369 A CN 116303369A
Authority
CN
China
Prior art keywords
field
automatic coding
automatic
coding
value
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.)
Pending
Application number
CN202310530824.9A
Other languages
Chinese (zh)
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.)
Fitow Tianjin Detection Technology Co Ltd
Original Assignee
Fitow Tianjin Detection Technology 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 Fitow Tianjin Detection Technology Co Ltd filed Critical Fitow Tianjin Detection Technology Co Ltd
Priority to CN202310530824.9A priority Critical patent/CN116303369A/en
Publication of CN116303369A publication Critical patent/CN116303369A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/21Design, administration or maintenance of databases
    • G06F16/211Schema design and management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

The embodiment of the invention discloses an automatic coding method, an automatic coding device, electronic equipment and a medium based on a database, wherein the automatic coding method based on the database comprises the following steps: acquiring a new field of a current service table of a current database; under the condition that the newly added field is determined to be matched with a target field, acquiring automatic coding configuration data matched with the target field; determining an automatic coding mode according to the automatic coding configuration data, and performing automatic coding according to the automatic coding mode to obtain an automatic coding field value; and filling the field value of the newly added field according to the automatic coding field value. The technical scheme of the embodiment of the invention can realize the automatic encoding processing of the database fields according to the requirements and improve the data processing efficiency based on the database.

Description

Automatic coding method and device based on database, electronic equipment and medium
Technical Field
The embodiment of the invention relates to the field of data processing, in particular to an automatic coding method, an automatic coding device, electronic equipment and a medium based on a database.
Background
In specific scenarios such as production schedule, material management table and task execution table filling, field codes with certain rules or specific formats are required to be generated for display.
In carrying out the invention, the inventors have found that in conventional field coding rules, the coding rules are typically coded in the system, which means that if the coding rules need to be modified, the source code of the application needs to be modified. Such a way is very inflexible and is also prone to errors and the system has potential safety hazards. Meanwhile, in the prior art, under the condition that the complexity of the system service is continuously increased and the same type of scene, the design of the table field coding rule is required to be independently carried out every time one service scene is newly added, so that the development cost is greatly increased.
Disclosure of Invention
The embodiment of the invention provides an automatic coding method, an automatic coding device, electronic equipment and a medium based on a database, which can realize the automatic coding processing of database fields according to requirements and improve the data processing efficiency based on the database.
According to an aspect of the present invention, there is provided an automatic encoding method based on a database, including:
acquiring a new field of a current service table of a current database;
under the condition that the newly added field is determined to be matched with a target field, acquiring automatic coding configuration data matched with the target field;
determining an automatic coding mode according to the automatic coding configuration data, and performing automatic coding according to the automatic coding mode to obtain an automatic coding field value;
And filling the field value of the newly added field according to the automatic coding field value.
According to another aspect of the present invention, there is provided an automatic encoding apparatus based on a database, including:
the new added field acquisition module is used for acquiring the new added field of the current service table of the current database;
the automatic coding configuration data acquisition module is used for acquiring automatic coding configuration data matched with the target field under the condition that the newly added field is determined to be matched with the target field;
the automatic coding field value acquisition module is used for determining an automatic coding mode according to the automatic coding configuration data and carrying out automatic coding according to the automatic coding mode to obtain an automatic coding field value;
and the automatic coding field value generating module is used for filling the field value of the newly added field according to the automatic coding field value.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the database-based auto-encoding method of any one of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to implement the database-based automatic encoding method according to any one of the embodiments of the present invention when executed.
According to the technical scheme provided by the embodiment of the invention, the newly added field of the current service table of the current database is obtained, under the condition that the newly added field is determined to be matched with the target field, the automatic coding configuration data matched with the target field is obtained, then the automatic coding mode is determined according to the automatic coding configuration data, the automatic coding mode is used for automatic coding to obtain the automatic coding field value, finally the field value of the newly added field is filled according to the automatic coding field value, the problem that the field of the database table cannot be automatically coded according to the requirement in the conventional database operation is solved, the automatic coding processing of the database field according to the requirement can be realized, and the data processing efficiency based on the database is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of an automatic encoding method based on a database according to a first embodiment of the present invention;
FIG. 2 is a flowchart of an automatic encoding method based on a database according to a second embodiment of the present invention;
FIG. 3 is a flowchart of another database-based automatic encoding method according to a second embodiment of the present invention;
FIG. 4 is a schematic diagram of an automatic encoding device based on a database according to a third embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to a fourth embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
It should be noted that the term "object" and the like in the description of the present invention and the claims and the above drawings are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the invention described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
Fig. 1 is a flowchart of an automatic encoding method based on a database, which is provided in an embodiment of the present invention, where the embodiment of the present invention is applicable to a case where an automatic encoding needs to be performed on a newly added field in a database service table, where the method may be performed by an automatic encoding device based on a database, where the device may be implemented by software and/or hardware, and may be generally integrated in an electronic device, where the electronic device may be a terminal device or a server device, so long as the current database can be operated, and the embodiment of the present invention does not limit a specific device type of the electronic device. Accordingly, as shown in fig. 1, the method includes the following operations:
S110, obtaining a new field of a current service table of the current database.
The current database may be a database that currently has a need to automatically generate encoded data. The current database may be any type of database type, and the embodiment of the present invention does not limit the type of database of the current database. The current service table may be a data table requiring field auto-encoding processing. The newly added field of the current service table may be a field in the service table where an automatic code generation is required.
In the embodiment of the invention, a data table needing field automatic coding processing is firstly searched in a current database to be used as a current service table, or a data table is newly built in the current database to be used as the current service table, and then a new field is acquired by the current service table. The current business table may be a new blank table of a production plan schedule table, a production plan management table, a material demand schedule table and a production plan execution table, or may be a historical data table in which data has been stored. In the embodiment of the invention, the type of the current service table in the current database is not limited.
S120, under the condition that the newly added field is determined to be matched with the target field, acquiring automatic coding configuration data matched with the target field.
The target field refers to a field selected from the automatic coding rule to be coded when data is newly added, and may be a pre-configured field type, that is, a field type to be automatically coded. The auto-code configuration data may be specification data configured for the target field, and auto-code rules and modes may be determined for auto-coding the newly added field of the service table.
In the embodiment of the invention, the newly added field in the current service table is obtained through the steps, and the newly added field in the current service table can be matched with the target field through response. When the new field of the data table in the database can be matched with the target field, the automatic coding configuration data associated with the current database is indicated, and the automatic coding processing can be performed on the current service table field by acquiring the automatic coding configuration data. When the newly added field of the data table in the database cannot be matched with the target field, the fact that the automatic coding configuration data associated with the current database does not exist in the database is indicated, and therefore automatic coding processing of the business table field cannot be carried out by acquiring the automatic coding configuration data.
S130, determining an automatic coding mode according to the automatic coding configuration data, and performing automatic coding according to the automatic coding mode to obtain an automatic coding field value.
The automatic encoding mode may be an encoding mode followed by automatic encoding of the database field. The auto-code field value may be a field value generated by encoding a newly added field in the database table according to an auto-code manner.
It should be noted that, the automatic coding configuration data obtained by the above steps can determine an automatic coding mode of the newly added field of the service table in the current database, and automatically code the newly added field of the service table in the current database according to the automatic coding mode to obtain an automatic coding field value. The automatic coding mode may be a combination mode of multiple fields in the database service table, or may be a coding mode of field contents in a single field in the database service table.
S140, filling the field value of the newly added field according to the automatic coding field value.
In the embodiment of the invention, the automatic coding field value of the database table field can be obtained by the steps, and then the field value of the newly added field can be filled according to the automatic coding field value. For example, if the business form is a production schedule, the automatically encoded fields may be used to generate work orders, task orders, and report work orders, etc., associated with the current production schedule.
According to the technical scheme provided by the embodiment of the invention, the newly added field of the current service table of the current database is obtained, under the condition that the newly added field is determined to be matched with the target field, the automatic coding configuration data matched with the target field is obtained, then the automatic coding mode is determined according to the automatic coding configuration data, the automatic coding mode is used for automatic coding to obtain the automatic coding field value, finally the field value of the newly added field is filled according to the automatic coding field value, the problem that the field of the database table cannot be automatically coded according to the requirement in the conventional database operation is solved, the automatic coding processing of the database field according to the requirement can be realized, and the data processing efficiency based on the database is improved.
Example two
Fig. 2 is a flowchart of an automatic encoding method based on a database according to a second embodiment of the present invention, where the present embodiment is implemented based on the foregoing embodiment, and in the present embodiment, various specific alternative implementations of obtaining automatic encoding configuration data for matching a target field and performing automatic encoding according to an automatic encoding manner are provided to obtain an automatic encoding field value. Accordingly, as shown in fig. 2, the method of this embodiment may include:
S210, displaying an automatic coding configuration interface to a user.
S220, responding to the automatic coding configuration instruction input by the user based on the automatic coding configuration interface, and generating the automatic coding configuration data.
S230, receiving target associated data input by the user based on the automatic coding configuration interface; the target association data may include a target field, or the target association data may include a target field and a target service table.
The automatic coding configuration interface can be an interface for displaying and designing coding modes. The auto-code configuration instructions may be instructions for generating auto-code configuration data. The target association data may be a plurality of table field information in the service table, and may also be a plurality of table fields in the service table and information associated with the service table.
In the embodiment of the invention, an automatic coding configuration interface is firstly displayed for a user, so that the user can design an automatic coding mode for each business table field in the database at the automatic coding configuration interface. And generating the automatic coding configuration data by responding to the automatic coding configuration instruction input by the user based on the automatic coding configuration interface. Further, the target field input by the user based on the automatic coding configuration interface can be received, or the target service table input by the user based on the automatic coding configuration interface and the target field in the target service table can be received.
S240, establishing an association relationship between the automatic coding configuration data and the target association data in response to the coding association instruction input by the user.
Wherein the code association instruction may be an instruction for designing field coding rules. The target association data may be respective field values in the current traffic table.
Alternatively, the association relationship between the auto-code configuration data and the target association data may be established by responding to a code association instruction input by a user at the auto-code configuration interface.
S250, judging whether the newly added field is matched with the target field, if so, executing the step S260, otherwise, executing the step S290.
S260, acquiring the automatic coding configuration data matched with the target field.
In an optional embodiment, in a case that it is determined that the new field matches the target field, acquiring the auto-coding configuration data that matches the target field may include: matching the newly added field with the target field through a trigger configured by the current service table; and under the condition that the newly added field is matched with the target field, automatically triggering and accessing an automatic coding configuration data list through the trigger so as to search the automatic coding configuration data according to the index association relation of the target field stored in the automatic coding configuration data list.
Wherein the auto-code configuration data list may be a set of code rules associated with the data table fields that are custom designed by a user. The index association of the target field may be an index value set to facilitate finding matching auto-coded configuration data.
In the embodiment of the invention, under the condition that new data is inserted into the current service table of the database, the trigger configured by the current service table is automatically triggered, and then the newly added field is matched with the target field. And accessing the automatic coding configuration data list under the condition that the newly added field and the target field are mutually matched, and searching the automatic coding configuration data according to the index association relation of the target field stored in the automatic coding configuration data list. Wherein the auto-code configuration data list includes one or more auto-code configuration data. In the embodiment of the invention, the number of the automatic coding configuration data in the automatic coding configuration data list is not limited.
S270, determining an automatic coding mode according to the automatic coding configuration data, and performing automatic coding according to the automatic coding mode to obtain an automatic coding field value.
In an alternative embodiment, the initial field value of the newly added field may be null; the determining an automatic coding mode according to the automatic coding configuration data, and performing automatic coding according to the automatic coding mode to obtain an automatic coding field value may include: determining automatically coded fixed code content and non-fixed code content according to the automatically coded configuration data; determining an automatic coding rule of the non-fixed coding content according to the automatic coding configuration data; generating a fixed code field value according to the fixed code content, and generating a non-fixed code field value matched with the non-fixed code content according to the automatic code rule; and combining the fixed code field value and the non-fixed code field value to obtain the automatic code field value.
Wherein the fixed encoded content may be fixed, unchanged encoded content. The non-stationary encoded content may be encoded content that can be generated according to certain regular changes in accordance with the traffic demand. The auto-encoding rules may be rules that are followed by the auto-generation of non-stationary encoded content. The non-fixed encoded field value may be a field value generated by non-fixed encoded content according to an automatic encoding rule.
In the embodiment of the invention, the automatic coding rules of the fixed coding content, the non-fixed coding content and the non-fixed coding content which are automatically coded in the current service table can be obtained by the automatic coding configuration data, then the fixed coding field value is generated according to the fixed coding content, the non-fixed coding field value matched with the non-fixed coding content is generated according to the automatic coding rules, and finally the fixed coding field value and the non-fixed coding field value are combined to obtain the automatic coding field value. Wherein, the fixed code content can be modified according to the service requirement, and the fixed code content can be set to be empty.
In a specific example, assuming that the current business table may be a production schedule table, the database table fields that may be included in the production schedule table include a year field, a month field, a date field, a serial number field, a fixed field, and the like. The fixed code content may be a fixed field, the non-fixed code content may be a year field, a month field, a date field, a serial number field, etc., and the combination mode of the fixed code field value and the non-fixed code field value may be "fixed code field value+year field+month field+date field". The fixed code field value may be generated according to the fixed code content in the production schedule, for example, the fixed code field value may be "SC", the non-fixed code field value of the year field for generating the non-fixed code content match according to the automatic code rule may be "2023", the non-fixed code field value of the month field may be "03", the non-fixed code field value of the date field may be "09" and the non-fixed code field value of the serial number field may be "001", and finally, the fixed code field value and the non-fixed code field value may be combined, for example, "SC20230309001", and in the embodiment of the present invention, the combination manner of the fixed code field value and the non-fixed code field value is not limited.
In an alternative embodiment, the non-stationary encoded content may include date encoded content and serial number encoded content; the generating the non-fixed encoding field value matched with the non-fixed encoding content according to the automatic encoding rule may include: determining a date coding mode of the date coding content and a serial number coding mode of the serial number coding content according to the automatic coding rule; automatically encoding according to the date encoding mode to generate a date encoding value, and automatically encoding according to the serial number encoding mode to generate a serial number encoding value; and combining the date code value and the serial number code value to obtain the non-fixed code field value.
The date code content may be code content representing date information in the service table. The serial number encoded content may be encoded content representing data serial number information in the service table. The date encoding method may be an encoding method for automatically encoding the date encoded content. The serial number coding scheme may be a coding scheme for automatically coding serial number coding contents. The date code value may be a field value generated by the date code content in a date code manner. The serial number coding value can be a field value generated by serial number coding content according to a serial number coding mode.
Optionally, the date code content and the serial number code content in the automatically coded non-fixed code content in the current service table can be obtained by the automatic code configuration data, then the date code mode of the date code content and the serial number code mode of the serial number code content are determined according to the automatic code rule, further the date code value is automatically coded according to the date code mode, the serial number code value is automatically coded according to the serial number code mode, and finally the date code value and the serial number code value are randomly combined to obtain the non-fixed code field value.
In an optional embodiment, the generating the running number code value according to the running number code manner by automatic coding may include: determining a base coding reference unit of the serial number coding mode according to the date coding mode; determining a serial number initial coding value and a coding step length according to the serial number coding mode; automatically encoding according to the serial number initial encoding value and the encoding step length to generate an absolute serial number; and generating the serial number coding value according to the base coding reference unit and the absolute serial number.
Wherein, the base code reference unit may be a unit of time such as "year", "month" and "day" in the date code content. The initial serial number code value may be the code value of serial number code content in the first piece of data in the service table. The coding step length can be the numerical length of the water number change of two adjacent data streams in the service table. An absolute running number may be a running number consisting of a series of pure numbers.
In the embodiment of the invention, the standard coding reference units of the serial number coding mode, such as the units of the year, month and day, and the like, can be determined according to the date coding mode. And determining a serial number initial coding value and a coding step length according to a serial number coding mode, further automatically coding to generate an absolute serial number, and finally generating a serial number coding value according to a datum coding reference unit and the absolute serial number.
In a specific embodiment, the reference coding reference unit of the serial number coding mode may be determined according to the serial number coding mode, and the reference coding reference unit may be "year", "month" and "day" in the date coding content. The initial coding value of the serial number and the coding step length can be determined according to the serial number coding mode, the initial coding value of the serial number can be 1, and the coding step length can be 2, 3 or 5. If the initial code value of the running number is 1, the code step size is 2, the absolute running number of the first piece of data may be "001", the absolute running number of the second piece of data may be "003", and so on. Further, the responsive serial number code value may be generated from the absolute serial number of the base code reference unit. In the embodiment of the invention, the initial coding value of the serial number and the numerical value of the coding step length are not limited, and can be any natural number.
In an alternative embodiment, the initial field value of the newly added field is null; the determining an automatic coding mode according to the automatic coding configuration data, and performing automatic coding according to the automatic coding mode to obtain an automatic coding field value may include: taking the initial field value of the newly added field as an automatic coding initial value of the automatic coding configuration data; and performing automatic coding according to the automatic coding mode determined by the automatic coding configuration data and the automatic coding initial value to obtain an automatic coding field value.
Wherein the auto-code initial value may be a start field value in the auto-code configuration data.
In the embodiment of the invention, a user can perform self-defined setting on the initial field value of the newly added field, and take the initial field value of the newly added field as the automatic coding initial value of the automatic coding configuration data, further, an automatic coding mode and an automatic coding initial value are obtained according to the automatic coding configuration data to perform automatic coding on the field in the service table, and further, an automatic coding field value is obtained. Through the steps, the automatic coding configuration data can be flexibly configured, when small-range adjustment exists, only the initial field value of the newly added field is required to be modified, and the automatic coding configuration data is not required to be updated and modified greatly.
S280, filling the field value of the newly added field according to the automatic coding field value.
S290, the field value of the newly added field is not filled, and the flow is ended.
In the embodiment of the invention, when the newly added field and the target field can be matched, the field value of the newly added field can be filled according to the automatic coding field value obtained by the steps. It is easy to understand that when the newly added field cannot be matched with the target field, the automatically encoded field value cannot be obtained, so the field value of the newly added field is not filled and the flow is ended. The embodiment designs the processing steps of the non-setting fields, and the non-setting fields cannot be coded, namely the non-matching condition is met, so that the integrity of the whole flow is ensured, and the probability of flow failure is reduced.
Fig. 3 is a flowchart of another automatic encoding method based on a database according to the second embodiment of the present invention, as shown in fig. 3, automatic encoding configuration data in the database may be named as "encoding rule table", that is, "encoding_rule_table", and a service table in the database that is associated with an automatic encoding manner may be named as "service table", that is, "business_table_name", and data in the automatic encoding configuration interface may be extracted and stored in the encoding rule table of the database. When the service table has new data, a trigger in the service table can be triggered. Further, a name for identifying the encoding rule is set, and the name for identifying the encoding rule may be "encoding_run_name", while associating the encoding rule with a service table in the database. Wherein, the name field of the coding rule needs to be stored in the business form in the database. After the above operation is completed, a specific rule needs to be set for the coding rule table, which may be "yyyy" with the year field set to 4 bits or "yy" with 2 bits, and in the embodiment of the present invention, the number of bits of the year field is not limited. The month field may be "mm" of 2 bits, the date field may be "dd" of 2 bits, the fixed field may be "fixed character" and the serial number field may be "serial number". The serial number generation rule may be "from 1 self-increment each year, from 1 self-increment each month, and from 1 self-increment each day", and the custom configuration rule generation manner may be obtained by combining and splicing a fixed code field value and a non-fixed code field value. Further, a trigger is added in the service table of the database, so that when new data is inserted into the service table, the trigger can be responded and whether the current service table has the inter-related coding rule or not can be searched. If the field exists, selecting the field in the service table and automatically encoding the corresponding encoding rule, if the field does not exist, not encoding the field in the service table, and ending the flow.
It is easy to understand that the technical scheme of the embodiment of the invention can help the user to manage the coding rules more flexibly. The user is free to define the encoding rules and associate them with fields in the database table. The implementation mode of the dynamic binding coding rule improves the flexibility and expansibility of the system and simplifies the maintenance and management of the coding rule.
According to the technical scheme, the automatic coding configuration interface can be displayed for the user, the automatic coding configuration data is generated in response to the automatic coding configuration instruction input by the user, meanwhile, the target associated data input by the user is received, and the association relationship between the automatic coding configuration data and the target associated data is established through the coding associated instruction input by the user. Under the condition that the newly added field and the target field are mutually matched, automatic coding configuration data matched with the target field are obtained, an automatic coding mode is obtained according to the automatic coding configuration data, the fields are automatically coded according to the automatic coding mode to obtain automatic coding field values, and finally the field values of the newly added fields are filled according to the automatic coding field values, so that the problem that automatic coding of database table fields cannot be achieved under the condition that the complexity of system business is continuously increased in the same type of scene is solved.
Example III
Fig. 4 is a schematic diagram of an automatic encoding device based on a database according to a third embodiment of the present invention, as shown in fig. 4, where the device includes: a new field acquisition module 310, an auto code configuration data acquisition module 320, an auto code field value acquisition module 330, and an auto code field value generation module 340, wherein:
the new field acquisition module 310 is configured to: and obtaining a new field of the current service table of the current database.
An automatic encoding configuration data acquisition module 320, configured to: under the condition that the newly added field is determined to be matched with a target field, acquiring automatic coding configuration data matched with the target field;
an automatic encoding field value acquisition module 330, configured to: determining an automatic coding mode according to the automatic coding configuration data, and performing automatic coding according to the automatic coding mode to obtain an automatic coding field value;
an auto-code field value generation module 340 for: and filling the field value of the newly added field according to the automatic coding field value.
According to the technical scheme provided by the embodiment of the invention, the newly added field of the current service table of the current database is obtained, under the condition that the newly added field is determined to be matched with the target field, the automatic coding configuration data matched with the target field is obtained, then the automatic coding mode is determined according to the automatic coding configuration data, the automatic coding mode is used for automatic coding to obtain the automatic coding field value, finally the field value of the newly added field is filled according to the automatic coding field value, the problem that the field of the database table cannot be automatically coded according to the requirement in the conventional database operation is solved, the automatic coding processing of the database field according to the requirement can be realized, and the data processing efficiency based on the database is improved.
Optionally, the database-based automatic encoding device further includes an association relationship establishment module, specifically configured to: displaying an automatic coding configuration interface to a user; generating the automatic coding configuration data in response to an automatic coding configuration instruction input by the user based on the automatic coding configuration interface; receiving target associated data input by the user based on the automatic coding configuration interface; wherein the target associated data comprises a target field, or the target associated data comprises a target field and a target service table; and establishing an association relationship between the automatic coding configuration data and the target association data in response to the coding association instruction input by the user.
Optionally, the automatic encoding configuration data acquisition module 320 is specifically configured to: matching the newly added field with the target field through a trigger configured by the current service table; and under the condition that the newly added field is matched with the target field, automatically triggering and accessing an automatic coding configuration data list through the trigger so as to search the automatic coding configuration data according to the index association relation of the target field stored in the automatic coding configuration data list.
Alternatively, the initial field value of the newly added field may be null; the automatic encoding field value obtaining module 330 is further configured to: determining automatically coded fixed code content and non-fixed code content according to the automatically coded configuration data; determining an automatic coding rule of the non-fixed coding content according to the automatic coding configuration data; generating a fixed code field value according to the fixed code content, and generating a non-fixed code field value matched with the non-fixed code content according to the automatic code rule; and combining the fixed code field value and the non-fixed code field value to obtain the automatic code field value.
Optionally, the non-fixed code content includes date code content and serial number code content; the automatic encoding field value obtaining module 330 is further configured to: determining a date coding mode of the date coding content and a serial number coding mode of the serial number coding content according to the automatic coding rule; automatically encoding according to the date encoding mode to generate a date encoding value, and automatically encoding according to the serial number encoding mode to generate a serial number encoding value; and combining the date code value and the serial number code value to obtain the non-fixed code field value.
Optionally, the automatic encoding field value obtaining module 330 is further configured to: determining a base coding reference unit of the serial number coding mode according to the date coding mode; determining a serial number initial coding value and a coding step length according to the serial number coding mode; automatically encoding according to the serial number initial encoding value and the encoding step length to generate an absolute serial number; and generating the serial number coding value according to the base coding reference unit and the absolute serial number.
Optionally, the initial field value of the newly added field is not null; the automatic encoding field value obtaining module 330 is further configured to: taking the initial field value of the newly added field as an automatic coding initial value of the automatic coding configuration data; and performing automatic coding according to the automatic coding mode determined by the automatic coding configuration data and the automatic coding initial value to obtain an automatic coding field value.
The automatic coding device based on the database can execute the automatic coding method based on the database provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method. Technical details not described in detail in this embodiment may be referred to the database-based automatic encoding method provided in any embodiment of the present invention.
Example IV
Fig. 5 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as database-based automatic encoding methods.
In some embodiments, the database-based automatic encoding method may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as the storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the database-based automatic encoding method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the database-based automatic encoding method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.

Claims (10)

1. An automatic encoding method based on a database, comprising:
acquiring a new field of a current service table of a current database;
under the condition that the newly added field is determined to be matched with a target field, acquiring automatic coding configuration data matched with the target field;
determining an automatic coding mode according to the automatic coding configuration data, and performing automatic coding according to the automatic coding mode to obtain an automatic coding field value;
and filling the field value of the newly added field according to the automatic coding field value.
2. The method of claim 1, further comprising, prior to said obtaining a current service table newly added field of a current database:
displaying an automatic coding configuration interface to a user;
generating the automatic coding configuration data in response to an automatic coding configuration instruction input by the user based on the automatic coding configuration interface;
receiving target associated data input by the user based on the automatic coding configuration interface; wherein the target associated data comprises a target field, or the target associated data comprises a target field and a target service table;
and establishing an association relationship between the automatic coding configuration data and the target association data in response to the coding association instruction input by the user.
3. The method of claim 1, wherein, in the case where the newly added field is determined to match a target field, obtaining the auto-code configuration data for the target field match comprises:
matching the newly added field with the target field through a trigger configured by the current service table;
and under the condition that the newly added field is matched with the target field, automatically triggering and accessing an automatic coding configuration data list through the trigger so as to search the automatic coding configuration data according to the index association relation of the target field stored in the automatic coding configuration data list.
4. The method of claim 1, wherein an initial field value of the newly added field is null; the automatic coding mode is determined according to the automatic coding configuration data, and automatic coding is performed according to the automatic coding mode to obtain an automatic coding field value, which comprises the following steps:
determining automatically coded fixed code content and non-fixed code content according to the automatically coded configuration data;
determining an automatic coding rule of the non-fixed coding content according to the automatic coding configuration data;
generating a fixed code field value according to the fixed code content, and generating a non-fixed code field value matched with the non-fixed code content according to the automatic code rule;
And combining the fixed code field value and the non-fixed code field value to obtain the automatic code field value.
5. The method of claim 4, wherein the non-stationary encoded content comprises date encoded content and serial number encoded content;
the generating the non-fixed coding field value matched with the non-fixed coding content according to the automatic coding rule comprises the following steps:
determining a date coding mode of the date coding content and a serial number coding mode of the serial number coding content according to the automatic coding rule;
automatically encoding according to the date encoding mode to generate a date encoding value, and automatically encoding according to the serial number encoding mode to generate a serial number encoding value;
and combining the date code value and the serial number code value to obtain the non-fixed code field value.
6. The method of claim 5, wherein the automatically encoding according to the running number encoding mode to generate the running number encoding value comprises:
determining a base coding reference unit of the serial number coding mode according to the date coding mode;
determining a serial number initial coding value and a coding step length according to the serial number coding mode;
Automatically encoding according to the serial number initial encoding value and the encoding step length to generate an absolute serial number;
and generating the serial number coding value according to the base coding reference unit and the absolute serial number.
7. The method of claim 1, wherein an initial field value of the newly added field is not null; the automatic coding mode is determined according to the automatic coding configuration data, and automatic coding is performed according to the automatic coding mode to obtain an automatic coding field value, which comprises the following steps:
taking the initial field value of the newly added field as an automatic coding initial value of the automatic coding configuration data;
and performing automatic coding according to the automatic coding mode determined by the automatic coding configuration data and the automatic coding initial value to obtain an automatic coding field value.
8. An automatic encoding device based on a database, comprising:
the new added field acquisition module is used for acquiring the new added field of the current service table of the current database;
the automatic coding configuration data acquisition module is used for acquiring automatic coding configuration data matched with the target field under the condition that the newly added field is determined to be matched with the target field;
The automatic coding field value acquisition module is used for determining an automatic coding mode according to the automatic coding configuration data and carrying out automatic coding according to the automatic coding mode to obtain an automatic coding field value;
and the automatic coding field value generating module is used for filling the field value of the newly added field according to the automatic coding field value.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the database-based automatic encoding method of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to implement the database-based auto-encoding method of any one of claims 1-7 when executed.
CN202310530824.9A 2023-05-12 2023-05-12 Automatic coding method and device based on database, electronic equipment and medium Pending CN116303369A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310530824.9A CN116303369A (en) 2023-05-12 2023-05-12 Automatic coding method and device based on database, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310530824.9A CN116303369A (en) 2023-05-12 2023-05-12 Automatic coding method and device based on database, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN116303369A true CN116303369A (en) 2023-06-23

Family

ID=86788983

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310530824.9A Pending CN116303369A (en) 2023-05-12 2023-05-12 Automatic coding method and device based on database, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN116303369A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112667631A (en) * 2020-12-24 2021-04-16 华人运通(江苏)技术有限公司 Method, device and equipment for automatically editing service field and storage medium
CN112883033A (en) * 2021-02-25 2021-06-01 嘉兴易迪希计算机技术有限公司 Automatic coding and history coding automatic matching method in EDC system
CN114785583A (en) * 2022-04-15 2022-07-22 江苏保旺达软件技术有限公司 Method, device, equipment and medium for encrypted sending and verifying of interface request
CN115439598A (en) * 2021-06-02 2022-12-06 厦门海迈科技股份有限公司 Presentation data processing method based on digital twins, computing device and storage medium
CN115994182A (en) * 2023-02-10 2023-04-21 北京数衍科技有限公司 Code generation method and device and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112667631A (en) * 2020-12-24 2021-04-16 华人运通(江苏)技术有限公司 Method, device and equipment for automatically editing service field and storage medium
CN112883033A (en) * 2021-02-25 2021-06-01 嘉兴易迪希计算机技术有限公司 Automatic coding and history coding automatic matching method in EDC system
CN115439598A (en) * 2021-06-02 2022-12-06 厦门海迈科技股份有限公司 Presentation data processing method based on digital twins, computing device and storage medium
CN114785583A (en) * 2022-04-15 2022-07-22 江苏保旺达软件技术有限公司 Method, device, equipment and medium for encrypted sending and verifying of interface request
CN115994182A (en) * 2023-02-10 2023-04-21 北京数衍科技有限公司 Code generation method and device and electronic equipment

Similar Documents

Publication Publication Date Title
CN115617888A (en) Data import method, device, equipment, storage medium and product
CN117271467A (en) Log query and forwarding method, device, equipment and storage medium
CN116578646A (en) Time sequence data synchronization method, device, equipment and storage medium
CN116303013A (en) Source code analysis method, device, electronic equipment and storage medium
CN115454971A (en) Data migration method and device, electronic equipment and storage medium
CN115525659A (en) Data query method and device, electronic equipment and storage medium
CN115905322A (en) Service processing method and device, electronic equipment and storage medium
CN116303369A (en) Automatic coding method and device based on database, electronic equipment and medium
CN115544010A (en) Mapping relation determining method and device, electronic equipment and storage medium
CN115048352A (en) Log field extraction method, device, equipment and storage medium
CN115328917A (en) Query method, device, equipment and storage medium
CN114756468A (en) Test data creating method, device, equipment and storage medium
CN116383454B (en) Data query method of graph database, electronic equipment and storage medium
CN118170430B (en) Method, device, equipment and storage medium for processing call link
CN116108589B (en) Method, device, equipment and medium for constructing core model
CN115983222A (en) EasyExcel-based file data reading method, device, equipment and medium
CN117632120A (en) Processing system, method, equipment and storage medium for report data
CN115454977A (en) Data migration method, device, equipment and storage medium
CN116050351A (en) Structure comparison method, device and equipment of logic expression and storage medium
CN118377476A (en) Online development and loading method and device of component, electronic equipment and storage medium
CN117742686A (en) Program source code file generation method and device, electronic equipment and storage medium
CN117194435A (en) Index data updating method, device, equipment and storage medium
CN116050371A (en) Report generation method, device, equipment and program product
CN117216066A (en) Material code generation method, device, equipment and storage medium
CN117634429A (en) Statement conversion 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
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20230623