CN115827703B - Enumeration data query method and device - Google Patents

Enumeration data query method and device Download PDF

Info

Publication number
CN115827703B
CN115827703B CN202310094434.1A CN202310094434A CN115827703B CN 115827703 B CN115827703 B CN 115827703B CN 202310094434 A CN202310094434 A CN 202310094434A CN 115827703 B CN115827703 B CN 115827703B
Authority
CN
China
Prior art keywords
enumeration
data
query
terminal
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202310094434.1A
Other languages
Chinese (zh)
Other versions
CN115827703A (en
Inventor
吴春林
周永扬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Meiyun Zhishu Technology Co ltd
Original Assignee
Meiyun Zhishu 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 Meiyun Zhishu Technology Co ltd filed Critical Meiyun Zhishu Technology Co ltd
Priority to CN202310094434.1A priority Critical patent/CN115827703B/en
Publication of CN115827703A publication Critical patent/CN115827703A/en
Application granted granted Critical
Publication of CN115827703B publication Critical patent/CN115827703B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to the technical field of data processing, and provides an enumeration data query method and device, wherein the method comprises the following steps: determining a first form, wherein the first form is used for storing a plurality of enumeration types including a target enumeration type; determining query interfaces of the first form and the second terminal data source based on the data source format of enumeration data of the second terminal; based on the query interface, sending a data query request of a target enumeration type to the second terminal, and receiving enumeration data sent by the second terminal; and storing the enumeration data sent by the second terminal into the target enumeration type of the first form to obtain a query result of the target enumeration type. According to the method and the system, the enumeration data transmission can be realized by only establishing the target interface between the first form and the second terminal data source, the interface construction is simplified, and the efficient and convenient enumeration data query is realized.

Description

Enumeration data query method and device
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a method and an apparatus for querying enumeration data.
Background
In enterprise management processes, it is often necessary to define some finite, relatively fixed, enumerated value ranges. Such as: sex, job position of staff; the type of document, the type of device, etc. By defining the enumeration type, the system can customize the data type and uniformly use the data type, and the construction and maintenance of the application are convenient.
In the existing enumeration data query mode, when enumeration data is acquired through cross-service query, an interface is required to be called to realize enumeration data transmission between two services, and because a common business person cannot directly establish the interface, the interface can be established only after a developer writes codes, and therefore timeliness and convenience of the existing query mode cannot meet enterprise management requirements.
Disclosure of Invention
The present invention is directed to solving at least one of the technical problems existing in the related art. Therefore, the invention provides an enumeration data query method, because the first form contains all enumeration types to be queried, data transmission can be realized by only establishing a target interface between the first form and a second terminal data source, the interface is not required to be independently established for different forms, the step of interface establishment is simplified, a developer is not required to write codes, and a service person can establish a corresponding target interface according to the data source format of the second terminal before querying.
The invention also provides an enumeration data query device.
The invention further provides electronic equipment.
The invention also proposes a non-transitory computer readable storage medium.
The invention also proposes a computer program product.
An enumeration data query method according to an embodiment of the first aspect of the present invention includes:
determining a first form, wherein the first form is used for storing a plurality of enumeration types including a target enumeration type;
determining query interfaces of the first form and the second terminal data source based on the data source format of enumeration data of the second terminal;
based on the query interface, sending a data query request of a target enumeration type to the second terminal, and receiving enumeration data corresponding to the target enumeration type sent by the second terminal;
and storing the enumeration data sent by the second terminal into the first form to obtain the query result of the target enumeration type.
According to the enumeration data query method provided by the embodiment of the invention, unlike the prior art that one form is required to be created for each enumeration type, a plurality of enumeration types are stored through the first form, and as the first form contains all enumeration types required to be queried, data transmission can be realized only by establishing a target interface between the first form and a second terminal data source, and the step of constructing interfaces is simplified without singly constructing interfaces for different forms. Therefore, the query interfaces of the first form and the data source of the second terminal can be directly determined according to the data source format of the second terminal. The query interface can send a data query request to the second terminal, receive enumeration data sent by the second terminal, and can realize quick query of the target enumeration type after the enumeration data is stored in the first form.
According to one embodiment of the invention, the determining the first form includes:
defining an enumeration type;
and classifying based on the enumeration types, and storing the enumeration types into a first form according to the classification.
According to one embodiment of the present invention, the classifying based on the enumerated types, storing the enumerated types in a first form according to classifications, includes:
classifying according to semantics based on the name of the enumerated type to obtain various classifications;
determining the enumeration type of the same structure under the same classification based on the enumeration type structure;
and storing the enumerated types of the same structure under the same category into the same category of the first form.
According to one embodiment of the present invention, the structure of the enumerated types includes a key structure and a tree structure, and the storing the enumerated types of the same structure under the same category into the same category of the first form includes:
the enumeration types which are in tree structures under the same classification are stored in the same tree of the same classification of the first form;
and storing the enumeration types which are in the key value structure under the same classification into the same classification of the first form.
According to one embodiment of the present invention, the determining the query interface of the first form and the second terminal data source based on the data source format of the enumeration data of the second terminal includes:
determining an interface address, a request mode and interface parameters based on a data source format of enumeration data of the second terminal;
and establishing the query interface based on the interface address, the request mode and the interface parameters.
According to an embodiment of the present invention, the storing enumeration data sent by the second terminal in the first form to obtain a query result of the target enumeration type includes:
storing the enumeration data as an enumeration value into the position of the target enumeration type in the first form;
and referring to the target enumeration type to obtain a query result of the target enumeration type.
According to one embodiment of the present invention, the data query request of the target enumeration type includes a request for querying enumeration data of one or more than one target enumeration types, or a request for querying enumeration data of enumeration items under any one of the target enumeration types.
An enumeration data query device according to an embodiment of the second aspect of the present invention comprises:
the form construction module is used for determining a first form, and the first form is used for storing a plurality of enumeration types including a target enumeration type;
the interface editor module is used for determining query interfaces of the first form and the second terminal data source based on the data source format of the enumeration data of the second terminal;
the receiving and transmitting module is used for sending a data query request of a target enumeration type to the second terminal based on the query interface and receiving enumeration data corresponding to the target enumeration type sent by the second terminal;
and the query module is used for storing the enumeration data sent by the second terminal into the first form to obtain a query result of the target enumeration type.
According to the enumeration data query device provided by the embodiment of the invention, the enumeration types are stored through the first form based on the form construction module, and as the first form contains all enumeration types to be queried, data transmission can be realized only by establishing a target interface between the first form and a second terminal data source, and the step of constructing the interface is simplified without singly constructing the interface aiming at different forms. Thus, the interface editor module may determine the query interface of the first form and the second terminal data source directly from the data source format of the second terminal. The receiving and transmitting module can send a data query request to the second terminal through the query interface and receive enumeration data sent by the second terminal, and the query module can realize rapid query of the target enumeration type after storing the enumeration data into the first form.
An electronic device according to an embodiment of the third aspect of the present invention comprises a memory, a processor and a computer program stored on the memory and executable on the processor, which when executing the program implements the steps of the enumeration data query method as described above.
A non-transitory computer readable storage medium according to an embodiment of the fourth aspect of the present invention has stored thereon a computer program which, when executed by a processor, implements the steps of the enumerated data query method as described above.
A computer program product according to an embodiment of a fifth aspect of the present invention comprises a computer program which, when executed by a processor, implements the steps of the enumerated data query method described above.
The above technical solutions in the embodiments of the present invention have at least one of the following technical effects: the existing enumeration type design adopts the method that enumeration data is preset in a database, and each enumeration type needs to independently construct a form, so that custom addition is not supported. In the embodiment of the invention, the plurality of enumeration types are stored according to the classification by constructing the first form, compared with the format stored by the existing method, the method is more unified, when the enumeration types are newly added, the enumeration items are only required to be added under the corresponding classification in the first form, the code writing is not required, and the flexibility and the expansibility are greatly improved.
Furthermore, the embodiment of the invention can classify according to semantics based on the names of the enumeration types, and the enumeration types of the same function are uniformly stored according to the enumeration types of the same structure in the classification mode because the semantics can embody different enumeration functions, and the unified structure is convenient for newly adding the enumeration types and is convenient for modifying and deleting the enumeration types.
Furthermore, when the enumeration type is a tree structure, the tree structure can be constructed by adopting enumeration data defining parent-child relationships according to enumeration data with hierarchical relationships in actual demands and stored in the same tree of the same classification.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the related art, the drawings that are required to be used in the embodiments or the related technical descriptions will be briefly described, 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 the drawings without inventive effort for those skilled in the art.
FIG. 1 is a flow chart of an enumeration data query method provided by an embodiment of the present invention;
FIG. 2 is a schematic diagram of an enumeration data query device according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present invention more apparent, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are 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 invention without making any inventive effort, are intended to be within the scope of the invention.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the embodiments of the present application. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
There are two types of data sources for enumeration data, one is stored in the primary data system, i.e. the enumerator data storage party for the query and the requestor issuing the query request are the same terminal. The other type of enumeration data stored in the external system, i.e. the enumerated data storage party for the query and the requesting party for the query request, are different terminals. If the enumerated data is queried from the main data system, the interface problem is not needed to be considered, and the query can be directly performed. However, the data must be read from the external system and the external platform, and the data of the external system must be stored in the host system in an interface manner, and then the data must be read from the host data system. Meanwhile, preset data are required to be respectively stored in the corresponding forms when the existing enumeration types are created, so that the types and formats of the forms are not uniform, and therefore, after the existing enumeration types are created, custom addition of service personnel is not supported, and flexibility and expansibility are not good enough. Therefore, the embodiment of the invention discloses an enumeration data query method, which is applied to a terminal side, specifically to a first terminal side, as shown in fig. 1, and at least comprises the following steps:
step 101, determining a first form, wherein the first form is used for storing a plurality of enumeration types including a target enumeration type;
102, determining query interfaces of a first form and a second terminal data source based on a data source format of enumeration data of the second terminal;
step 103, based on the query interface, sending a data query request of the target enumeration type to the second terminal, and receiving enumeration data corresponding to the target enumeration type sent by the second terminal;
and 104, storing enumeration data sent by the second terminal into the first form to obtain a query result of the target enumeration type.
For step 101, it should be noted that, in the first form of the embodiment of the present invention, all enumeration types are stored in one table, so that on one hand, the difficulty of creating, adding or deleting enumeration types by service personnel can be reduced, and a developer does not need to write code construction for different enumeration types, and only needs to create enumeration types in the same form through a preset template. On the other hand, the first form can be used as a first terminal to store all enumerated sweater forms, and one form is more convenient to bind and manage when data interaction with other ends is realized.
As an example, the enumeration types and the enumeration values of the enumeration data under each enumeration type may include: all seasons of the year: spring, summer, autumn, winter. Gender: male and female. All direction keys on the keyboard: upward, downward, leftward, rightward. In daily life, the values of the things are only definite fixed values, all the values describing the things can be listed one by one, and the listed type is called an enumeration type.
In addition, the first terminal and the second terminal may be terminals of the user, or further, include, but are not limited to, mobile phones, tablet computers, pc terminals, vehicle-mounted terminals, home intelligent appliances, and the like.
For step 102, it should be noted that the second terminal is a terminal that enumerates data stored in an external system. Before inquiring the enumeration data, the data type of the data source of the enumeration data of the second terminal needs to be acquired, and the target interface can be configured through the data type of the data source, for example, an interface address, a request mode, interface parameters and the like are configured.
For step 103, it should be noted that the data query request of the target enumeration type includes querying enumeration data of multiple enumeration types, or enumeration data of an enumeration item under a certain enumeration type. The data query requests can be classified and defaulted to be all by taking enumeration names or enumeration codes as the basis of target enumeration types, and the query requests support fuzzy query. The target interface may be used to query the external application system for all enumeration types under it, including classification information in which the enumeration types are located. And returning enumeration data through the target interface, wherein the enumeration data exists in a list data form and comprises enumeration type classification information. Alternatively, the target interface may be further configured to query for enumerated items of a specific enumeration type, and return a list of all enumeration data for an enumerated item after querying.
For step 104, it should be noted that, after the queried enumeration data is stored in the corresponding position of the target enumeration type in the first form, the value is assigned to the target enumeration type in the first form, and then the queried enumeration value of the target enumeration type can be completed after the reference by using the established enumeration data, i.e. the reference target enumeration type.
According to the enumeration data query method, the plurality of enumeration types are stored through the first form, and the first form contains all enumeration types to be queried, so that data transmission can be realized only by establishing a target interface between the first form and a second terminal data source, and the step of interface construction is simplified. Therefore, the query interfaces of the first form and the data source of the second terminal can be directly determined according to the data source format of the second terminal. The query interface can send a data query request to the second terminal, receive enumeration data sent by the second terminal, and can realize quick query of the target enumeration type after the enumeration data is stored in the first form.
It is understood that determining the first form includes:
defining an enumeration type;
and classifying based on the enumeration types, and storing the enumeration types into a first form according to the classification.
When the enumeration type is defined, the encoding, the name, the data type (string, value), the enumeration type, the classification and the status of the enumeration type need to be defined. The various attributes contained in each enumeration type become enumeration items, where the code consists of letters, numbers and special characters, which cannot be null. The code length is greater than 4 characters and less than 24 characters. A character string named chinese, which cannot be empty. The structure includes a simple key value pair structure and a tree-shaped parent-child structure. The data type is defined as: characters and integers. The classification is a semantic classification of enumerated names, which may be null. The states comprise 'non-enabled' and 'enabled', the newly built state is 'non-enabled', and the state can be switched through a switch of the state. Meanwhile, the enumeration type that has been referenced cannot be "not enabled" for operation.
Specifically, the name is used to show enumerated display items in the interface. The name contains a character string with at least 2 characters, and when the new construction is carried out, whether the name of the enumeration type in the global scope is unique or not needs to be checked, and the name is not unique and is not saved, so that the uniqueness of the name is ensured. Global scope: refers to the enumeration types contained under all applications within the user's authorized scope. The encoding is used to define the true value of a certain item in the enumeration type. The code is a letter followed by a character of letters and numbers, not less than 4 characters in length, and less than 24 characters in length. It is also necessary to check whether the globally scoped enumerated type of code is unique. The non-unique enumeration type codes in the global scope are not saved so as to ensure the code uniqueness.
In addition, the first form designed by the embodiment of the invention realizes unified management of various enumeration types in a classified storage mode, improves the flexibility of enumeration type creation and reduces management difficulty. When defining a new enumeration, a new location is selected, and if a specific location is not specified, the enumeration is defaulted not to belong to an application, and belongs to an enumeration which can be accessed by all applications/modules under the user. If a new enumeration of an application is selected, the enumeration only belongs to the application, and the default application list is an application which is located on an external system of the second terminal and has a certain authority for the first terminal user to access. If a module under a certain application is selected to add an enumeration, the enumeration only belongs to the module. In addition, the first form also supports the functions of adding, editing and deleting enumeration types or deleting a certain class in batch after the construction is completed.
It may be appreciated that classifying based on the enumerated types, storing the enumerated types in the first form according to the classifications, respectively, includes:
classifying according to semantics based on the name of the enumeration type to obtain various classifications;
determining enumeration types of the same structure under the same classification based on the enumeration type structure;
and storing the enumerated types of the same structure under the same classification into the same classification of the first form.
It should be noted that, the names of the enumerated types are classified according to semantics, so that the classification of the enumerated types is conveniently divided in a practical use mode, and the enumerated types and subsequent references are conveniently managed and stored. For example, an enumeration type to which a setting is classified as healthy may be blood type, gender, age, and disease type. The classification can be a more reasonable storage position for the arrangement of all enumeration types in the first form, and the related enumeration types are uniformly stored, so that the enumeration types of the tree structure are particularly beneficial to constructing the relationship of father and son nodes among each other.
It may be appreciated that the structure of the enumerated types includes a key-value structure and a tree structure, and storing the enumerated types of the same structure under the same category into the same category of the first form includes:
the enumeration types which are in tree structures under the same classification are stored in the same tree of the same classification of the first form;
and storing the enumerated types which are all in the key value structure under the same classification into the same classification of the first form.
It should be noted that, in the case where the newly added enumeration type is a simple key value pair, it is necessary to define an enumeration item under the enumeration type. First, the method encodes, defines the true value of an item in the enumeration type, which is expressed as an enumeration item, and stores the value in the database. The data type defining the value of the enumerated item is to be consistent with the data type of the enumerated type; for example: the definition of a data type is an integer, then the enumerated value must also be an integer. And when the new generation is carried out, automatically generating. If modified, the modification can be performed by itself. If the type is an integer, automatically generated numbers of the integer type. Second, a name needs to be defined, and the uniqueness of the name must be judged within the scope of the definition enumeration item. Then, the serial number of the enumerated items needs to be defined, and the serial number is an integer. The default value is 1 for displaying the sequence of the enumerated items in the interface. Then the state needs to be defined and default enabled when new.
In addition, since the enumeration types under the tree structure are in a relationship between a parent node and a child node, the relationship between the node of the newly added enumeration type and the parent node or the child node thereof is also required.
The enumerated types, which are all key-value structures under the same class, may be directly stored in the class of the first form. The enumeration types which are tree structures under the same classification need to be stored in the tree corresponding to each classification in the form of one tree corresponding to one classification according to the relation of father and child nodes in the tree structure.
The conventional method generally stores each enumeration type in a separate tree and does not classify the enumeration types, so that the storage space is large and the storage format is difficult to unify. Unlike the traditional method, the enumeration data query method of the embodiment of the invention uniformly stores enumeration types of the same function according to the enumeration types of the same structure through classification, and the uniform structure is convenient for newly adding enumeration items on one hand and convenient for modifying and deleting on the other hand. When the enumerated items are in a tree structure, the enumeration data with a hierarchical relation in actual demands can be adopted to construct the tree structure by adopting the enumeration data with a definition of father-son relation and stored in the same tree of the same classification, so that a storage space is reasonably planned, and a foundation is laid for efficient and convenient reference enumeration data.
It may be appreciated that determining the query interface based on the data source format of the enumeration data of the second terminal includes:
determining an interface address, a request mode and interface parameters based on a data source format of enumeration data of the second terminal;
and establishing a query interface based on the interface address, the request mode and the interface parameters.
It should be noted that, the second terminal is equipped with an external system, in which external enumeration data is stored, the external system includes multiple levels, and the system includes multiple applications, each application includes a different module. The external system is defined as service enumeration, so the data source format of the enumeration data is the name, code, uniform resource location system (uniform resource locator, URL), security authentication mode and status of the service enumeration. Wherein, the name of the service enumeration is at least three Chinese characters, at most 16 Chinese characters, and the name is unique in the global scope. Global scope: refers to the enumeration types contained under all applications within the user's authorized scope. The code is the code for identifying service enumeration, the minimum of three English words and the maximum of 16 characters, and the code is unique in the global scope. The service URL is a URL that accesses a service enumeration. There are two security authentication methods: NONE, appKey/AppSecret, default use: NONE mode. The states include an enable state and a disable state, with the new addition defaulting to the disable state.
The interface address, request mode and interface parameters can be configured through enumerating the data source format of the data, and the interface parameters comprise out-parameter, in-parameter and the like. The query interface is divided into an enumeration type query interface and an enumeration item query interface, wherein the enumeration type query interface queries all enumeration types under the enumeration type query interface from an external application system and comprises classification information of the enumeration types. The interface returns list data (containing enumerated classification information). Wherein the interface address is a relative address based on service enumeration. The request mode comprises two alternatives of GET/POST. The interface parameters may request header parameters header, parameter names, parameter types (integer, string), and other custom variable values. The enumeration item query interface is used for querying enumeration items of a specific enumeration type, defaults to take enumeration type codes as parameters, if other parameters are used, parameters can be defined, and the query returns a list of enumeration items.
It may be appreciated that storing enumeration data in a first form, obtaining a query result of a target enumeration type, includes:
the enumeration data is used as an enumeration value and is stored in a position of a target enumeration type in a first form;
and referring to the target enumeration type to obtain a query result of the target enumeration type.
It should be noted that, the enumeration data is used as an enumeration value, that is, the queried enumeration data is used as an enumeration value of each enumeration item in the target enumeration type, and the data source of the target enumeration type is determined after the enumeration data is stored. The use and querying of the target enumeration type is then effected by reference. When the target enumeration type is quoted, two ways are actually involved, namely, the quoted data source and the built first form are on the same terminal, and at this time, an interface is not required to be built by using the method of the embodiment of the invention, so that the quoted data source and the built first form can be directly quoted. The other is service enumeration, namely, the quoted data source and the constructed first form are not on the same terminal, and at the moment, after an interface is constructed by the method of the embodiment of the invention, the quoted and inquired data are realized by calling the interface data. For enumeration types that have been referenced, they cannot be deleted while encoding, data types, dictionary types, existing enumeration items cannot be modified. But names, classifications, can be modified and enumerated items can be added.
As an example, in the embodiment of the present invention, the first terminal is configured to store a plurality of enumeration types in the first form, and when the data source of the target enumeration type is in the second terminal, the first terminal will construct a query interface between the first form and the data source of the second terminal based on the data source format of the enumeration data of the second terminal. Then the first terminal can send a data query request of the target enumeration type to the second terminal based on the query interface, receive the enumeration data sent by the second terminal, store the enumeration data sent by the second terminal into the target enumeration type of the first form, and finally obtain a query result of the target enumeration type through reference.
It will be appreciated that the data query requests for target enumeration types include requests for enumeration data for one or more target enumeration types, or requests for enumeration data for enumeration items under any of the target enumeration types.
The enumeration data query method of the embodiment of the invention is not only suitable for querying all enumeration data under any one or more enumeration types, but also can accurately query only the enumeration data of the next enumeration item of one enumeration type, thereby improving the accuracy of query and avoiding wasting unnecessary query resources. And returning enumeration data through the target interface, wherein the enumeration data exists in a list data form and comprises enumeration type classification information. Alternatively, the target interface may be further configured to query for enumerated items of a specific enumeration type, and return a list of all enumeration data for an enumerated item after querying.
According to the enumeration data query method provided by the embodiment of the invention, after the enumeration type is constructed in the first form, for most basic data, a user can autonomously construct a target enumeration type through custom enumeration at the first terminal and fill in the enumeration data, so that the problem is solved, and no code is required to be written. For enumeration data which can be obtained only by calling an interface, a simple query interface construction can be realized through the characteristics of a data source, and then the enumeration value of the second terminal can be used as the data source by only binding the query interface in the first form, namely, the enumeration data is referenced to realize the purpose of query.
The enumeration data query device provided by the invention is described below, and the enumeration data query device described below and the enumeration data query method described above can be referred to correspondingly. As shown in fig. 2, the overwrap modeling apparatus includes:
a form construction module 201, configured to determine a first form, where the first form is used to store a plurality of enumeration types including a target enumeration type;
an interface editor module 202 for determining a query interface of the first form and the second terminal data source based on a data source format of the enumeration data of the second terminal;
the transceiver module 203 is configured to send a data query request of a target enumeration type to the second terminal based on the query interface, and receive enumeration data corresponding to the target enumeration type sent by the second terminal;
and the query module 204 is configured to store enumeration data sent by the second terminal into the first form, and obtain a query result of the target enumeration type.
According to the enumeration data query device provided by the embodiment of the invention, the enumeration types are stored through the first form based on the form construction module, and as the first form contains all enumeration types to be queried, data transmission can be realized only by establishing a target interface between the first form and a second terminal data source, and the step of constructing the interface is simplified without singly constructing the interface aiming at different forms. Thus, the interface editor module may determine the query interface of the first form and the second terminal data source directly from the data source format of the second terminal. The receiving and transmitting module can send a data query request to the second terminal through the query interface and receive enumeration data sent by the second terminal, and the query module can realize rapid query of the target enumeration type after storing the enumeration data into the first form.
It is understood that the form construction module 201 determines the first form, including:
defining an enumeration type;
and classifying based on the enumeration types, and storing the enumeration types into a first form according to the classification.
It may be appreciated that the form construction module 201 classifies the enumerated types based on the enumerated types, and stores the enumerated types into the first form according to the classifications, including:
classifying according to semantics based on the name of the enumeration type to obtain various classifications;
determining enumeration types of the same structure under the same classification based on the enumeration type structure;
and storing the enumerated types of the same structure under the same classification into the same classification of the first form.
It may be understood that the structure of the enumerated types includes a key value structure and a tree structure, and the form construction module 201 stores the enumerated types of the same structure under the same category into the same category of the first form, including:
the enumeration types which are in tree structures under the same classification are stored in the same tree of the same classification of the first form;
and storing the enumerated types which are all in the key value structure under the same classification into the same classification of the first form.
It will be appreciated that determining, in the interface editor module 202, the query interface of the first form and the second terminal data source based on the data source format of the enumeration data of the second terminal includes:
determining an interface address, a request mode and interface parameters based on a data source format of enumeration data of the second terminal;
and establishing a query interface based on the interface address, the request mode and the interface parameters.
It may be appreciated that the query module 204 stores enumeration data sent by the second terminal in the first form to obtain a query result of a target enumeration type, including:
the enumeration data is used as an enumeration value and is stored in a position of a target enumeration type in a first form;
and referring to the target enumeration type to obtain a query result of the target enumeration type.
Fig. 3 illustrates a physical schematic diagram of an electronic device, as shown in fig. 3, where the electronic device may include: processor 310, communication interface (Communications Interface) 320, memory 330 and communication bus 340, wherein processor 310, communication interface 320, memory 330 accomplish communication with each other through communication bus 340. The processor 310 may call logic instructions in the memory 330 to perform the following method:
determining a first form, wherein the first form is used for storing a plurality of enumeration types including a target enumeration type;
determining query interfaces of the first form and the second terminal data source based on the data source format of the enumeration data of the second terminal;
based on the query interface, sending a data query request of a target enumeration type to the second terminal, and receiving enumeration data corresponding to the target enumeration type sent by the second terminal;
and storing enumeration data sent by the second terminal into the first form to obtain a query result of the target enumeration type.
Further, the logic instructions in the memory 330 described above may be implemented in the form of software functional units and may be stored in a computer-readable storage medium when sold or used as a stand-alone product. Based on such understanding, the technical solution of the present invention may be embodied in essence or a part contributing to the related art or a part of the technical solution, or in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods of the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
In another aspect, embodiments of the present invention disclose a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, are capable of performing the methods provided by the above-described method embodiments, for example comprising:
determining a first form, wherein the first form is used for storing a plurality of enumeration types including a target enumeration type;
determining query interfaces of the first form and the second terminal data source based on the data source format of the enumeration data of the second terminal;
based on the query interface, sending a data query request of a target enumeration type to the second terminal, and receiving enumeration data corresponding to the target enumeration type sent by the second terminal;
and storing enumeration data sent by the second terminal into the first form to obtain a query result of the target enumeration type.
In yet another aspect, embodiments of the present invention further provide a non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor is implemented to perform the transmission method provided in the above embodiments, for example, including:
determining a first form, wherein the first form is used for storing a plurality of enumeration types including a target enumeration type;
determining query interfaces of the first form and the second terminal data source based on the data source format of the enumeration data of the second terminal;
based on the query interface, sending a data query request of a target enumeration type to the second terminal, and receiving enumeration data corresponding to the target enumeration type sent by the second terminal;
and storing enumeration data sent by the second terminal into the first form to obtain a query result of the target enumeration type.
The apparatus embodiments described above are merely illustrative, wherein elements illustrated as separate elements may or may not be physically separate, and elements shown as elements may or may not be physical elements, may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
From the above description of the embodiments, it will be apparent to those skilled in the art that the embodiments may be implemented by means of software plus necessary general hardware platforms, or of course may be implemented by means of hardware. Based on such understanding, the foregoing technical solution may be embodied essentially or in a part contributing to the related art in the form of a software product, which may be stored in a computer readable storage medium, such as ROM/RAM, a magnetic disk, an optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method of the respective embodiments or some parts of the embodiments.
Finally, it should be noted that the above-mentioned embodiments are merely illustrative of the invention, and not limiting. While the invention has been described in detail with reference to the embodiments, those skilled in the art will appreciate that various combinations, modifications, or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and the present invention is intended to be covered by the scope of the present invention.

Claims (9)

1. An enumeration data query method, comprising:
determining a first form, wherein the first form is used for storing a plurality of enumeration types including a target enumeration type;
determining query interfaces of the first form and the second terminal data source based on the data source format of enumeration data of the second terminal;
based on the query interface, sending a data query request of a target enumeration type to the second terminal, and receiving enumeration data corresponding to the target enumeration type sent by the second terminal;
storing enumeration data sent by the second terminal into the first form to obtain a query result of the target enumeration type;
the determining the query interface of the first form and the second terminal data source based on the data source format of the enumeration data of the second terminal comprises the following steps:
determining an interface address, a request mode and interface parameters based on a data source format of enumeration data of the second terminal;
and establishing the query interface based on the interface address, the request mode and the interface parameters.
2. The enumeration data query method of claim 1, wherein the determining a first form comprises:
defining an enumeration type;
and classifying based on the enumeration types, and storing the enumeration types into a first form according to the classification.
3. The enumeration data query method of claim 2, wherein the classifying based on the enumeration types, storing the enumeration types in the first form according to classifications, respectively, comprises:
classifying according to semantics based on the name of the enumerated type to obtain various classifications;
determining the enumeration type of the same structure under the same classification based on the enumeration type structure;
and storing the enumerated types of the same structure under the same category into the same category of the first form.
4. The method of claim 3, wherein the enumerated data query structure includes a key structure and a tree structure, and wherein storing the enumerated types of the same structure under the same category into the same category of the first form includes:
the enumeration types which are in tree structures under the same classification are stored in the same tree of the same classification of the first form;
and storing the enumeration types which are in the key value structure under the same classification into the same classification of the first form.
5. The method for querying enumeration data according to any one of claims 1 to 4, wherein storing enumeration data sent by the second terminal in the first form to obtain a query result of the target enumeration type includes:
storing the enumeration data as an enumeration value into the position of the target enumeration type in the first form;
and referring to the target enumeration type to obtain a query result of the target enumeration type.
6. The method according to any one of claims 1 to 4, wherein the data query request of the target enumeration type includes a request for querying one or more than one enumeration data of the target enumeration type, or a request for querying enumeration data of an enumeration item under any one of the target enumeration types.
7. An enumeration data query device, comprising:
the form construction module is used for determining a first form, and the first form is used for storing a plurality of enumeration types including a target enumeration type;
the interface editor module is used for determining query interfaces of the first form and the second terminal data source based on the data source format of the enumeration data of the second terminal;
the receiving and transmitting module is used for sending a data query request of a target enumeration type to the second terminal based on the query interface and receiving enumeration data corresponding to the target enumeration type sent by the second terminal;
the query module is used for storing enumeration data sent by the second terminal into the first form to obtain a query result of the target enumeration type;
the determining, in the interface editor module, the query interface of the first form and the second terminal data source based on the data source format of the enumeration data of the second terminal includes:
determining an interface address, a request mode and interface parameters based on a data source format of enumeration data of the second terminal; and establishing the query interface based on the interface address, the request mode and the interface parameters.
8. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the enumeration data query method of any one of claims 1 to 6 when the program is executed by the processor.
9. A non-transitory computer readable storage medium having stored thereon a computer program, which when executed by a processor implements the enumeration data query method of any of claims 1 to 6.
CN202310094434.1A 2023-02-10 2023-02-10 Enumeration data query method and device Active CN115827703B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310094434.1A CN115827703B (en) 2023-02-10 2023-02-10 Enumeration data query method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310094434.1A CN115827703B (en) 2023-02-10 2023-02-10 Enumeration data query method and device

Publications (2)

Publication Number Publication Date
CN115827703A CN115827703A (en) 2023-03-21
CN115827703B true CN115827703B (en) 2023-06-30

Family

ID=85520968

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310094434.1A Active CN115827703B (en) 2023-02-10 2023-02-10 Enumeration data query method and device

Country Status (1)

Country Link
CN (1) CN115827703B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103620604A (en) * 2011-06-28 2014-03-05 微软公司 Exposing search history by category

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10521411B2 (en) * 2016-08-10 2019-12-31 Moonshadow Mobile, Inc. Systems, methods, and data structures for high-speed searching or filtering of large datasets
CN109766085B (en) * 2018-12-29 2023-05-16 南京苏宁加电子商务有限公司 Method and device for processing enumeration type codes
US11106916B2 (en) * 2019-08-23 2021-08-31 International Business Machines Corporation Identifying segment starting locations in video compilations
US20210097090A1 (en) * 2019-09-27 2021-04-01 International Business Machines Corporation Creating a metatype tree for metatype introspection
CN111008521B (en) * 2019-12-06 2023-04-28 北京三快在线科技有限公司 Method, device and computer storage medium for generating wide table
CN111367524B (en) * 2020-03-17 2023-08-29 上海东普信息科技有限公司 Enumeration type design method and device
CN115048359A (en) * 2022-07-07 2022-09-13 杭州指令集智能科技有限公司 Universal data processing architecture design method for multi-type access data sources

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103620604A (en) * 2011-06-28 2014-03-05 微软公司 Exposing search history by category

Also Published As

Publication number Publication date
CN115827703A (en) 2023-03-21

Similar Documents

Publication Publication Date Title
CN111259006B (en) Universal distributed heterogeneous data integrated physical aggregation, organization, release and service method and system
US7599948B2 (en) Object relational mapping layer
US6772137B1 (en) Centralized maintenance and management of objects in a reporting system
US8438190B2 (en) Generating web services from business intelligence queries
US20020032775A1 (en) System and method for transmitting and retrieving data via a distributed persistence framework
US9020983B2 (en) Address list system and method of implementing an address list
KR20100133380A (en) Computing environment representation
CN102567932A (en) Method, device and system for managing comprehensive resources
CN112650533B (en) Interface document generation method and device and terminal equipment
KR20020050160A (en) Object integrated management system
CN113326264A (en) Data processing method, server and storage medium
CN113704248B (en) Block chain query optimization method based on external index
CN112835638A (en) Configuration information management method and device based on embedded application program
CN115918110A (en) Spatial search using key-value store
CN115827703B (en) Enumeration data query method and device
CN112000687A (en) Business account table generation method and device, computer equipment and storage medium
EP1405217A1 (en) A flexible virtual database system including a hierarchical application parameter repository
CN113076086B (en) Metadata management system and method for modeling model object using the same
CN114546410A (en) Code optimization method based on design mode and related equipment
CN112162731B (en) Data expansion method, device, storage medium and electronic device
CN113779068A (en) Data query method, device, equipment and storage medium
CN113868138A (en) Method, system, equipment and storage medium for acquiring test data
CN115017185A (en) Data processing method, device and storage medium
CN114866609B (en) Data interconnection and intercommunication method and device based on unified information model
CN114997111B (en) Service processing method, device, computer 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
GR01 Patent grant
GR01 Patent grant