CN115905383A - Data routing method, device and storage medium - Google Patents

Data routing method, device and storage medium Download PDF

Info

Publication number
CN115905383A
CN115905383A CN202211421758.3A CN202211421758A CN115905383A CN 115905383 A CN115905383 A CN 115905383A CN 202211421758 A CN202211421758 A CN 202211421758A CN 115905383 A CN115905383 A CN 115905383A
Authority
CN
China
Prior art keywords
data
target
data source
determining
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211421758.3A
Other languages
Chinese (zh)
Inventor
陈海锋
谢继刚
张浩祥
周锟
潘立强
张宇
庄海涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China United Network Communications Group Co Ltd
Unicom Digital Technology Co Ltd
Unicom Cloud Data Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
Unicom Digital Technology Co Ltd
Unicom Cloud Data 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 China United Network Communications Group Co Ltd, Unicom Digital Technology Co Ltd, Unicom Cloud Data Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN202211421758.3A priority Critical patent/CN115905383A/en
Publication of CN115905383A publication Critical patent/CN115905383A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The application provides a data routing method, a data routing device and a storage medium, relates to the technical field of computers, and is used for solving the technical problem that a data source cannot be effectively managed when an SaaS platform and a low-code platform are combined. The method comprises the following steps: receiving a data request message which is sent by a terminal and used for requesting target service data; the data request message comprises a target user identification; determining a target data domain to which the target service data belongs according to the target user identification; determining a target data source in a pre-established data source information set based on the user identification and the target data domain; the data source information set comprises corresponding relations of a plurality of user identifications and a plurality of data source information subsets; each data source information subset comprises corresponding relations of a plurality of data fields and a plurality of data sources; and configuring database connection between the terminal and the target data source so that the terminal acquires the target service data from the target data source.

Description

Data routing method, device and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data routing method, apparatus, and storage medium.
Background
At present, a low-code platform is developed rapidly by virtue of advantages of easy development, low cost and the like, and has become an important development direction in the field of Software-as-a-service (SaaS).
However, the SaaS platform generally needs to involve multiple types of data, and has the characteristics of multiple and complicated data sources. A related low-code platform generally manages a single data source based on a static file, and it is difficult to meet the diversity requirement of the SaaS platform for the data source. Under the circumstance, the SaaS platform and the low-code platform cannot be well combined, so that the system stability is poor, and the user experience is easily influenced.
Disclosure of Invention
The application provides a data routing method, a data routing device and a storage medium, which are used for solving the technical problem that a data source cannot be effectively managed when a SaaS platform and a low-code platform are combined.
In order to achieve the purpose, the following technical scheme is adopted in the application:
in a first aspect, a data routing method is provided, including: and receiving a data request message which is sent by the terminal and used for requesting the target service data. The data request message includes a target user identification. And determining a target data domain to which the target service data belongs according to the target user identification. And determining a target data source in the pre-established data source information set based on the user identification and the target data field. The data source information set comprises corresponding relations of a plurality of user identifications and a plurality of data source information subsets. Each data source information subset includes a correspondence of a plurality of data fields and a plurality of data sources. And configuring database connection between the terminal and the target data source so that the terminal acquires the target service data from the target data source.
Optionally, the method for determining a target data domain to which the target service data belongs according to the target user identifier specifically includes: and determining the context information corresponding to the target user identification. And determining a target data domain to which the target service data belongs in the context information.
Optionally, the method for determining a target data domain to which the target service data belongs in the context information specifically includes: current form information in the context information is determined. The current form information includes annotation information. And determining the data domain in the annotation information as the target data domain.
Optionally, after configuring the database connection between the terminal and the target data source, the data routing method further includes: and determining the idle time length corresponding to the database connection. And when the idle time length is greater than or equal to the preset effective time length, clearing the database connection.
Optionally, the method for determining the target data source in the pre-established data source information set based on the user identifier and the target data field specifically includes: and determining a data source information subset corresponding to the target user identifier in the data source information set as a target data source information subset. And determining the data source corresponding to the data domain in the target data source information subset as the target data source.
Optionally, before receiving a data request message sent by a terminal for requesting access to target service data, the data routing method further includes: and receiving a login request message which is sent by the terminal and carries the target user identification. And determining the state information of the data source information subset corresponding to the target user identification. The status information is used for indicating that the data source in the data source information subset corresponding to the target user identification is in an available state or an unavailable state.
In a second aspect, a data routing apparatus is provided, including: the device comprises a receiving unit, a determining unit and a configuring unit. A receiving unit, configured to receive a data request message sent by a terminal and used for requesting target service data. The data request message includes a target user identification. And the determining unit is used for determining a target data domain to which the target service data belongs according to the target user identification. And the determining unit is further used for determining a target data source in the pre-established data source information set based on the user identification and the target data domain. The data source information set comprises corresponding relations of a plurality of user identifications and a plurality of data source information subsets. Each data source information subset comprises the corresponding relation of a plurality of data fields and a plurality of data sources. And the configuration unit is used for configuring database connection between the terminal and the target data source so that the terminal acquires the target service data from the target data source.
Optionally, the determining unit is specifically configured to:
and determining the context information corresponding to the target user identification. And determining a target data domain to which the target service data belongs in the context information.
Optionally, the determining unit is specifically configured to:
current form information in the context information is determined. The current form information includes annotation information. And determining the data field in the annotation information as the target data field.
Optionally, the data routing apparatus further includes: and a clearing unit. And the determining unit is also used for determining the idle time length corresponding to the database connection. And the clearing unit is used for clearing the database connection when the idle time length is greater than or equal to the preset effective time length.
Optionally, the determining unit is specifically configured to:
and determining a data source information subset corresponding to the target user identification in the data source information set as a target data source information subset. And determining the data source corresponding to the data domain in the target data source information subset as the target data source.
Optionally, the receiving unit is further configured to receive a login request message carrying the target user identifier sent by the terminal. And the determining unit is further used for determining the state information of the data source information subset corresponding to the target user identification. The status information is used for indicating that the data source in the data source information subset corresponding to the target user identification is in an available state or an unavailable state.
In a third aspect, a data routing apparatus is provided, comprising a memory and a processor; the memory is used for storing computer execution instructions, and the processor is connected with the memory through a bus; when the data routing device is operating, the processor executes computer-executable instructions stored by the memory to cause the data routing device to perform the data routing method of the first aspect.
The data routing device may be a network device, or may be a part of a device in the network device, such as a system on chip in the network device. The system on chip is configured to support the network device to implement the functions involved in the first aspect and any one of the possible implementations thereof, for example, to receive, determine, and offload data and/or information involved in the data routing method. The chip system includes a chip and may also include other discrete devices or circuit structures.
In a fourth aspect, there is provided a computer-readable storage medium comprising computer-executable instructions that, when executed on a computer, cause the computer to perform the data routing method of the first aspect.
It should be noted that all or part of the above computer instructions may be stored on the first computer readable storage medium. The first computer readable storage medium may be packaged with the processor of the data routing device or packaged separately from the processor of the data routing device, which is not limited in this application.
In the present application, the names of the data routing devices do not limit the devices or functional modules themselves, and in actual implementation, the devices or functional modules may appear by other names. As long as the functions of the respective devices or functional modules are similar to those of the present application, they fall within the scope of the claims of the present application and their equivalents.
These and other aspects of the present application will be more readily apparent from the following description.
The technical scheme provided by the application at least brings the following beneficial effects:
based on any aspect, in the application, after receiving a data request message sent by a terminal and used for requesting access to target service data, a server may determine a target data domain to which the target service data belongs according to a target user identifier carried in the data request message. The server is pre-established with a data source information set comprising a plurality of user identifications and a plurality of data source information subsets, and each data source information subset comprises a plurality of data fields and a plurality of data sources. I.e. the server may support a pre-configuration of multiple data sources per subscriber identity. Therefore, the server may further determine a target data source in the pre-established data source information set based on the user identifier and the target data field to configure a database connection between the terminal and the target data source, so that the terminal acquires the target service data from the target data source.
Therefore, when the data routing method provided by the application is applied to the low-code platform, the low-code platform can be supported to manage various types of data related to the SaaS platform, and routing service is provided, so that the requirement of the SaaS platform on the diversity of data sources is met. Therefore, the application can support the combination of the SaaS platform and the low-code platform, and can solve the technical problem that the data source cannot be effectively managed when the SaaS platform and the low-code platform are combined.
Drawings
Fig. 1 is a schematic structural diagram of a data routing system according to an embodiment of the present application;
fig. 2 is a schematic functional architecture diagram of a server according to an embodiment of the present disclosure;
fig. 3 is a schematic hardware structure diagram of a server according to an embodiment of the present disclosure;
fig. 4 is a schematic flowchart of a data routing method according to an embodiment of the present application;
fig. 5 is a schematic flowchart of another data routing method according to an embodiment of the present application;
fig. 6 is a schematic flowchart of another data routing method according to an embodiment of the present application;
fig. 7 is a schematic flowchart of another data routing method according to an embodiment of the present application;
fig. 8 is a schematic flowchart of another data routing method according to an embodiment of the present application;
fig. 9 is a schematic flowchart of another data routing method according to an embodiment of the present application;
fig. 10 is a schematic flowchart of another data routing method according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of a data routing apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
For the convenience of clearly describing the technical solutions of the embodiments of the present application, in the embodiments of the present application, the terms "first" and "second" are used to distinguish the same items or similar items with basically the same functions and actions, and those skilled in the art can understand that the terms "first" and "second" are not used to limit the quantity and execution order.
Furthermore, the terms "comprising" and "having" in the description of the embodiments and claims of the present application and the accompanying drawings are not exclusive. For example, a process, method, system, article, or apparatus that comprises a list of steps or modules is not limited to only those steps or modules listed, but may include other steps or modules not listed.
At present, a low-code platform is rapidly developed by virtue of the advantages of easy development, low cost and the like, and becomes an important development direction in the field of Software-as-a-service (SaaS).
However, saaS platforms generally require multiple types of data to be involved, and have the characteristics of multiple and complex data sources. Related low-code platforms generally manage a single data source based on static files, and the diversity requirements of the SaaS platform on the data source are difficult to meet. Under the circumstance, the SaaS platform and the low-code platform cannot be well combined, so that the system stability is poor, and the user experience is easily influenced.
In view of the above problems, an embodiment of the present application provides a data routing method, in which after receiving a data request message sent by a terminal and used for requesting access to target service data, a server may determine a target data domain to which the target service data belongs according to a target user identifier carried in the data request message. The server is pre-established with a data source information set comprising a plurality of user identifications and a plurality of data source information subsets, and each data source information subset comprises a plurality of data fields and a plurality of data sources. I.e. the server may support a pre-configuration of multiple data sources per subscriber identity. Therefore, the server may further determine a target data source in the pre-established data source information set based on the user identifier and the target data field to configure a database connection between the terminal and the target data source, so that the terminal may access the target service data in the target data source corresponding to the target data field.
Therefore, when the data routing method provided by the application is applied to the low-code platform, the low-code platform can be supported to manage various types of data related to the SaaS platform, and routing service is provided, so that the requirement of the SaaS platform on the diversity of data sources is met. Therefore, the application can support the combination of the SaaS platform and the low-code platform, and can solve the technical problem that the data source cannot be effectively managed when the SaaS platform and the low-code platform are combined.
The data routing method is suitable for a data routing system. Fig. 1 shows one configuration of the data routing system 100. As shown in fig. 1, the data routing system 100 includes: a terminal 101 and a server 102. A communication connection between the terminal 101 and the server 102.
In practical applications, the server 102 in fig. 1 may be communicatively connected to a plurality of terminals 101.
For ease of understanding, the present application is described with reference to a communication connection between a server 102 and a terminal 101.
The terminal 101 in fig. 1 may be a client of a data service. The data service may be a service that is generated based on a low code platform and implemented based on a World Wide Web (Web) browser of SaaS model. The low-code platform is a software rapid development tool adopting a graphical dragging mode and is mainly applied to the development process of a software system. When a worker develops a software system based on a low-code platform, the software system can be developed, maintained and expanded without coding or with a small amount of coding.
In one possible approach, the terminal 101 may be configured with a display module, an input module, a communication module, and the like, so that a user can perform various operations (e.g., a data request operation and a login information input operation, etc.) in a data service through the terminal. The display module may be a device such as a liquid crystal display, and is configured to display a relevant interface (e.g., a login interface, a configuration interface, etc.) of the data service. The input module can be a computer external input device of a mouse and a keyboard and is used for a user to execute various operations. The communication module may be a transceiver or the like for communicating with the server 102.
Alternatively, terminal 101 in FIG. 1 may be a device providing voice and/or data connectivity to a user, a handheld device having wireless connectivity capabilities, or other processing device connected to a wireless modem. A wireless terminal may communicate with one or more core networks via a Radio Access Network (RAN). The wireless terminal may be a mobile terminal, such as a computer having a mobile terminal, or a portable, pocket, hand-held, computer-embedded mobile device, which exchanges language and/or data with a radio access network, for example, a mobile phone, a tablet computer, a notebook computer, a netbook, a Personal Digital Assistant (PDA). The embodiments of the present application do not set any limit to this.
The server 102 in fig. 1 may be a service side of data services implemented by a World Wide Web (Web) browser based on a SaaS model, which is generated based on a low-code platform, for providing data and services with respect to various interfaces. The server 102 in fig. 1 may be configured with a storage module. The storage module may be for storing various resource files. For example, resource files such as a data source information set, a preset effective duration, uplink information corresponding to each user identifier, and the like.
Alternatively, the server 102 may be a single server, or may be a server cluster composed of a plurality of servers. In some embodiments, the server cluster may also be a distributed cluster. The embodiments of the present application do not set any limit to this.
Referring to fig. 1, as shown in fig. 2, a functional architecture diagram of a server 102 according to an embodiment of the present disclosure is shown. The server 102 may be configured as functional modules for data source loading, data source routing, data source recovery, data source monitoring, and the like, and these functional modules may be connected based on a data bus to support data source switching and user-customized data source configuration in a terminal access process, thereby solving the diversity problems of multiple types of data sources, multiple users, multiple environments, and the like when the SaaS platform and the low code platform are combined, and the complexity problems of dynamic configuration, loading, routing configuration and isolation, automatic routing switching, idle recovery, monitoring, and the like.
The data source loading module can support data source configuration modes such as static loading and dynamic loading. Static loading may be used to read data sources based on static file configurations. For example, the data source loading module may load the data source configuration information in the configuration file in the YAML (YAML air Markup Language, yml) format, and convert the data source configuration information into the data source routing configuration information. The dynamic loading can be used for loading a data source or a database configured by a user, and converting the data source or the database into data source routing configuration information. The data source routing module may be configured to identify a data source currently accessed by the terminal, and establish a database connection between the terminal and a corresponding data source. The data source recovery module may be configured to monitor a working status of each database connection and to clear idle database connections. The data source monitoring module can be used for monitoring the availability, health and the like of each data source. For example, the data source monitoring module may be used to monitor whether each data source is normally accessible, whether there is a slow response problem, and the like.
In a possible manner, the data source monitoring module in the server 102 may further be connected to a standard hypertext Transfer Protocol (HTTP) interface, so that the terminal may query the availability and health of the data source.
Fig. 3 is a schematic diagram of a hardware structure of the server 102 according to an embodiment of the present disclosure. The server 102 includes a processor 21, a memory 22, a communication interface 23, and a bus 24. The processor 21, the memory 22 and the communication interface 23 may be connected by a bus 24.
The processor 21 is a control center of the server 102, and may be a single processor or a collective term for a plurality of processing elements. For example, the processor 21 may be a Central Processing Unit (CPU), or may be another general-purpose processor. Wherein the general purpose processor may be a microprocessor or any conventional processor or the like.
For one embodiment, processor 21 may include one or more CPUs, such as CPU0 and CPU1 shown in FIG. 3.
The memory 22 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that may store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that may store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
In a possible implementation, the memory 22 may exist separately from the processor 21, and the memory 22 may be connected to the processor 21 via a bus 24 for storing instructions or program codes. The processor 21, when calling and executing instructions or program code stored in the memory 22, is able to implement the data routing methods provided by the embodiments described below in the present application.
In another possible implementation, the memory 22 may also be integrated with the processor 21.
A communication interface 23, configured to connect the server 102 with other devices through a communication network, where the communication network may be an ethernet, a radio access network, a Wireless Local Area Network (WLAN), or the like. The communication interface 23 may include a receiving unit for receiving data, and a transmitting unit for transmitting data.
The bus 24 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an extended ISA (enhanced industry standard architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 3, but this does not mean only one bus or one type of bus.
It should be noted that the configuration shown in fig. 3 does not constitute a limitation on the server 102, and that the server 102 may include more or less components than those shown, or combine some components, or a different arrangement of components than those shown in fig. 3.
Fig. 4 is a schematic flow chart of a data routing method according to an embodiment of the present application. The data routing method is applied to the server 102 in the data routing system 100 shown in fig. 1. The data routing method comprises the following steps: S301-S304.
S301, the server receives a data request message which is sent by the terminal and used for requesting to access the target service data.
Wherein the data request message may include a target user identification. The target user identification may be used to represent identity information of the user using the terminal. And, the target user identification may be generated according to user-defined characters (e.g., arabic numerals, english characters, etc.).
In one possible approach, the target business data may be data with a specific purpose in the data service. For example, the target business data may be performance assessment data about a specific employee in the data service, attendance data about a specific employee in the data service, express delivery data about a specific cargo in the data service, and the like. The embodiments of the present application do not limit this.
In one possible approach, the data service may be a service implemented by a WEB browser based on a SaaS model. The data service can be used for realizing functions of data calculation, data analysis, data visualization and the like.
In an implementation manner, with reference to fig. 1, when a user needs to view or edit target service data, the user may perform a data request operation (e.g., click a request confirmation button) in a configuration interface of a data service through an input module configured by the terminal. In response to the data request operation, the terminal may send a data request message for requesting access to the target service data to the server, and the data request message carries the target user identifier. Accordingly, the server can receive the data request message from the terminal and analyze the data request message to determine the target user identifier.
In a possible mode, before the terminal displays the configuration interface of the data service, the user can perform account login operation on the login interface of the data service through an input module configured by the terminal so as to input information such as target user identification and passwords into the terminal. In response to the account login operation, the terminal can store information such as the target user identifier and the password and send a login request message carrying the information such as the target user identifier and the password to the server to verify the validity of the information such as the target user identifier and the password. Correspondingly, the server can verify the legality of information such as the target user identification and the password. In this way, the terminal can display the configuration interface of the data service when receiving the authentication passing message from the server.
S302, the server determines a target data domain to which the target service data belongs according to the target user identification.
In one possible approach, the target data field may be used to indicate the data source, data type, data usage, and the like of the target business data.
In an implementation manner, after determining the target user identifier, the server may first determine context information corresponding to the target user identifier, and determine a target data domain to which the target service data belongs in the context information. Specifically, the process may refer to the descriptions in S401-S402, which are not described herein again.
S303, the server determines a target data source in the pre-established data source information set based on the user identification and the target data domain.
The data source information set comprises a plurality of user identifications and a plurality of data source information subsets. Each data source information subset includes a correspondence of a plurality of data fields and a plurality of data sources.
In an implementation manner, after the server obtains the target data domain, a data source information subset corresponding to the target user identifier may be determined in a data source information set established in advance, and then a target data source corresponding to the target data domain may be determined in the data source information subset.
It should be noted that the data sources can be classified into a platform data source, a user internal data source, a user external data source, and the like. The platform data source is mainly used for providing basic configuration data of data service operation such as authority information, a page rendering mode and the like. The user internal data source is used for storing configuration data, application data and the like generated in the data service by a user and providing calling service related to the data. The external data source of the tenant is external data configured by the user, and can support the user to access and manage the external data by means of data service.
In one possible approach, the data field corresponding to the platform data source may be denoted as sys tem. The data field corresponding to the user internal data source may be denoted as inner. The data field corresponding to the external data source of the user may be denoted as external.
In one possible approach, different configuration modes may be employed in the server for different types of data sources. The user internal data source and the user external data source can be dynamically configured through corresponding HTTP interfaces respectively. The server can monitor the dynamic configuration information of the data source in real time so as to update the data source information corresponding to the corresponding user identification in real time. The platform data source may be configured in the form of a static file. For example, the configuration using static files may be as follows:
Figure BDA0003941594890000071
/>
Figure BDA0003941594890000081
in one possible example, the data source information subset corresponding to the user identifier a may include a data source 1 corresponding to the data field system, a data source 2 corresponding to the data field inner, and a data source 3 corresponding to the data field external. The subset of data source information corresponding to the user identity B may comprise a data source 4 corresponding to the data field system, a data source 5 corresponding to the data field inner, and a data source 6 corresponding to the data field external.
In a possible manner, a service area may physically partition data sources, basic configurations, and the like corresponding to a plurality of user identifiers, so as to implement data isolation between users, so that each user in the data service can use a separate system instance, and each user can perform personalized configuration on the system instance according to requirements.
In a possible manner, the data source corresponding to each user identifier configured in the server may set the operating environment by default. The operation environment can be a design state and an operation state, provides physical or logical isolation of multiple data source environments for users, and meets the problem of data service development periodicity. The design state provides an environment supporting the user to set up design work such as application and page. The run state provides an environment for users to access and use data services.
In one possible approach, the design state may be denoted as design. The running state may be denoted runtime. Further, when the server determines the target data domain in the context information, the server may also determine an operating environment associated with the target service data.
Optionally, the server may also support user-defined intermediate states to facilitate user development of personalization functions in the data service.
In one possible approach, the server may store a routing information table as shown in table 1 below. The routing information table may include a correspondence of routing keys, user identifications, data fields, data sources, execution environments, and the like. The routing key may consist of a user identification, a data field, an execution environment, etc.
TABLE 1
Figure BDA0003941594890000082
/>
Figure BDA0003941594890000091
Based on this, the server may generate the target routing key after determining the target user identifier, the target data domain, and the operating environment associated with the target service data, and further determine the data source corresponding to the routing information table and the target routing key as the target data source. The process can be embodied as follows.
Figure BDA0003941594890000092
/>
Figure BDA0003941594890000101
S304, the server configures database connection between the terminal and the target data source so that the terminal acquires the target service data from the target data source.
In an implementation manner, after the server determines the target data source, relevant information (e.g., an application program interface, etc.) for establishing a database connection may be determined in the target data source, and the database connection between the terminal and the target data source may be configured in the database connection pool. Based on the method, the terminal can acquire the target service data from the target data source through the database connection with the target data source.
In an embodiment, with reference to fig. 4, in the above S302, that is, when the server determines the target data domain to which the target service data belongs according to the target user identifier, as shown in fig. 5, an optional implementation manner is provided in the embodiment of the present application, and specifically includes: S401-S402.
S401, the server determines context information corresponding to the target user identification.
In an implementation manner, when a user performs various operations (e.g., login operation, editing operation, etc.) in a data service through an input module configured by a terminal, the terminal may transmit log information for recording the various operations of the user to a server in real time. Accordingly, the server may record forms corresponding to various operations in context information corresponding to the user identification. Based on this, in order to determine form information (e.g., form label, form type, etc.) associated with the target business data, the server may read context information corresponding to the target user identification in the storage module after determining the target user identification.
In one possible approach, the server may collect various data in various data sources through the form in response to various request messages (e.g., authentication request message and data request message, etc.) of the terminal. The staff member can set the type, name and other information of the form in the server in advance. The form may consist of three parts, a form label, a form field, and a form button.
S402, the server determines a target data domain to which the target service data belongs in the context information.
In an implementation manner, the server may determine, of context information corresponding to the target user identifier, newly recorded form information as form information associated with the target service data, and determine, based on the determined form information, a target data domain to which the target service data belongs.
In an embodiment, with reference to fig. 5, in the above S402, that is, when the server determines the target data domain to which the target service data belongs in the context information, as shown in fig. 6, an optional implementation manner is provided in an embodiment of the present application, which specifically includes: S501-S502.
S501, the server determines the current form information in the context information.
Wherein the current form information includes annotation information. The annotation information may be used to represent the data fields associated with the form. I.e., type information of the data that the form is capable of collecting.
In one possible approach, the staff member may set different annotation information for the forms with different functions in the server in advance.
In an implementation manner, the server may determine, according to a time sequence, the last form information recorded in the context information corresponding to the target user identifier as the current form information. The current form information is the form information associated with the target business data.
S502, the server determines the data domain in the annotation information as a target data domain.
In an implementation manner, after determining the current form information, the server may determine the data field in the annotation information as a target data field to which the target business data belongs, so as to further determine a data source to which the target business data belongs.
In an embodiment, with reference to fig. 4, after the foregoing S304, that is, after the server configures the database connection between the terminal and the target data source, as shown in fig. 7, the data routing method provided in this embodiment of the present application further includes: S601-S602.
S601, the server determines the idle time corresponding to the database connection.
It should be noted that, because the number of database connections that can be supported by the server is limited, the server may monitor the state of the database connection between the terminal and the target data source in order to avoid high-load operation of the system and resource waste caused by long-term idle database connections, and improve scalability and robustness of the data service.
Specifically, the server may determine, in real time or periodically, the last time when the terminal accesses the database connection with the target data source, that is, the last time when the terminal acquires data through the database connection with the target data source, and determine a difference between the last time and the current time as the idle duration corresponding to the database connection between the terminal and the target data source.
S602, when the idle time is longer than or equal to the preset effective time, the server clears the database connection.
In one possible manner, the worker may set a preset validity duration in the server in advance, so as to reasonably judge the validity of the database connection.
In an implementation manner, after determining the idle duration corresponding to the database connection between the terminal and the target data source, the server may compare the idle duration corresponding to the database connection between the terminal and the target data source with a preset effective duration. If the idle time corresponding to the database connection between the terminal and the target data source is greater than or equal to the preset effective time, the terminal is not accessed to the database connection between the terminal and the target data source for a long time. Under the condition, the server can clear the database connection between the terminal and the target data source so as to release the database connection pool resources and improve the influence of the resource utilization rate.
And if the idle time corresponding to the database connection between the terminal and the target data source is less than the preset effective time, indicating that the database connection between the terminal and the target data source is in a normal access state. In this case, the server may continue to monitor the status of the database connection between the terminal and the target data source.
In one possible approach, the server may be configured with a data source reclamation module. The data source reclamation module may include an expiration identification timer and a reclamation timer.
The expiration identifier timer may add an identifier 1 to the database connection between the terminal and the target data source when an idle duration corresponding to the database connection between the terminal and the target data source is greater than or equal to a preset effective duration. The expiration identifier timer may also add an identifier 0 to the database connection between the terminal and the target data source when an idle duration corresponding to the database connection between the terminal and the target data source is less than a preset valid duration.
The identifier 1 is used to indicate that the database connection between the terminal and the target data source has expired, i.e. the terminal has not been accessed for a longer time and the database connection between the target data source. The identifier 0 is used to indicate that the database connection between the terminal and the target data source has not expired, i.e. the database connection between the terminal and the target data source is in a normal access state.
The reclaim timer may clear the database connection with the identifier 1 added for reclamation processing.
In an embodiment, with reference to fig. 4, in the above S303, that is, when the server determines the target data source in the pre-established data source information set based on the user identifier and the target data field, as shown in fig. 8, an optional implementation manner is provided in the embodiment of the present application, which specifically includes: S701-S702.
S701, the server determines a data source information subset corresponding to the target user identification in the data source information set as a target data source information subset.
S702, the server determines the data source corresponding to the data domain in the target data source information subset as the target data source.
In an embodiment, with reference to fig. 4, before the above S301, that is, before the server receives a data request message sent by a terminal for requesting access to target service data, as shown in fig. 9, the data routing method provided in this embodiment further includes: S801-S802.
S801, the server receives a login request message which is sent by the terminal and carries the target user identification.
In an implementation manner, a user may perform an account login operation on a login interface of a data service through an input module configured in a terminal, so as to input information such as a target user identifier and a password to the terminal. In response to the account login operation, the terminal may send a login request message carrying information such as a target user identifier and a password to the server. Correspondingly, the server may receive a login request message carrying a target user identifier sent by the terminal.
S802, the server determines the state information of the data source information subset corresponding to the target user identification.
And the state information is used for indicating that the data source in the data source information subset corresponding to the target user identification is in an available state or an unavailable state.
It should be noted that, after the user executes the account login operation on the login interface of the data service through the input module configured by the terminal, the user generally continues to execute operations such as the data request operation and the data configuration operation through the input module configured by the terminal. Accordingly, the terminal needs to respond to various operations of the user to access data in each data source corresponding to the user identifier. In order to prevent the data sources from being inaccessible or delayed when the terminal accesses the data, the server may load each data source corresponding to the user identifier in advance when a user login event is monitored, so as to determine the state information of each data source.
In an implementation manner, when receiving a login request message carrying a target user identifier sent by a terminal, a server may determine a data source information subset corresponding to the target user identifier, and load each data source in the data source information subset. And if the specific data source in the data source information subset corresponding to the target user identification has a loading failure condition or a slow response condition, indicating that the specific data source is in an unavailable state. If the specific data source in the data source information subset corresponding to the target user identifier is loaded successfully and the loading speed is high, it is indicated that the specific data source is in an available state. Based on this, the server may generate state information for a subset of the data source information corresponding to the target user identification.
In a possible manner, when a specific data source in the data source information subset corresponding to the target user identifier is in an unavailable state, the server may send a prompt message to the terminal to prompt that the specific data source in the data source information subset corresponding to the target user identifier is in the unavailable state.
In an embodiment, as shown in fig. 10, a schematic flow chart of a data routing method provided in the embodiment of the present application is shown. Before switching the main flow, that is, before the server establishes the database connection between the terminal and the data source, the user may perform data source configuration in the server in advance to configure the corresponding relationship between the target data domain and the target data source. Correspondingly, the server can load the data source to confirm that the target data source can be normally accessed, and establish the corresponding relation among the target user identifier, the target data domain and the target data source after the loading is successful. Based on this, the server may perform data domain resolution based on the tangent plane after receiving the data request message. For example, the server may parse the context information corresponding to the target user identifier when passing through a Spring Aop (Aspect organized program) section, and determine a target data domain to which the target service data belongs.
The server may then perform a data source switch. Specifically, the server may determine to the target data source by combining the target user identifier and the target data field into a routing key for data source routing based on the routing policy. The server may then confirm the data source connection, i.e. confirm the database connection between the configuration terminal and the target data source.
In a possible manner, after configuring the database connection between the terminal and the target data source, the server may actively pull data in a Database (DB) corresponding to the target data source, and send the data to the terminal. Further, the server may also monitor changes, that is, monitor whether a data source corresponding to the target data domain changes. If the server monitors that the data source corresponding to the target data domain is changed, the server can disconnect the database connection between the terminal and the target data source and configure the database connection between the terminal and the changed data source.
In one possible approach, the server may be configured with timer 1 and timer 2, as well as a cleanup policy. The cleaning strategy can be to add an expiration identifier to the database connection with the idle duration being greater than or equal to the preset effective duration. The timer 1 may mark an expired route based on the cleaning policy, that is, add an expired identifier to the database connection whose idle duration is greater than or equal to the preset valid duration. The timer 2 may be used to clean up stale routes, i.e. database connections to which a stale identification is added.
In the embodiment of the application, after receiving a data request message sent by a terminal and used for requesting access to target service data, a server can determine a target data domain to which the target service data belongs according to a target user identifier carried in the data request message. The server is pre-established with a data source information set comprising a plurality of user identifications and a plurality of data source information subsets, and each data source information subset comprises a plurality of data fields and a plurality of data sources. I.e. the server may support a pre-configuration of multiple data sources per subscriber identity. Therefore, the server may further determine a target data source in the pre-established data source information set based on the user identifier and the target data field to configure a database connection between the terminal and the target data source, so that the terminal may access the target service data in the target data source corresponding to the target data field.
Therefore, when the data routing method provided by the application is applied to the low-code platform, the low-code platform can be supported to manage various types of data related to the SaaS platform, and routing service is provided, so that the requirement of the SaaS platform on the diversity of data sources is met. Therefore, the application can support the combination of the SaaS platform and the low-code platform, and can solve the technical problem that the data source cannot be effectively managed when the SaaS platform and the low-code platform are combined.
The scheme provided by the embodiment of the application is mainly introduced from the perspective of a method. In order to implement the above functions, it includes a hardware structure and/or a software module for performing each function. Those of skill in the art will readily appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as hardware or combinations of hardware and computer software. Whether a function is performed as hardware or computer software drives hardware depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiment of the present application, the terminal may be divided into the functional modules according to the method example, for example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one processing module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. Optionally, the division of the modules in the embodiment of the present application is illustrative, and is only one logic function division, and there may be another division manner in actual implementation.
Fig. 11 is a schematic structural diagram of a data routing apparatus according to an embodiment of the present application. The data routing apparatus may be used to perform the data routing method shown in fig. 4-10. The data routing apparatus should include: a receiving unit 901, a determining unit 902 and a configuring unit 903.
A receiving unit 901, configured to receive a data request message sent by a terminal for requesting target service data. The data request message includes a target user identification. For example, in conjunction with fig. 4, the receiving unit 901 may be configured to perform S301.
A determining unit 902, configured to determine, according to the target user identifier, a target data domain to which the target service data belongs. For example, in conjunction with fig. 4, the determining unit 902 may be configured to perform S302.
The determining unit 902 is further configured to determine a target data source in the pre-established data source information set based on the user identifier and the target data field. The data source information set comprises corresponding relations of a plurality of user identifications and a plurality of data source information subsets. Each data source information subset includes a correspondence of a plurality of data fields and a plurality of data sources. For example, in conjunction with fig. 4, the determining unit 902 may be configured to perform S303.
A configuring unit 903, configured to configure database connection between the terminal and the target data source, so that the terminal obtains the target service data from the target data source. For example, in conjunction with fig. 4, configuration unit 903 may be used to perform S304.
Optionally, the determining unit 902 is specifically configured to:
and determining the context information corresponding to the target user identification. For example, in conjunction with fig. 5, the determining unit 902 may be configured to perform S401.
And determining a target data domain to which the target service data belongs in the context information. For example, in connection with fig. 5, the determining unit 902 may be configured to perform S402.
Optionally, the determining unit 902 is specifically configured to:
determining current form information in the context information. The current form information includes annotation information. For example, in conjunction with fig. 6, the determining unit 902 may be configured to perform S501.
And determining the data field in the annotation information as the target data field. For example, in conjunction with fig. 6, the determining unit 902 may be configured to perform S502.
Optionally, the data routing apparatus further includes: a clear unit 904.
The determining unit 902 is further configured to determine an idle duration corresponding to the database connection. For example, in conjunction with fig. 7, the determining unit 902 may be configured to perform S601.
A clearing unit 904, configured to clear the database connection when the idle duration is greater than or equal to the preset valid duration. For example, in conjunction with fig. 7, the clearing unit 904 may be configured to perform S602.
Optionally, the determining unit 902 is specifically configured to:
and determining a data source information subset corresponding to the target user identification in the data source information set as a target data source information subset. For example, in conjunction with fig. 8, the determining unit 902 may be configured to perform S701.
And determining the data source corresponding to the data domain in the target data source information subset as the target data source. For example, in conjunction with fig. 8, the determining unit 902 may be configured to perform S702.
Optionally, the receiving unit 901 is further configured to receive a login request message sent by the terminal and carrying the target user identifier. For example, in conjunction with fig. 9, the receiving unit 901 may be configured to perform S801.
The determining unit 902 is further configured to determine status information of a data source information subset corresponding to the target user identifier. The status information is used for indicating that the data source in the data source information subset corresponding to the target user identification is in a usable status or a non-usable status. For example, in conjunction with fig. 9, the determining unit 902 may be configured to perform S802.
Those skilled in the art will recognize that in one or more of the examples described above, the functions described herein may be implemented in hardware, software, firmware, or any combination thereof. When implemented in software, the functions may be stored on or transmitted over as one or more instructions or code on a computer-readable medium. Computer-readable media includes both computer-readable storage media and communication media including any medium that facilitates transfer of a computer program from one place to another. A storage media may be any available media that can be accessed by a general purpose or special purpose computer.
Through the above description of the embodiments, it is clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be completed by different functional modules according to needs, that is, the internal structure of the device may be divided into different functional modules to complete all or part of the above described functions.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules or units is only one logical function division, and there may be other division ways in actual implementation. For example, various elements or components may be combined or may be integrated into another device, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form. Units described as separate parts may or may not be physically separate, and parts displayed as units may be one physical unit or a plurality of physical units, may be located in one place, or may be distributed to a plurality of different places. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present application should be covered within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (14)

1. A method of data routing, comprising:
receiving a data request message which is sent by a terminal and used for requesting target service data; the data request message comprises a target user identification;
determining a target data domain to which the target service data belongs according to the target user identification;
determining a target data source in a pre-established data source information set based on the target user identification and the target data domain; the data source information set comprises corresponding relations of a plurality of user identifications and a plurality of data source information subsets; each data source information subset comprises corresponding relations of a plurality of data fields and a plurality of data sources;
and configuring database connection between the terminal and the target data source so that the terminal acquires the target service data from the target data source.
2. The data routing method according to claim 1, wherein the determining a target data domain to which the target service data belongs according to the target user identifier comprises:
determining context information corresponding to the target user identification;
and determining a target data domain to which the target service data belongs in the context information.
3. The data routing method according to claim 2, wherein the determining a target data domain to which the target service data belongs in the context information includes:
determining current form information in the context information; the current form information includes annotation information;
and determining the data field in the annotation information as the target data field.
4. The data routing method of claim 1, wherein after configuring the database connection between the terminal and the target data source, further comprising:
determining the idle time corresponding to the database connection;
and when the idle time length is greater than or equal to the preset effective time length, clearing the database connection.
5. The data routing method of claim 1, wherein determining a target data source in a pre-established set of data source information based on the subscriber identity and the target data field comprises:
determining a data source information subset corresponding to the target user identifier in the data source information set as a target data source information subset;
and determining the data source corresponding to the data domain in the target data source information subset as the target data source.
6. The data routing method according to any one of claims 1 to 5, wherein the receiving terminal sends a data request message for requesting access to the target service data, and further comprising:
receiving a login request message which is sent by the terminal and carries the target user identification;
determining state information of a data source information subset corresponding to the target user identification; the state information is used for indicating that the data source in the data source information subset corresponding to the target user identification is in an available state or an unavailable state.
7. A data routing device, comprising: the device comprises a receiving unit, a determining unit and a configuration unit;
the receiving unit is used for receiving a data request message which is sent by a terminal and used for requesting target service data; the data request message comprises a target user identification;
the determining unit is configured to determine, according to the target user identifier, a target data domain to which the target service data belongs;
the determining unit is further configured to determine a target data source in a pre-established data source information set based on the target user identifier and the target data field; the data source information set comprises corresponding relations between a plurality of user identifications and a plurality of data source information subsets; each data source information subset comprises corresponding relations of a plurality of data fields and a plurality of data sources;
the configuration unit is configured to configure a database connection between the terminal and the target data source, so that the terminal obtains the target service data from the target data source.
8. The data routing device of claim 7, wherein the determining unit is specifically configured to:
determining context information corresponding to the target user identification;
and determining a target data domain to which the target service data belongs in the context information.
9. The data routing device of claim 8, wherein the determining unit is specifically configured to:
determining current form information in the context information; the current form information includes annotation information;
and determining the data field in the annotation information as the target data field.
10. The data routing device of claim 7, further comprising: a clearing unit;
the determining unit is further configured to determine an idle duration corresponding to the database connection;
and the clearing unit is used for clearing the database connection when the idle time length is greater than or equal to the preset effective time length.
11. The data routing device according to claim 7, wherein the determining unit is specifically configured to:
determining a data source information subset corresponding to the target user identifier in the data source information set as a target data source information subset;
and determining the data source corresponding to the data domain in the target data source information subset as the target data source.
12. The data routing device according to any of claims 7-11,
the receiving unit is further configured to receive a login request message that is sent by the terminal and carries the target user identifier;
the determining unit is further configured to determine state information of a data source information subset corresponding to the target user identifier; the state information is used for indicating that the data source in the data source information subset corresponding to the target user identification is in an available state or an unavailable state.
13. A data routing device comprising a memory and a processor; the memory is used for storing computer execution instructions, and the processor is connected with the memory through a bus; the computer-executable instructions stored by the memory are executed by the processor when the data routing device is operating to cause the data routing device to perform the data routing method of any of claims 1-6.
14. A computer-readable storage medium comprising computer-executable instructions that, when executed on a computer, cause the computer to perform the data routing method of any of claims 1-6.
CN202211421758.3A 2022-11-14 2022-11-14 Data routing method, device and storage medium Pending CN115905383A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211421758.3A CN115905383A (en) 2022-11-14 2022-11-14 Data routing method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211421758.3A CN115905383A (en) 2022-11-14 2022-11-14 Data routing method, device and storage medium

Publications (1)

Publication Number Publication Date
CN115905383A true CN115905383A (en) 2023-04-04

Family

ID=86470538

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211421758.3A Pending CN115905383A (en) 2022-11-14 2022-11-14 Data routing method, device and storage medium

Country Status (1)

Country Link
CN (1) CN115905383A (en)

Similar Documents

Publication Publication Date Title
CN104254844B (en) The network printer is exposed to WI FI clients
KR101882426B1 (en) Software updating method, system, and device
EP3808053B1 (en) Queryless device configuration determination-based techniques for mobile device management
CN104380277A (en) Method, system, and device for managing server hardware resources in a cloud scheduling environment
CN109600769B (en) Communication method and device
CN101018227A (en) Data management device, storage medium having data management program, protocol switching device and method
CN103516851B (en) A kind of wireless product cloud test platform system
CN102546166A (en) Method, system and device for identity authentication
KR101190930B1 (en) Techniques for distributed management of wireless devices with shared resources between wireless components
CN115905383A (en) Data routing method, device and storage medium
CN105228139B (en) A kind of call processing method, device and equipment based on smart machine
CN106951294B (en) Method and equipment for providing service for cross-system application
US10244051B2 (en) Cloud metadata discovery API
CN115098020A (en) Storage management method, device and storage medium
CN114827924A (en) Service information acquisition method, device and storage medium
CN114302351A (en) Short message service processing method and device, computer equipment and storage medium
JP2019041241A (en) Distribution system
CN113094131A (en) Prompt resource display method, device, terminal, server and storage medium
Isaiadis et al. A lightweight platform for integration of mobile devices into pervasive grids
CN115460676B (en) State management method, device and storage medium
Vambase et al. Cooperative clustering protocol for mobile devices with bluetooth and Wi-Fi interface in mLearning
CN116260857A (en) Information query method, device and storage medium
KR101596062B1 (en) Data and Event Sharing System and Method among Personal Devices
JP2010108301A (en) Line performance data gathering system, line performance data gathering method, thin client terminal, and program
CN116069560A (en) Data backup method, device 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