CN115827703A - Enumeration data query method and device - Google Patents

Enumeration data query method and device Download PDF

Info

Publication number
CN115827703A
CN115827703A CN202310094434.1A CN202310094434A CN115827703A CN 115827703 A CN115827703 A CN 115827703A CN 202310094434 A CN202310094434 A CN 202310094434A CN 115827703 A CN115827703 A CN 115827703A
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.)
Granted
Application number
CN202310094434.1A
Other languages
Chinese (zh)
Other versions
CN115827703B (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

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention relates to the technical field of data processing, and provides an enumeration data query method and a device, wherein the method comprises the following steps: determining a first form for storing a plurality of enumeration types including a target enumeration type; determining query interfaces of the first form and a data source of a second terminal based on a data source format of enumeration data of the second terminal; sending a data query request of a target enumeration type to the second terminal based on the query interface, and receiving enumeration data sent by the second terminal; and storing 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 invention, enumerated data transmission can be realized only by establishing the target interface between the first form and the second terminal data source, so that the interface construction is simplified, and efficient and convenient enumerated data query is realized.

Description

Enumeration data query method and device
Technical Field
The invention relates to the technical field of data processing, in particular to an enumeration data query method and device.
Background
In the enterprise management process, it is often necessary to define some limited range, relatively fixed, enumerable value ranges. Such as: gender, position of the employee; type of document, type of device, etc. By defining enumeration types, the system can define data types and use the data types in a unified way, and construction and maintenance of application are facilitated.
In the existing enumeration data query mode, when cross-service query is carried out to obtain enumeration data, an interface needs to be called to realize enumeration data transmission between two services, and because common business personnel cannot directly create the interface, the interface can be created only after developers write codes, the timeliness and the convenience of the existing query mode cannot meet enterprise management requirements.
Disclosure of Invention
The present invention has been made to solve at least one of the problems occurring in the related art. Therefore, the invention provides an enumerated data query method, and as the first form contains all enumerated types to be queried, data transmission can be realized only by establishing a target interface between the first form and a data source of a second terminal, and an interface is not required to be independently established for different forms, so that the steps of establishing the interface are simplified, and a service person can establish a corresponding target interface according to the data source format of the second terminal before querying without compiling codes by developers.
The invention also provides an enumeration data query device.
The invention further provides the electronic equipment.
The invention also proposes a non-transitory computer-readable storage medium.
The invention also proposes a computer program product.
According to a first aspect of the present invention, an enumeration data query method is provided, including:
determining a first form for storing a plurality of enumeration types including a target enumeration type;
determining query interfaces of the first form and a data source of a second terminal based on a data source format of enumeration data of the second terminal;
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 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 enumerated data query method provided by the embodiment of the invention, the method is different from the prior art that a form needs to be created for each enumerated type, a plurality of enumerated types are stored through a first form, and as the first form contains all enumerated types needing to be queried, data transmission can be realized only by establishing a target interface between the first form and a second terminal data source, an interface does not need to be independently established for different forms, and the steps of establishing the interface are 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 data query request can be sent to the second terminal through the query interface, the enumeration data sent by the second terminal is received, and the rapid query of the target enumeration type can be realized 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 an embodiment of the present invention, the classifying based on the enumeration type, and storing the enumeration types into a first form according to classifications 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 structure of the enumeration types;
and storing the enumeration types with the same structure under the same classification into the same classification of the first form.
According to an embodiment of the present invention, the storing the enumerated types of the same structure under the same classification into the same classification of the first form includes:
storing enumeration types which are all tree structures under the same classification into the same tree of the same classification of the first form;
and storing the enumeration types which are all key value structures under the same classification into the same classification of the first form.
According to an embodiment of the present invention, the determining the query interfaces of 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 includes:
determining an interface address, a request mode and interface parameters based on a data source format of enumeration data of a 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 into the first form to obtain the query result of the target enumeration type includes:
taking the enumeration data as an enumeration value, and storing the enumeration data into the position of the target enumeration type in the first form;
and quoting the target enumeration type to obtain a query result of the target enumeration type.
According to an 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 target enumeration types, or a request for querying enumeration data of an enumerated item under any one of the target enumeration types.
An enumeration data query device according to an embodiment of a second aspect of the present invention includes:
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 a data source of a second terminal based on a data source format of enumerated data of the second terminal;
a transceiver module, 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 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 enumerated data query device provided by the embodiment of the invention, a plurality of enumerated types are stored through the first form based on the form construction module, and as the first form contains all enumerated types to be queried, data transmission can be realized only by establishing a target interface between the first form and the second terminal data source, and an interface is not required to be independently constructed for different forms, so that the steps of constructing the interface are simplified. Therefore, the interface editor module can determine the query interfaces of the first form and the data source of the second terminal directly according to the data source format of the second terminal. The transceiver 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 the 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 includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the steps of the enumerated 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 that, when executed by a processor, implements the steps of the enumerated data query method described above.
A computer program product according to an embodiment of the fifth aspect of the present invention comprises a computer program which, when executed by a processor, implements the steps of the enumeration data query method described above.
One or more technical solutions in the embodiments of the present invention have at least one of the following technical effects: the existing enumeration type design adopts preset enumeration data 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 first form is constructed to store the plurality of enumeration types according to the classification, compared with the existing method, the storage format is more uniform, when the enumeration types are newly added, only the enumeration items are added under the corresponding classification in the first form to solve the problem, codes do not need to be written, and the flexibility and the expansibility are greatly improved.
Furthermore, the embodiments of the present invention may classify enumerated types according to semantics based on names of the enumerated types, and since the semantics may embody different enumerated functions, the enumerated types of the same function may be uniformly stored according to the classification manner according to the enumerated types of the same structure, and the uniform structure facilitates adding the enumerated types newly on one hand and modifying and deleting on the other hand.
Furthermore, when the enumeration type is a tree structure, the tree structure may be constructed by using enumeration data defining parent-child relationships for enumeration data having hierarchical relationships in actual requirements, and the tree structure may be stored in the same tree in the same category.
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 technical solutions in related arts, the drawings used in the description of the embodiments or related arts will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a method for enumerating data queries according to an embodiment of the present invention;
FIG. 2 is a schematic structural 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
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean 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 an embodiment of the 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, the schematic representations of the terms used above are not necessarily intended to refer 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. Moreover, various embodiments or examples and features of various embodiments or examples described in this specification can be combined and combined by one skilled in the art without being mutually inconsistent.
The enumeration data has two data sources, one is stored in the main data system, namely, a queried enumeration data storage party and a query request sending party are the same terminal. The other is stored in the external system, namely the query enumeration data storage party and the query request sending party are different terminals. If the enumeration data is inquired from the main data system, the interface problem is not needed to be considered, and the inquiry can be directly carried out. However, when data is read from an external system or an external platform, the data of the external system must be stored in the host system and then read from the host data system in an interface manner. Meanwhile, preset data are required to be stored in respective corresponding forms when the existing enumeration type is created, so that the types and formats of the forms are not unified, and therefore, after the existing enumeration type is created, service personnel self-defined addition is not supported, and the flexibility and the expansibility are not good enough. Therefore, an embodiment of the present invention discloses an enumeration data query method, which is applied to a terminal side, specifically, a first terminal side, and as shown in fig. 1, the method at least includes 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;
step 102, determining query interfaces of a first form and a second terminal data source based on a data source format of enumeration data of a second terminal;
103, 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 step 104, storing the enumeration data sent by the second terminal into the first form to obtain a query result of the target enumeration type.
In step 101, it should be noted that the first form stores all enumeration types in one table, which can reduce the difficulty of creating, adding, or deleting enumeration types by service personnel on one hand, and does not require a developer to write codes for different enumeration types for construction, but only requires creating enumeration types in the same form through a preset template. On the other hand, the first form is used as a sweater form which can store all enumerated types in the first terminal, and when data interaction with other terminals is realized, one form is more convenient to bind and manage.
As an example, the enumeration types and enumerated values of the enumeration data under each enumeration type may include: all seasons of the year: spring, summer, autumn, winter. Sex: male and female. All direction keys on the keyboard: up, down, left, right. In daily life, the values of the objects only have definite fixed values, all the values describing the objects 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 a user, or further, include but are not limited to terminals such as a mobile phone, a tablet computer, a pc terminal, a vehicle-mounted terminal, and a home intelligent appliance.
With respect to step 102, it should be noted that the second terminal is a terminal in which the enumeration data is stored in the external system. Before the enumeration data is queried, 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, such as interface address configuration, request mode, interface parameters and the like.
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 in a certain enumeration type. The data query request can take an enumeration name or an enumeration code as a basis of a target enumeration type, the data query request is classified into all data, and meanwhile, the query request supports fuzzy query. The target interface may be used to query the external application system for all enumerated types under it, including the classification information where the enumerated types are located. And returning the enumeration data through the target interface, wherein the enumeration data exists in a form of list data, and the list data contains the classification information of the enumeration type. Or, the target interface may also be configured to query an enumeration item of a specific enumeration type, and return a list of all enumeration data of the enumeration item after the query.
As to step 104, it should be noted that after storing the queried enumeration data in the corresponding position of the target enumeration type of the first form, it is equivalent to assigning a value to the target enumeration type in the first form, and then it is necessary to use the established enumeration data, that is, to refer to the target enumeration type, and after referring, it is possible to complete querying the enumeration value of the target enumeration type.
According to the enumerated data query method provided by the embodiment of the invention, the plurality of enumerated types are stored through the first form, and as the first form contains all enumerated types to be queried, data transmission can be realized only by establishing the target interface between the first form and the second terminal data source, so that the steps of interface construction are 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 data query request can be sent to the second terminal through the query interface, the enumeration data sent by the second terminal is received, and the rapid query of the target enumeration type can be realized after the enumeration data is stored in the first form.
It is to be understood that determining the first form includes:
defining an enumeration type;
and classifying based on the enumeration types, and respectively storing the enumeration types into the first form according to the classification.
It should be noted that, when defining an enumeration type, it is necessary to define the code, name, data type (string, numerical value), enumeration type, class, and state of the enumeration type. The attributes contained in each enumeration type become enumeration items, wherein the codes are composed of letters, numbers and special characters and cannot be null. The code length is greater than 4 characters and less than 24 characters. The name is Chinese, and cannot be an empty string. The structure comprises a simple key-value pair structure and a tree 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 'not enabled' and 'enabled', the new state is 'not enabled', and the state can be switched through the state switch. Meanwhile, the enumerated types that have been referenced cannot perform "not enabled" operations.
Specifically, the name is used to present the enumerated display item in the interface. The name comprises a character string with at least 2 characters, and whether the name of an enumeration type in a global scope is unique or not needs to be checked when the name is newly built, and the unique name is not stored, so that the uniqueness of the name is ensured. Global scope: refers to the enumerated types contained under all applications within the authorized scope of the user. The encoding is used to define the true value of an item in the enumerated type. The code is started with letters and then followed by letters and numbers, the length of the characters is not less than 4 characters, and the length of the characters is less than 24 characters. It is also necessary to check whether the enumerated types of codes in the global scope are unique. The non-unique enumerated type codes in the global scope are not saved so as to ensure the code uniqueness.
In addition, the first form designed in the embodiment of the present invention realizes unified management of various enumeration types by means of classified storage, thereby improving flexibility of creation of enumeration types and reducing management difficulty. When defining new enumeration, selecting a new position, if a specific position is not specified, defaulting that the enumeration does not belong to a certain application, and belongs to the enumeration which can be accessed by all applications/modules below the user. And if a new enumeration of a certain application is selected, the enumeration only belongs to the application, and the default application list is the application which is positioned on the external system of the second terminal and the first terminal user has certain access authority. If a new enumeration is selected for a module below an application, the enumeration only belongs to the module. In addition, the first form also supports functions of adding, editing and deleting enumeration types or deleting a certain classification in batches after the construction is completed.
It can be understood that the classifying is performed based on the enumeration types, and the storing of the enumeration types into the first form according to the classification 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 structure of the enumeration types;
and storing the enumeration types with 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 enumerated types can be classified in an actual use mode, and the enumerated types and subsequent references can be managed and stored conveniently. For example, the settings are classified into a healthy state, and the enumerated types under which they belong may be blood type, sex, age, and disease species. The classification can be a storage position with more reasonable layout of each enumeration type in the first form, and related enumeration types are uniformly stored, so that the method is particularly beneficial to constructing a parent-child node relationship among the enumeration types of the tree structure.
It can be understood that the enumerating type structure includes a key value structure and a tree structure, and the storing of the enumerating types of the same structure in the same category of the first form includes:
storing enumeration types which are all tree-shaped structures under the same classification into the same tree of the same classification of the first form;
and storing the enumeration types which are all key value structures under the same classification into the same classification of the first form.
It should be noted that, when the new enumeration type is a simple key-value pair, an enumeration item in the enumeration type needs to be defined. Firstly, encoding is carried out, the real value of a certain item in an enumeration type is defined, the real value is expressed as a certain enumeration item, and the value is stored in a database. Defining the data type of the value of the enumeration item to be consistent with the data type of the enumeration type; for example: where the data type is defined as an integer, the enumerated value must also be an integer. When newly added, the new file is automatically generated. If the device is modified, the device can be modified by itself. And if the type is an integer, automatically generating a number of the integer type. Secondly, names need to be defined, and within the range of the defined enumeration items, the uniqueness of the names needs to be judged. Then, the serial number of the enumerated item needs to be defined, and the serial number is an integer. And displaying the order of enumerated items in the interface, wherein the default value is 1. Then, the state needs to be defined, and the state is enabled by default when the state is newly added.
In addition, because the enumeration types in the tree structure are related to each other by parent nodes and child nodes, the relationship between nodes of the target enumeration type and parent nodes or child nodes thereof needs to be newly added.
Enumerated types which are key value structures under the same classification can be directly stored into the classification of the first form. The enumeration types which are all tree structures in the same classification need to be stored in the tree corresponding to each classification in a form that one classification corresponds to one tree according to the relationship of parent nodes and child nodes in the tree structures.
In the traditional method, each enumeration type is generally stored in a separate tree and is not classified, so that the storage space is large and the storage formats are difficult to unify. The enumeration data query method of the embodiment of the invention is different from the traditional method, and the enumeration types with the same function are uniformly stored according to the enumeration types with the same structure through classification, so that the uniform structure is convenient for adding new enumeration items on one hand and modifying and deleting on the other hand. When the enumeration item is in a tree structure, the tree structure can be constructed by adopting enumeration data defining parent-child relationship aiming at enumeration data with hierarchical relationship in actual requirements and stored in the same tree in the same classification, so that the storage space is reasonably planned, and a foundation is laid for efficiently and conveniently quoting the enumeration data.
It is understood 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, an external system is loaded on the second terminal, where external enumeration data is stored, the external system includes multiple hierarchies, and the system includes multiple applications, where each application includes a different module. An external system is defined as service enumeration, and thus, a data source format of enumerated data is name, code, uniform Resource Locator (URL), security authentication mode and state of service enumeration. The name of the service enumeration comprises at least three Chinese characters and at most 16 Chinese characters, and the name is unique in the global scope. Global scope: refers to the enumerated types contained under all applications within the user's authorized scope. The code is used for identifying service enumeration, at least three English words and the longest 16 characters are used, and the code is unique in the global scope. The service URL is a URL of access service enumeration. There are two security authentication methods: NONE, appKey/AppSecret, used by default: the NONE mode. The states comprise an enabled state and a disabled state, and the new default state is the disabled state.
Interface addresses, request modes and interface parameters can be configured through a data source format of enumerated data, and the interface parameters comprise access parameters, access parameters 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 the service enumeration. The request mode comprises two modes of GET/POST selection. The interface parameter may request header parameter headers, 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, and defaults to using 'enumeration type code' as a parameter, if other parameters exist, the parameter can also be defined, and query returns a list of enumeration items.
It is to be understood that storing enumeration data into a first form to obtain a query result of a target enumeration type includes:
taking the enumeration data as an enumeration value, and storing the enumeration data into the position of a target enumeration type in the first form;
and quoting the target enumeration type to obtain a query result of the target enumeration type.
It should be noted that, taking the enumeration data as an enumeration value, that is, taking the queried enumeration data as an enumeration value of each enumeration item in the target enumeration type, and storing the enumeration data to determine the data source of the target enumeration type. The use and querying of the target enumeration type is then accomplished through the reference. The method for referencing the target enumeration type actually comprises two modes, one mode is local domain enumeration, namely, a referenced data source and a constructed first form are on the same terminal, and at the moment, the method does not need to be used for constructing an interface, and the reference can be directly carried out. The other is service enumeration, that is, the referenced data source and the constructed first form are not on the same terminal, and at this time, after an interface is constructed by the method of the embodiment of the present invention, reference and query are realized by calling interface data. For the enumerated type which is already referred to, the enumerated item can not be deleted and the code, data type, dictionary type and existing enumerated item can not be modified. But names, classifications, can be modified while enumerations can be added.
As an example, in the embodiment of the present invention, a first terminal is configured with a first form to store multiple enumeration types, and when a data source of a target enumeration type is in a second terminal, the first terminal constructs a query interface between the first form and the data source of the second terminal based on a data source format of enumeration data of the second terminal. Then, the first terminal may send a data query request of a target enumeration type to the second terminal based on the query interface, receive enumeration data sent by the second terminal, store the enumeration data sent by the second terminal in the target enumeration type of the first form, and finally obtain a query result of the target enumeration type by reference.
It is understood that a data query request of a target enumeration type includes a request to query enumeration data of one or more target enumeration types, or a request to query enumeration data of an enumerated item under any one of the target enumeration types.
The enumeration data query method provided by the embodiment of the invention is not only suitable for querying all enumeration data under any one or multiple enumeration types, but also can be used for accurately querying, and only querying the enumeration data of the next enumeration item under a certain enumeration type, so that the query accuracy is improved, and unnecessary query resources are avoided from being wasted. And returning the enumeration data through the target interface, wherein the enumeration data exists in a list data form and comprises the classification information of the enumeration type. Or, the target interface may also be configured to query an enumeration item of a specific enumeration type, and return a list of all enumeration data of the enumeration item after the query.
According to the enumeration data query method provided by the embodiment of the invention, after the first form realizes the construction of the enumeration type, for most basic data, a user can independently construct the target enumeration type through self-defined enumeration at the first terminal and fill in the enumeration data to solve the problem without writing codes. For enumeration data which can be obtained only by calling an interface, simple and convenient query interface construction can be realized through the characteristics of a data source, and then only by binding the query interface in a first form, the enumeration value of a second terminal can be used as the data source, namely the enumeration data is referred to realize the purpose of query.
The enumerated data query device provided by the present invention is described below, and the enumerated data query device described below and the enumerated data query method described above may be referred to each other. As shown in fig. 2, the overpack 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;
the interface editor module 202 is configured to determine query interfaces of the first form and a data source of the second terminal based on a data source format of 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;
the query module 204 is configured to store the enumeration data sent by the second terminal into the first form to obtain a query result of the target enumeration type.
The enumerated data query device stores a plurality of enumerated types through the first form based on the form construction module, and as the first form contains all the enumerated types to be queried, data transmission can be realized only by establishing a target interface between the first form and the second terminal data source, and an interface does not need to be independently constructed for different forms, thereby simplifying the steps of constructing the interface. Therefore, the interface editor module can determine the query interfaces of the first form and the data source of the second terminal directly according to the data source format of the second terminal. The transceiver 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 the rapid query of the target enumeration type after storing the enumeration data into the first form.
It is to be appreciated that the form construction module 201 determines a first form, including:
defining an enumeration type;
and classifying based on the enumeration types, and respectively storing the enumeration types into the first form according to the classification.
It can be understood that the classifying based on the enumeration types in the form building module 201, and the storing the enumeration types into the first form according to the classification 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 structure of the enumeration types;
and storing the enumeration types with the same structure under the same classification into the same classification of the first form.
It can be understood that the structure of the enumerated types includes a key value structure and a tree structure, and the storing of the enumerated types of the same structure in the same classification into the same classification of the first form in the form building module 201 includes:
storing enumeration types which are all tree-shaped structures under the same classification into the same tree of the same classification of the first form;
and storing the enumeration types which are all key value structures under the same classification into the same classification of the first form.
It is understood that, determining the query interface of the first form and the data source of the second terminal in the interface editor module 202 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 can be understood that, the storing, by the query module 204, the enumeration data sent by the second terminal into the first form to obtain a query result of the target enumeration type includes:
taking the enumeration data as an enumeration value, and storing the enumeration data into the position of a target enumeration type in the first form;
and quoting the target enumeration type to obtain a query result of the target enumeration type.
Fig. 3 illustrates a physical structure diagram of an electronic device, which may include, as shown in fig. 3: a processor (processor) 310, a communication Interface (communication Interface) 320, a memory (memory) 330 and a communication bus 340, wherein the processor 310, the communication Interface 320 and the memory 330 communicate with each other via the 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 a first form and a second terminal data source based on a data source format of enumeration data of a second terminal;
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 storing the enumeration data sent by the second terminal into the first form to obtain a query result of the target enumeration type.
In addition, the logic instructions in the memory 330 may be implemented in the form of software functional units and stored in a computer readable storage medium when the software functional units are sold or used as independent products. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to 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), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In another aspect, an embodiment of the present invention discloses a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium, the computer program including program instructions, when the program instructions are executed by a computer, the computer can execute the method provided by the above method 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 a first form and a second terminal data source based on a data source format of enumeration data of a second terminal;
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 storing the enumeration data sent by the second terminal into the first form to obtain a query result of the target enumeration type.
In another aspect, an embodiment of the present invention further provides a non-transitory computer-readable storage medium, on which a computer program is stored, where the computer program is implemented to perform the transmission method provided in the foregoing embodiments when executed by a processor, for example, the method 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 a first form and a second terminal data source based on a data source format of enumeration data of a second terminal;
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 storing the enumeration data sent by the second terminal into the first form to obtain a query result of the target enumeration type.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods of the various embodiments or some parts of the embodiments.
Finally, it should be noted that the above embodiments are only for illustrating the present invention, and do not limit the present invention. Although the present invention has been described in detail with reference to the embodiments, it should be understood by those skilled in the art that various combinations, modifications or equivalents may be made to the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention, and the technical solution of the present invention is covered by the scope of the present invention.

Claims (10)

1. An enumeration data query method, comprising:
determining a first form for storing a plurality of enumeration types including a target enumeration type;
determining query interfaces of the first form and a data source of a second terminal based on a data source format of enumeration data of the second terminal;
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 storing the enumeration data sent by the second terminal into the first form to obtain a query result of the target enumeration type.
2. The enumerated 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 classification.
3. The enumerated data query method of claim 2, wherein the classifying based on the enumerated types, and storing the enumerated types into a first form according to classification, respectively, comprises:
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 structure of the enumeration types;
and storing the enumeration types with the same structure under the same classification into the same classification of the first form.
4. The enumerated data query method of claim 3, wherein the structure of enumerated types includes a key value structure and a tree structure, and the storing of enumerated types of the same structure in the same category into the same category of the first form includes:
storing enumeration types which are all tree structures under the same classification into the same tree of the same classification of the first form;
and storing the enumeration types which are all key value structures under the same classification into the same classification of the first form.
5. The enumerated data query method of any of claims 1 to 4, wherein the determining the query interfaces of the first form and the second terminal data source based on the data source format of the enumerated data of the second terminal comprises:
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.
6. The enumeration data query method of any one of claims 1 to 4, wherein the storing enumeration data sent by the second terminal into the first form to obtain the query result of the target enumeration type includes:
taking the enumeration data as an enumeration value, and storing the enumeration data into the position of the target enumeration type in the first form;
and quoting the target enumeration type to obtain a query result of the target enumeration type.
7. The enumeration data query method of any of claims 1-4, wherein the target enumeration type data query request comprises a request for querying enumeration data of one or more of the target enumeration types, or a request for querying enumeration data of enumerated items under any of the target enumeration types.
8. An enumerated 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 a data source of a second terminal based on a data source format of enumerated data of the second terminal;
a transceiver module, 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 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.
9. 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 of claims 1-7 when executing the program.
10. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the enumeration data query method according to any of claims 1-7.
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 true CN115827703A (en) 2023-03-21
CN115827703B 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 (8)

* 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
US20180046655A1 (en) * 2016-08-10 2018-02-15 Moonshadow Mobile, Inc. Systems, methods, and data structures for high-speed searching or filtering of large datasets
CN109766085A (en) * 2018-12-29 2019-05-17 苏宁易购集团股份有限公司 A kind of method and device handling enumeration type code
CN111008521A (en) * 2019-12-06 2020-04-14 北京三快在线科技有限公司 Method and device for generating wide table and computer storage medium
CN111367524A (en) * 2020-03-17 2020-07-03 上海东普信息科技有限公司 Enumeration type design method and device
US20210056311A1 (en) * 2019-08-23 2021-02-25 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
CN115048359A (en) * 2022-07-07 2022-09-13 杭州指令集智能科技有限公司 Universal data processing architecture design method for multi-type access data sources

Patent Citations (8)

* 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
US20180046655A1 (en) * 2016-08-10 2018-02-15 Moonshadow Mobile, Inc. Systems, methods, and data structures for high-speed searching or filtering of large datasets
CN109766085A (en) * 2018-12-29 2019-05-17 苏宁易购集团股份有限公司 A kind of method and device handling enumeration type code
US20210056311A1 (en) * 2019-08-23 2021-02-25 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
CN111008521A (en) * 2019-12-06 2020-04-14 北京三快在线科技有限公司 Method and device for generating wide table and computer storage medium
CN111367524A (en) * 2020-03-17 2020-07-03 上海东普信息科技有限公司 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

Also Published As

Publication number Publication date
CN115827703B (en) 2023-06-30

Similar Documents

Publication Publication Date Title
CN111259006B (en) Universal distributed heterogeneous data integrated physical aggregation, organization, release and service method and system
US8495007B2 (en) Systems and methods for hierarchical aggregation of multi-dimensional data sources
US10545981B2 (en) Virtual repository management
US10558434B2 (en) Rule-based automatic class generation from a JSON message
US7599948B2 (en) Object relational mapping layer
US8180758B1 (en) Data management system utilizing predicate logic
CN110309196A (en) Block chain data storage and query method, apparatus, equipment and storage medium
US8438190B2 (en) Generating web services from business intelligence queries
US20020032775A1 (en) System and method for transmitting and retrieving data via a distributed persistence framework
US6772137B1 (en) Centralized maintenance and management of objects in a reporting system
US9229971B2 (en) Matching data based on numeric difference
US7593951B2 (en) Application programming interface for centralized storage of principal data
US7213208B2 (en) Data container for interaction between a client process and software applications
CN103559189B (en) Electric analog training resource management system and method based on Metadata integration model
CN110941629B (en) Metadata processing method, apparatus, device and computer readable storage medium
KR20020050160A (en) Object integrated management system
CN112596719A (en) Method and system for generating front-end and back-end codes
CN113704248B (en) Block chain query optimization method based on external index
CN113590115B (en) Automatic generation method and device for service system codes
CN117453980A (en) Metadata management, configuration page generation method, server and storage medium
CN115827703B (en) Enumeration data query method and device
CN107533559A (en) Data structure, the model for filling data structure and the method being programmed using data structure to processing unit
CN112162731B (en) Data expansion method, device, storage medium and electronic device
CN113779068A (en) Data query method, device, equipment and storage medium
CN113591447A (en) Data table creating 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
GR01 Patent grant
GR01 Patent grant