Resource access method and device, electronic device, and storage medium
By renaming and merging the query type data of system configuration files in Graphql cluster deployment, the naming conflict problem during system configuration files merging is solved, and parallel access and efficient management of multi-system resource data is realized.
Patent Information
- Application Number
- CN202011505941.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-12-18
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2040-12-18
AI Technical Summary
When deploying Graphql in a cluster, multiple different system configuration files are merged easily cause conflicts in type definition, query and modification methods, resulting in the Graphql service being unable to be correctly parsed and the resources being unable to be correctly accessed.
By obtaining the system configuration file, determining the query type data, and renaming it through the system shortcode, combining the system configuration files of different systems to generate the target configuration file, and accessing the resource data in the database based on the configuration file.
It solves the naming conflict problem of query type data in multiple system configuration files, realizes parallel access to multiple system resource data, improves the access and management efficiency of resource data, and reduces the access pressure of the system.
Smart Images

Figure CN113918515B_ABST
Abstract
Description
Background Art
[0002] With the rapid development of microservice systems and application programming interface development technologies, data interaction on the front end has become increasingly complex. It has become an inevitable requirement of the times for the server to be able to provide the data required by the client at a low cost and high efficiency.
[0003] Graphql (Graph query language) is an application-layer query language that can accurately query data according to user needs without returning redundant data. At the same time, Graphql can merge multiple requests into one query statement without interface version management issues. However, when Graphql is deployed in a cluster, the Graphql server serves as a unified entry point for multiple microservices, merging multiple different system configuration files (schema) into a large system configuration file. This can easily cause conflicts in type definition, query, and modification methods. When a conflict occurs, the Graphql service cannot parse correctly, which ultimately results in the inability to access resources correctly.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the embodiments of the present disclosure is to provide a resource access method, device, electronic device and computer-readable storage medium, thereby overcoming, at least to a certain extent, the problem of element naming conflicts among multiple different system configuration files in the related technical solutions, as well as the problem of being unable to correctly access resource data due to element naming conflicts.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] According to a first aspect of an embodiment of the present disclosure, a resource access method is provided, including:
[0008] Obtaining a system configuration file, and determining query type data in the system configuration file;
[0009] Determine the system short code corresponding to the system configuration file, and rename the query type data according to the system short code;
[0010] Merging the system configuration files of different systems according to the renamed query type data to obtain a target configuration file;
[0011] The resource data in the database is accessed based on the merged target configuration file.
[0012] In some example embodiments of the present disclosure, based on the foregoing solution, the method further includes:
[0013] Determine a parsing function corresponding to the renamed query type data and an initial function name corresponding to the parsing function in the system configuration file;
[0014] The initial function name is renamed in combination with the renamed query type data and the system short code to obtain a target function name, so as to map the parsing function to the corresponding renamed query type data.
[0015] In some example embodiments of the present disclosure, based on the above solution, the step of renaming the query type data by using the system short code includes:
[0016] Detecting an attribute of a query type in the query type data;
[0017] When it is detected that the attribute of the query type in the query type data is a user-defined type, renaming the query type data by using the system short code;
[0018] When it is detected that the attribute of the query type in the query type data is a default type, the query type data is renamed using the system short code.
[0019] In some example embodiments of the present disclosure, based on the above solution, when it is detected that the attribute of the query type in the query type data is a custom type, the query type data is renamed using the system short code, including:
[0020] When it is detected that the attribute of the query type in the query type data is a user-defined type, obtaining an initial query type name corresponding to the query type;
[0021] The system short code is added to the initial query type name to implement a renaming process on the query type data and obtain a target query type name.
[0022] In some example embodiments of the present disclosure, based on the above solution, the step of renaming the initial function name in combination with the renamed query type data and the system short code to obtain the target function name includes:
[0023] When it is detected that the attribute corresponding to the parsing function is of a user-defined type, the system short code is added to the initial function name in combination with the renamed query type data to obtain the target function name;
[0024] After obtaining the name of the objective function, the method further includes:
[0025] The parsing function is mapped to the corresponding renamed query type data according to the target function name.
[0026] In some example embodiments of the present disclosure, based on the above solution, when it is detected that the attribute of the query type in the query type data is of a default type, renaming the query type data by using the system short code includes:
[0027] When it is detected that the attribute of the query type in the query type data is a default type, obtaining an initial query type name corresponding to the query type;
[0028] Obtaining a preset common name, replacing the initial query type name with the common name to rename the query type data, and obtaining a target query type name; and
[0029] The method entry function corresponding to the query type data is determined, and the system short code is added to the name of the method entry function to implement renaming processing of the query type data.
[0030] In some example embodiments of the present disclosure, based on the above solution, the step of renaming the initial function name in combination with the renamed query type data and the system short code to obtain the target function name includes:
[0031] When it is detected that the attribute corresponding to the parsing function is of a default type, obtaining a preset common name, and replacing the initial function name with the common name to obtain a target function name; and
[0032] Determine the method entry function corresponding to the parsing function, and add the system shorthand code to the name of the method entry function to implement renaming processing of the parsing function;
[0033] After obtaining the name of the objective function, the method further includes:
[0034] The parsing function is mapped to the corresponding renamed query type data according to the target function name.
[0035] According to a second aspect of an embodiment of the present disclosure, a resource access device is provided, including:
[0036] A query type data determination module, used to determine the query type data in the system configuration file according to the system configuration file;
[0037] A query type data renaming module, used to determine the system short code corresponding to the system configuration file, and rename the query type data according to the system short code;
[0038] A system configuration file merging module, used to merge the system configuration files of different systems according to the renamed query type data to obtain a target configuration file;
[0039] The resource data access module is used to access the resource data in the database based on the merged target configuration file.
[0040] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the resource access device also includes a target function mapping unit, and the target function mapping unit is configured to: determine the parsing function corresponding to the renamed query type data and the initial function name corresponding to the parsing function in the system configuration file; rename the initial function name in combination with the renamed query type data and the system short code to obtain a target function name, so as to map the parsing function to the corresponding renamed query type data.
[0041] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the query type data renaming module further includes a custom type query type data renaming unit, and the custom type query type data renaming unit is configured to: when it is detected that the attribute of the query type in the query type data is a custom type, obtain the initial query type name corresponding to the query type; add the system short code to the initial query type name to implement the renaming processing of the query type data, and obtain the target query type name.
[0042] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the query type data renaming module also includes a default type query type data renaming unit, and the default type query type data renaming unit is configured to: when it is detected that the attribute of the query type in the query type data is the default type, obtain the initial query type name corresponding to the query type; obtain a preset common name, replace the initial query type name with the common name to realize the renaming processing of the query type data, and obtain the target query type name; and determine the method entry function in the query type data, and add the system short code to the name of the method entry function to realize the renaming processing of the query type data.
[0043] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the resource access device also includes a custom type parsing function renaming unit, and the custom type parsing function renaming unit is configured to: when it is detected that the attribute corresponding to the parsing function is a custom type, add the system short code to the initial function name in combination with the renamed query type data to obtain the target function name; after obtaining the target function name, the method also includes: mapping the parsing function to the corresponding renamed query type data according to the target function name.
[0044] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the resource access device also includes a default type parsing function renaming unit, and the default type parsing function renaming unit is configured to: when it is detected that the attribute corresponding to the parsing function is of the default type, add the system short code to the initial function name to obtain the target function name; after obtaining the target function name, the method also includes: mapping the parsing function to the corresponding renamed query type data according to the target function name.
[0045] In an exemplary embodiment of the present disclosure, based on the above-mentioned solution, the system configuration file merging module further includes a system configuration file merging unit, and the system configuration file merging unit is configured to merge the system configuration files of different systems according to the renamed query type data to obtain a target configuration file.
[0046] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:
[0047] The resource access method in the example embodiment of the present disclosure obtains a system configuration file, and determines the query type data in the system configuration file; determines the system short code corresponding to the system configuration file, and renames the query type data through the system short code; merges the system configuration files of different systems according to the renamed query type data to obtain a target configuration file; and accesses the resource data in the database based on the merged target configuration file. On the one hand, by determining the query type data in the system configuration file and the system short code of the system, the query type data is renamed based on the system short code, thereby solving the naming conflict problem of the query type data in multiple system configuration files; on the other hand, according to the renamed query type data, the system configuration files of different systems are merged to obtain a target configuration file, and based on the target configuration file, the resource data of multiple systems can be called in parallel, which greatly improves the access and management efficiency of resource data; on the other hand, the target resource data can be accessed based on the merged target configuration file, and there is no need to integrate the resource data obtained by calling the target configuration files of different systems separately, and no redundant resource data will be returned, thereby reducing the access pressure of the system, and further reducing the technical pressure of integrating resource data.
[0048] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0049] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and together with the specification, are used to explain the principles of the present disclosure. Obviously, the drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0050] Figure 1 A schematic diagram of a process flow of a resource access method according to an embodiment of the present disclosure is shown;
[0051] Figure 2 The flowchart of the objective function generation method according to the embodiment of the present disclosure is schematically shown;
[0052] Figure 3 The following schematically shows a flow chart of renaming query type data according to an embodiment of the present disclosure;
[0053] Figure 4 The flowchart of renaming query type data of a user-defined type according to an embodiment of the present disclosure is schematically shown;
[0054] Figure 5The flowchart of renaming a parsing function of a user-defined type according to an embodiment of the present disclosure is schematically shown;
[0055] Figure 6 The flowchart of renaming default query type data according to an embodiment of the present disclosure is schematically shown;
[0056] Figure 7 A schematic diagram schematically shows a flow chart of a method for generating a target function name corresponding to a parsing function of a default type according to an embodiment of the present disclosure;
[0057] Figure 8 Another flowchart of renaming query type data according to an embodiment of the present disclosure is schematically shown;
[0058] Fig. 9 Another flowchart of renaming a parsing function according to an embodiment of the present disclosure is schematically shown;
[0059] Fig.10 A schematic diagram schematically shows a resource access device according to an embodiment of the present disclosure;
[0060] Fig.11 A schematic diagram schematically shows a structure of a computer system of an electronic device according to an embodiment of the present disclosure;
[0061] Fig.12 A schematic diagram of a computer-readable storage medium according to an embodiment of the present disclosure is schematically shown.
[0062] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts. DETAILED DESCRIPTION
[0063] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be more comprehensive and complete and will fully convey the concept of the example embodiments to those skilled in the art.
[0064] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring the various aspects of the present disclosure.
[0065] Furthermore, the drawings are only schematic illustrations and are not necessarily drawn to scale. The block diagrams shown in the drawings are only functional entities and do not necessarily correspond to physically separate entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0066] In the relevant resource access method, the server needs to call different system configuration files in multiple servers respectively according to the user's access request, obtain part of the resource data, integrate the resource data returned by different servers, and feed back the integrated data to the client, that is, the resource data access process is relatively complicated; in addition, the server cannot access the system configuration files in multiple systems in parallel based on the user's needs, which makes the resource data access efficiency low, and the returned resource data contains resource data that is irrelevant to the user's needs; in addition, the server needs to call multiple system configuration files of different systems multiple times to access the resource data of different systems, which increases the access pressure of different systems.
[0067] Based on one or more of the above problems, in this example embodiment, a resource access method is first provided. The resource access method can be applied to a server with a resource access function, and can also be applied to a terminal device with resource access. This example embodiment does not make any special limitation to this. The following is a detailed description taking the terminal device executing the method as an example.
[0068] Figure 1 A schematic diagram of a resource access method according to an embodiment of the present disclosure is shown; Figure 1 As shown, the resource access method may include the following steps:
[0069] Step S110, obtaining a system configuration file, and determining query type data in the system configuration file;
[0070] Step S120, determining the system short code corresponding to the system configuration file, and renaming the query type data according to the system short code;
[0071] Step S130, merging system configuration files of different systems according to the renamed query type data to obtain a target configuration file;
[0072] Step S140: accessing resource data in the database based on the merged target configuration file.
[0073] According to the resource access method in this example embodiment, on the one hand, by determining the query type data in the system configuration file and the system short codes of multiple systems, the query type data is renamed based on the system short codes, thereby solving the naming conflict problem of the query type data in multiple system configuration files; on the other hand, the system configuration files of different systems are merged according to the renamed query type data to obtain a target configuration file, and the resource data of multiple systems can be called in parallel based on the target configuration file, which greatly improves the access and management efficiency of resource data; on the other hand, the target resource data can be accessed based on the merged target configuration file, and there is no need to integrate the resource data obtained by calling the target configuration files of different systems separately, and no redundant resource data will be returned, which reduces the access pressure of the system and further reduces the technical pressure of integrating resource data.
[0074] The resource access method in this example embodiment will be further described below.
[0075] refer to Figure 1 As shown, in step S110, a system configuration file is obtained, and query type data in the system configuration file is determined.
[0076] In an example embodiment of the present disclosure, a system configuration file may refer to a configuration file for implementing access to resource data in the system. For example, the system configuration file may be a configuration file containing data structures and data types, or a configuration file containing call data structures and data types. Of course, it may also be a configuration file containing other resource data, and this example embodiment does not specifically limit this.
[0077] Query type data may refer to data corresponding to data structures and data types. For example, query type data may be scalar type data such as String, Boolean, ID, Int, Float, etc., or default type data such as Query and Mutation, or technician-defined type data such as Customer, User, etc. Of course, query type data may also be other data such as enumeration types, etc., and this embodiment does not specifically limit this.
[0078] By obtaining the system configuration file, determining the query type data in the system configuration file and the system short code corresponding to the system, renaming the query type data based on the system short code, so as to solve the problem of element naming conflict in the system configuration file when merging multiple system configuration files.
[0079] Step S120: determining the system short code corresponding to the system configuration file, and renaming the query type data according to the system short code.
[0080] In this embodiment, the system short code may refer to the unique identification data of the system. For example, the system short code may refer to the English name corresponding to the system name, or the letter abbreviation corresponding to the system name, or the identification data obtained by combining the system name with random numbers. Of course, the system short code may also refer to other unique identification data of the system, and this embodiment does not specifically limit this.
[0081] For example, the query type name corresponding to the query type data of system A is User, and the query type name corresponding to the query type data of system B is User. The system short code of system A is custa, and the system short code of system B is custb. The query type data of system A and system B are renamed respectively. The name of the renamed query type data of system A is custa_User, and the name of the renamed query type data of system B is custb_User.
[0082] According to the system configuration files of different systems, the system short codes corresponding to the system configuration files are determined, and based on the system short codes, the query type data of different systems are renamed so that there will be no naming conflict problem when merging the system configuration files of different systems.
[0083] Step S130: merging the system configuration files of different systems according to the renamed query type data to obtain a target configuration file.
[0084] In this embodiment, the target configuration file may refer to a configuration file obtained by merging renamed system configuration files of different systems. For example, the target configuration file may be a configuration file corresponding to multiple different renamed query type data, or a configuration file corresponding to a parsing function containing how to access the renamed query type data. Of course, the target configuration file may also be a configuration file containing other data.
[0085] For example, the query type name corresponding to the query type data of system A is User, and the query type data is:
[0086]
[0087] The query type name corresponding to the query type data of system B is User, and the query type data is:
[0088]
[0089]
[0090] Since the system short code of system A is custa and the system short code of system B is custb, the query type data of system A and system B are renamed respectively. The name of the renamed query type data of system A is custa_User and the name of the renamed query type data of system B is custb_User. The system configuration files of system A and system B are merged to obtain the merged query type data:
[0091]
[0092]
[0093] Among them, custa_User and custb_User represent the query type names of the renamed query type data, Query represents the query entry for accessing the resource data of system A and system B, and age, name, and height represent the field names of the queried resource data.
[0094] Based on multiple renamed query type data, the system configuration files containing the renamed query type data are merged and processed. When the server calls the application program interfaces corresponding to multiple system configuration files in parallel, no access failure occurs, which greatly improves the access efficiency of resource data. At the same time, after merging multiple different system configuration files, when modifying the query type data in the system configuration file, there is no need to access different systems one by one, but only need to modify the query type data in a certain system configuration file in the target configuration file, which improves the management efficiency of resource data.
[0095] Step S140: accessing resource data in a database based on the merged target configuration file.
[0096] In this embodiment, the query type data of different systems are determined through the system configuration file, the query type data is renamed according to the attributes of the query type data, and the renamed query type data is merged to obtain the target configuration file, wherein the target configuration file includes the renamed system configuration files of multiple systems, and each system configuration file also includes the renamed parsing function corresponding to the renamed query data, and the resource data can be accurately accessed based on the target configuration file and the query parameters. Among them, the renaming method of the query type data of the scalar type is the same as the renaming method of the query type data of the default type, that is, the query type data is renamed with their respective common names. This scheme mainly introduces the renaming process of the query type data of the custom type and the default type.
[0097] For example, after obtaining the target configuration file from the merged query type data as mentioned above, when the client passes the query parameters of system A such as id: 1234 to the server, and the client passes the query parameters of system B such as id: 5678 to the server, the server can call the query entry Query of the resource data of system A and system B, access the resource data of system A and system B in parallel, and return the age and name information of the user with ID number 1234 in system A and the name and height of the user with ID number 5678 in system B to the client or the interactive interface, thereby realizing asynchronous parallel access to multiple systems.
[0098] In this example, the Figure 2 Steps in renaming the parsing function corresponding to the query type data:
[0099] refer to Figure 2 As shown, step S210, determining the parsing function corresponding to the renamed query type data and the initial function name corresponding to the parsing function in the system configuration file;
[0100] Step S220, renaming the initial function name in combination with the renamed query type data and the system short code to obtain a target function name, so as to map the parsing function to the corresponding renamed query type data.
[0101] Among them, the parsing function may refer to a function that combines query type data to achieve resource data access. For example, the parsing function may be a parsing function whose function attributes are scalar types such as String, Boolean, ID, Int, Float, etc., or a parsing function whose function attributes are default types such as Query and Mutation, or a parsing function of a type customized by technicians such as Customer, User, etc. Of course, the parsing function may also be other functions, and this embodiment does not specifically limit this.
[0102] The target function name may refer to the name corresponding to the parsing function obtained by merging multiple renamed parsing functions. For example, the name of the target function may be the name of a scalar type such as String, Boolean, ID, Int, Float, etc., or it may be the name of a type customized by a technician such as Customer, User. Of course, the name of the target function may also be other names, and this embodiment does not make any special limitation to this.
[0103] Since the query type data includes custom type data and default type data, the query type data obtained after the query type data is renamed is also different. If the parsing function is not renamed corresponding to the renamed query type data, the parsing function cannot obtain the database information corresponding to the renamed query type data according to the renamed query type data and the instruction to access the resource data, and thus cannot return the correct resource data. When the parsing function is renamed in combination with the renamed query type data and the system short code, the renamed parsing function can correctly access the resource data based on the method entry function in the renamed query type data on the basis of the renamed query type data.
[0104] For example, the query type data of system a is:
[0105]
[0106] Assuming that the system code of system a is a, and the query parameter of id passed in by the client is 123456789, the renamed query type data is as follows:
[0107]
[0108] It can be seen that the renamed query type data is a custom type, the query entry name of the renamed query type data is a_Customer, and the target function name of the renamed parsing function is a_Customer. According to the data query instruction and the renamed parsing function, the resource data obtained is as follows:
[0109]
[0110] From the above code, we can see that the customer with ID number 123456789 and age 22 has successfully completed the challenge and won the third prize. Since the client only needs to query the information of the customer with ID number 123456789 and age 22, the server will not return information that is not related to the customer, which improves the efficiency of the client's access to resource data.
[0111] In this example, the Figure 3 The steps in the above step are to realize renaming processing of the query type data;
[0112] refer to Figure 3 As shown, step S310, detecting the attributes of the query type in the query type data:
[0113] Step S320, when it is detected that the attribute of the query type in the query type data is a user-defined type, renaming the query type data using the system short code;
[0114] Step S330: When it is detected that the attribute of the query type in the query type data is a default type, the query type data is renamed using the system short code.
[0115] Among them, the attribute of the query type can refer to the identification information representing the type of the query type data. For example, the attribute of the query type can be a custom type, a default type, or a scalar type. Of course, the query type can also be other types, and this example embodiment does not make any special limitations on this.
[0116] Since the system short code of each system is the unique identification data of each system, adding the system short code to the query type data can make the query type data of each system different, and thus there will be no element naming conflict when merging the query type data of multiple systems.
[0117] In this embodiment, when it is detected that the attribute of the query type in the query type data is a custom type, Figure 4 The steps in the above are used to implement the operation of renaming the query type data of the custom type;
[0118] refer to Figure 4 As shown, in step S410, when it is detected that the attribute of the query type in the query type data is a custom type, an initial query type name corresponding to the query type is obtained:
[0119] Step S420: Add the system short code to the initial query type name to implement the renaming process of the query type data and obtain the target query type name.
[0120] Among them, the initial query type name can refer to the type name of the query type corresponding to the query type data. For example, the initial query type name can be the name of a custom type, such as custumer, account, user, etc., or it can be the name of a default type such as Query, Mutation, or it can be a scalar type name such as age, height, address. Of course, the initial query type name can also be other type names, and this example embodiment does not make any special limitations on this.
[0121] The target query type name may refer to a renamed query type name. For example, the target query type name may refer to a target query type name of a certain system, or may refer to a target query type name that includes target query type names of multiple systems. Of course, the target query type name may also refer to other query type names, and this embodiment does not specifically limit this.
[0122] For example, the query type data of system A is as follows:
[0123]
[0124] From type User, we can know that the query type of the query type data of system A is a custom type. type indicates the type. The initial query type name corresponding to the query type of the query type data is User, where name, sex, intro, and skills are field names. The returned value of name is a string type, the value of sex is a string type, the value of intro is a string type, and the value of skills is a string array.
[0125] Assuming that the system short code of system A is person, the system short code is added to the initial query type name of the system's query type data. The system short code can be added in front of the initial query type name or after the initial query type name. Of course, the system short code can also be added to the initial query type name of the system's query type data in other ways, and this embodiment does not specifically limit this.
[0126] The query type data after the A system is renamed can be as follows:
[0127]
[0128] In this example, the Figure 5 Follow the steps in to rename the parsing function of the custom type;
[0129] refer to Figure 5 As shown, in step S510, when it is detected that the attribute corresponding to the parsing function is of a custom type, the system short code is added to the initial function name in combination with the renamed query type data to obtain the target function name:
[0130] Step S520: Map the parsing function to the corresponding renamed query type data according to the target function name.
[0131] Among them, the initial function name can refer to the function name corresponding to the function name of the parsed function before the renaming process. For example, the initial function name can be a custom type function name such as custumer, account, user, etc., or it can be a default type name such as Query, Mutation, or it can be a scalar type name such as age, height, address. Of course, the initial query type name can also be other type names, and this example embodiment does not make any special limitations on this.
[0132] The target function name may refer to the function name of the parsing function obtained after renaming the initial function name of the parsing function. For example, the target function name may refer to the renamed function name corresponding to the parsing function of a certain system, or may refer to the renamed function name corresponding to the parsing functions of multiple systems. Of course, the target function name may also refer to the function name corresponding to other parsing functions, and this embodiment does not make any special limitation to this.
[0133] For example, the query type data of system A is as follows:
[0134]
[0135] And the renamed parsing function corresponding to the query type data in system A is as follows:
[0136]
[0137] Among them, args represents the parameters passed by the client, context can refer to the database link, etc. From the parsing function, we can know that the server needs to return the resource data corresponding to the name, sex, and intro fields.
[0138] Assuming that the system code of system A is person, the query type data after renaming system A can be as follows:
[0139]
[0140]
[0141] After renaming the query type data of system A through the system short code, in order to return the name, sex, intro, skills and other information required by the user to the client, the initial function name of the parsing function needs to be renamed.
[0142] The renamed parsing function in system A is as follows:
[0143]
[0144] Since the query type data of the custom type cannot be directly called by the server, it is necessary to set the query entry corresponding to the system. The query entry corresponding to system A is as follows:
[0145] type Query{
[0146] person_User(id: ID): Person
[0147] };
[0148] Among them, person_User is the field that the server needs to return, id:ID means that the parameter passed in by the client is ID, and the type of the field returned by the server is Person type.
[0149] By passing in the parameter id: 123456, combined with the renamed query type data and parsing function, the resource data returned by the server can be obtained as follows:
[0150]
[0151] Therefore, according to the renamed query type data and parsing function, as well as the query parameters passed in by the client, it can be obtained that the person with ID number 123456 is a male blogger named zhaiqianfeng, who is proficient in Linux, Java, nodeJs, Web client: Html5, JavaScript, CSS3.
[0152] In this embodiment, when it is detected that the attribute of the query type in the query type data is a default type, Figure 6 The steps in the above code are used to rename the query type data.
[0153] refer to Figure 6 As shown, in step S610, when it is detected that the attribute of the query type in the query type data is a default type, an initial query type name corresponding to the query type is obtained:
[0154] Step S620, obtaining a preset common name, replacing the initial query type name with the common name to rename the query type data, and obtaining a target query type name;
[0155] Step S630, determining the method entry function in the query type data, and adding the system short code to the name of the method entry function to implement renaming processing on the query type data.
[0156] Among them, the generic name can refer to a query type name after merging the query type data of multiple systems. For example, the generic name can refer to the generic name of the query type, Query, and can also refer to the generic name of the modification type, Mutation. Of course, it can refer to other types of generic names, and this embodiment does not make any special limitations on this.
[0157] The target query type name may refer to the query type name after the query type data is renamed. For example, the target query type name may refer to the query type name corresponding to a certain renamed query type data, or may refer to the query type names corresponding to multiple renamed query type data. Of course, it may also refer to other query type names, and this embodiment does not make any special limitation to this.
[0158] The method entry function may refer to a function that can return the resource data required by the client. For example, the method entry function may refer to a function related to the query parameters, or it may refer to a function related to the target query type name. Of course, the method entry function may refer to other functions, and this embodiment does not specifically limit this.
[0159] For example, the abbreviation code of system A is custa, and the query type data of system A is as follows:
[0160]
[0161] In system A, from query: AQuery, we can know that the query type data of the system is query type, and the initial query type name is AQuery, and the name of the method entry function is findCustomerById. The initial query type in the query type data is renamed according to the common name of the query type Query, and the method entry function in the query type data is renamed based on the system A short code custa. The renamed query type data is as follows:
[0162] Similarly, assuming that the system code of B is custb, the modification type data of system B is as follows:
[0163]
[0164] In the B system, from mutation: BMutation, we know that the query type data of the system is a modification type, and the initial query type name is BMutation, and the name of the method entry function is findUerById. The initial query type in the query type data is renamed according to the common name of the query type Mutation, and the method entry function in the query type data is renamed based on the B system short code custb. The renamed query type data is as follows:
[0165]
[0166] In this embodiment, when it is detected that the attribute of the parsing function corresponding to the query type data is of the default type, Figure 7 The steps in the above code are used to rename the parsing function.
[0167] refer to Figure 7 As shown, in step S710, when it is detected that the attribute corresponding to the parsing function is of the default type, a preset common name is obtained, and the target function name is obtained by replacing the initial function name with the common name:
[0168] Step S720, determining the method entry function corresponding to the parsing function, and adding the system shorthand code to the name of the method entry function to implement renaming processing of the parsing function;
[0169] Step S730: Map the parsing function to the corresponding renamed query type data according to the target function name.
[0170] Among them, the initial function name of the parsing function is renamed according to the common name to obtain the parsing function corresponding to the target function name, and the renamed parsing function is registered to the query type data after the renamed process, so that the server can directly access the resource data in the database and return the resource data to the interactive interface.
[0171] For example, the query type data after system A is renamed is as follows:
[0172]
[0173] Based on the renaming method of the default type of query type data, we can know from query:Query that the query type data of system A is the query type, and the renamed query type name is Query; according to custa_hero and custa_Droid, the system short code of system A is custa. Based on the renamed query type data and the system short code of system A, the default type of parsing function corresponding to the query type data of system A is renamed, and the renamed parsing function is as follows:
[0174]
[0175]
[0176] Specifically, in this embodiment, it is assumed that the query type data of system A is as follows:
[0177]
[0178] The query type data of system B is as follows:
[0179]
[0180] According to the query in system A: AQuery, system A has default query type data, and according to typeCustomer, system A also has custom query type data; similarly, system B has default query type data and custom query type data. The system can Figure 8The steps in are used to rename the query type data in system A;
[0181] refer to Figure 8 As shown, step S801, obtain the system configuration file, determine the query type data in the system configuration file, system decoding and the method entry function corresponding to the query type data:
[0182] Step S802, parsing the initial query name corresponding to the query type in the query type data;
[0183] Step S803, detecting whether the query type of the query type data is a user-defined type, if the query type of the query type data is a user-defined type, executing step S804, otherwise jumping to S806;
[0184] Step S804, renaming the initial query name of the query data of the user-defined type based on the system short code to obtain a target query name;
[0185] Step S805: Merge the renamed custom query type data of different systems
[0186] Step S806, renaming the initial query name of the default type of query data based on the common name to obtain a target query name Query / Mutation;
[0187] Step S807, renaming the method entry function of the default type of query data based on the system short code;
[0188] Step S808, merging the renamed default type query type data of different systems;
[0189] Step S809, merging the renamed query type data of different systems.
[0190] Specifically, assuming that the system short codes of system A and system B are custa and custb respectively, the default type of query type data in system A: query:AQuery is renamed to Query through the generic name of the query type Query, that is, the query type data AQuery in system A is renamed to Query.
[0191] Similarly, the initial query type name BQuery corresponding to the default type query type data of system B is renamed to Query through the common name of the query type Query, that is, the BQuery of the query type data in system B is renamed to Query, and the default type query type data of systems A and B are merged.
[0192] At the same time, according to the system short code custa of system A, the query type data of custom types findCustomerById, Customer, and SingleResult in system A are renamed to: custa_findCustomerById, custa_Customer, and custa_SingleResult; according to the system short code custb, the query type data of custom types findCustomerById, Customer, and SingleResult in system B are renamed to: custb_findCustomerById, custb_Customer, and custa_SingleResult, and the query type data of custom types of systems A and B are merged.
[0193] After merging the default query type data and the custom query type data of system A and system B, the query type data obtained is as follows:
[0194]
[0195]
[0196] After the query type data of system A and system B are merged, the function names in the parsing functions in system A and system B need to correspond to the query type names of the renamed query type data, that is, the parsing functions of system A and system B are also renamed, and the renamed parsing functions are also merged, and the merged parsing functions are registered to the merged query type data. When the client passes in the query parameters, the server can asynchronously and concurrently access the resource data in system A and system B according to the merged query type data and parsing function, and return the resource data corresponding to the query parameters to the interactive interface, thereby improving the access efficiency of resource data.
[0197] Given that system A and system B contain custom type parsing functions and default type query type data, the corresponding A and system B also contain custom type parsing functions and default type parsing functions, which can be obtained through Fig. 9 The steps in are used to rename the parsing function corresponding to the query type data;
[0198] refer to Fig. 9 As shown, step S901, obtain the system configuration file and the renamed query type data, and determine the parsing function and system decoding corresponding to the renamed query type data:
[0199] Step S902, querying the initial function name corresponding to the parsing function;
[0200] Step S903, detecting whether the attribute of the parsing function is a user-defined type, if the attribute of the parsing function is a user-defined type, executing step S904, otherwise jumping to step S907;
[0201] Step S904, adding the system short code to the initial function name in combination with the renamed query type data, so as to implement the renaming process of the parsing function name of the user-defined type;
[0202] Step S905, registering the parsing function to the corresponding renamed query type data according to the target function name;
[0203] Step S906, merging the renamed parsing functions of the user-defined types in different systems;
[0204] Step S907, adding the system short code to the initial function name to obtain the target function name;
[0205] Step S908, mapping the parsing function to the corresponding renamed query type data according to the target function name;
[0206] Step S909, merging the renamed default type parsing functions of different systems;
[0207] Step S910, merging the renamed default types and the parsing functions of the user-defined types of different systems.
[0208] If the system code of system A is custa, and the parsing function of the custom type of system A is as follows:
[0209]
[0210] If the system code of system B is custb, the default type of parsing functions included in system B are as follows:
[0211]
[0212]
[0213] At the same time, in system A, the query entry of the default type of parsing function is: query: AQuery, so AQuery needs to be renamed according to the common name of the query type Query, and success and name in AQuery also need to be renamed according to the system short code custa. The parsing function after the renaming is as follows:
[0214]
[0215] Since the process of renaming the parsing function in system B is the same as the process of renaming the parsing function in system A, it will not be repeated here.
[0216] The parsing function of the default type after renaming in system B is as follows:
[0217]
[0218]
[0219] Combined with the merged query type data in the above-mentioned system A and system B, the renamed custom type resolution function and the default type resolution function in system A and system B are merged and registered to the merged query type data in system A and system B, so that the resource data of system A and system B can be accessed asynchronously and in parallel.
[0220] In summary, the resource access method in the exemplary embodiment of the present disclosure obtains a system configuration file and determines the query type data in the system configuration file; determines the system short code corresponding to the system configuration file, and renames the query type data through the system short code; merges the system configuration files of different systems according to the renamed query type data to obtain a target configuration file; and accesses the resource data in the database based on the merged target configuration file. On the one hand, by determining the query type data and the system short code in the system configuration file, the query type data is renamed based on the system short code, thereby solving the naming conflict problem of the query type data in multiple system configuration files; on the other hand, by merging the system configuration files of different systems according to the renamed query type data to obtain a target configuration file, the resource data of multiple systems can be called in parallel based on the target configuration file, thereby greatly improving the access and management efficiency of the resource data; on the other hand, the target resource data can be accessed based on the merged target configuration file, and there is no need to integrate the resource data obtained by calling the target configuration files of different systems separately, thereby reducing the access pressure of the system, and further reducing the technical pressure of integrating the resource data.
[0221] It should be noted that, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0222] In addition, in this exemplary embodiment, a resource access device is also provided. Fig.10As shown, the resource access device 1000 includes: a query type data determination module 1010, a query type data renaming module 1020, a system configuration file merging module 1030 and a resource data access module 1040. Among them:
[0223] A query type data determination module 1010, configured to determine the query type data in the system configuration file according to the system configuration file;
[0224] A query type data renaming module 1020 is used to determine the system short code corresponding to the system configuration file, and rename the query type data according to the system short code;
[0225] A system configuration file merging module 1030 is used to merge the system configuration files of different systems according to the renamed query type data to obtain a target configuration file;
[0226] The resource data access module 1040 is used to access the resource data in the database based on the merged target configuration file.
[0227] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the resource access device 1000 also includes a target function mapping unit, and the target function mapping unit is configured to: determine the parsing function corresponding to the renamed query type data and the initial function name corresponding to the parsing function in the system configuration file; rename the initial function name in combination with the renamed query type data and the system short code to obtain a target function name, so as to map the parsing function to the corresponding renamed query type data.
[0228] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the query type data renaming module 1020 further includes a custom type query type data renaming unit, and the custom type query type data renaming unit is configured to: when it is detected that the attribute of the query type in the query type data is a custom type, obtain the initial query type name corresponding to the query type; add the system short code to the initial query type name to implement the renaming processing of the query type data, and obtain the target query type name.
[0229] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the query type data renaming module 1020 also includes a default type query type data renaming unit, and the default type query type data renaming unit is configured to: when it is detected that the attribute of the query type in the query type data is the default type, obtain the initial query type name corresponding to the query type; obtain a preset common name, replace the initial query type name with the common name to realize the renaming processing of the query type data, and obtain the target query type name; and determine the method entry function in the query type data, and add the system short code to the name of the method entry function to realize the renaming processing of the query type data.
[0230] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the resource access device 1000 also includes a custom type parsing function renaming unit, and the custom type parsing function renaming unit is configured to: when it is detected that the attribute corresponding to the parsing function is a custom type, add the system short code to the initial function name in combination with the renamed query type data to obtain the target function name; after obtaining the target function name, the method also includes: mapping the parsing function to the corresponding renamed query type data according to the target function name.
[0231] In an exemplary embodiment of the present disclosure, based on the aforementioned scheme, the resource access device 1000 also includes a default type of parsing function renaming unit, and the default type of parsing function renaming unit is configured to: when it is detected that the attribute corresponding to the parsing function is of the default type, add the system short code to the initial function name to obtain the target function name; after obtaining the target function name, the method also includes: mapping the parsing function to the corresponding renamed query type data according to the target function name.
[0232] In an exemplary embodiment of the present disclosure, based on the aforementioned solution, the system configuration file merging module 1030 further includes a system configuration file merging unit, and the system configuration file merging unit is configured to merge the system configuration files of different systems according to the renamed query type data to obtain a target configuration file.
[0233] The specific details of each module of the resource access device mentioned above have been described in detail in the corresponding resource access method, so they will not be repeated here.
[0234] In addition, in an exemplary embodiment of the present disclosure, an electronic device capable of implementing the above resource access method is also provided.
[0235] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware embodiments, complete software embodiments (including firmware, microcode, etc.), or embodiments combining hardware and software aspects, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0236] Refer to the following Fig.11 1100 according to this embodiment of the present disclosure is described. Fig.11 The electronic device 1100 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0237] like Fig.11 As shown, the electronic device 1100 is in the form of a general computing device. The components of the electronic device 1100 may include, but are not limited to: the at least one processing unit 1110, the at least one storage unit 1120, a bus 1130 connecting different system components (including the storage unit 1120 and the processing unit 1110), and a display unit 1140.
[0238] The storage unit stores a program code, which can be executed by the processing unit 1110, so that the processing unit 1110 performs the steps according to various exemplary embodiments of the present disclosure described in the above “Exemplary Method” section of this specification. For example, the processing unit 1110 can perform the following steps: Figure 1 In step S110 shown in the figure, a system configuration file is obtained, and query type data in the system configuration file is determined; in step S120, a system short code corresponding to the system configuration file is determined, and the query type data is renamed by the system short code; in step S130, the system configuration files of different systems are merged according to the renamed query type data to obtain a target configuration file; in step S140, resource data in a database is accessed based on the merged target configuration file.
[0239] The storage unit 1120 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 1121 and / or a cache memory unit 1122 , and may further include a read-only memory unit (ROM) 1123 .
[0240] The storage unit 1120 may also include a program / utility 1124 having a set (at least one) of program modules 1125, such program modules 1125 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0241] Bus 1130 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0242] The electronic device 1100 may also communicate with one or more external devices 1170 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 1100, and / or communicate with any device that enables the electronic device 1100 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 1150. Furthermore, the electronic device 1100 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 1160. As shown, the network adapter 1160 communicates with other modules of the electronic device 1100 via a bus 1130. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 1100, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0243] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0244] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the above method of the present specification is stored. In some possible embodiments, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to enable the terminal device to perform the steps according to various exemplary embodiments of the present disclosure described in the above "Exemplary Method" section of the present specification.
[0245] refer to Fig.12As shown, a program product 1200 for implementing the above-mentioned resource access method according to an embodiment of the present disclosure is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0246] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0247] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0248] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0249] Program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0250] It should be noted that although several modules or units of the resource access device are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0251] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the embodiment of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiment of the present disclosure.
[0252] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0253] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A resource access method, characterized in that: include: Obtaining a system configuration file, and determining query type data in the system configuration file; Determine the system short code corresponding to the system configuration file, and rename the query type data according to the system short code; Determine a parsing function corresponding to the renamed query type data and an initial function name corresponding to the parsing function in the system configuration file; Rename the initial function name in combination with the renamed query type data and the system short code to obtain a target function name, so as to map the parsing function to the corresponding renamed query type data; Merging the system configuration files of different systems according to the renamed query type data to obtain a target configuration file; The resource data in the database is accessed based on the merged target configuration file.
2. The resource access method according to claim 1, characterized in that: The renaming process of the query type data by using the system short code includes: Detecting an attribute of a query type in the query type data; When it is detected that the attribute of the query type in the query type data is a user-defined type, renaming the query type data by using the system short code; When it is detected that the attribute of the query type in the query type data is a default type, the query type data is renamed using the system short code.
3. The resource access method according to claim 2, characterized in that: When it is detected that the attribute of the query type in the query type data is a user-defined type, renaming the query type data by using the system short code includes: When it is detected that the attribute of the query type in the query type data is a user-defined type, obtaining an initial query type name corresponding to the query type; The system short code is added to the initial query type name to implement a renaming process on the query type data and obtain a target query type name.
4. The resource access method according to any one of claims 1 or 3, characterized in that: The step of renaming the initial function name in combination with the renamed query type data and the system short code to obtain a target function name includes: When it is detected that the attribute corresponding to the parsing function is of a user-defined type, the system short code is added to the initial function name in combination with the renamed query type data to obtain the target function name; After obtaining the name of the objective function, the method further includes: The parsing function is mapped to the corresponding renamed query type data according to the target function name.
5. The resource access method according to claim 2, characterized in that: When it is detected that the attribute of the query type in the query type data is a default type, renaming the query type data by using the system short code includes: When it is detected that the attribute of the query type in the query type data is a default type, obtaining an initial query type name corresponding to the query type; Obtaining a preset common name, replacing the initial query type name with the common name to rename the query type data, and obtaining a target query type name; and The method entry function corresponding to the query type data is determined, and the system short code is added to the name of the method entry function to implement renaming processing of the query type data.
6. The resource access method according to any one of claims 1 or 5, characterized in that: The step of renaming the initial function name in combination with the renamed query type data and the system short code to obtain a target function name includes: When it is detected that the attribute corresponding to the parsing function is of a default type, obtaining a preset common name, and replacing the initial function name with the common name to obtain a target function name; and Determine the method entry function corresponding to the parsing function, and add the system shorthand code to the name of the method entry function to implement renaming processing of the parsing function; After obtaining the name of the objective function, the method further includes: The parsing function is mapped to the corresponding renamed query type data according to the target function name.
7. A resource access method and device, characterized in that: The device comprises: A query type data determination module, used to determine the query type data in the system configuration file according to the system configuration file; A query type data renaming module, used to determine the system short code corresponding to the system configuration file, and rename the query type data according to the system short code; a target function mapping module, used to determine the parsing function corresponding to the renamed query type data and the initial function name corresponding to the parsing function in the system configuration file; rename the initial function name in combination with the renamed query type data and the system short code to obtain a target function name, so as to map the parsing function to the corresponding renamed query type data; A system configuration file merging module, used to merge the system configuration files of different systems according to the renamed query type data to obtain a target configuration file; The resource data access module is used to access the resource data in the database based on the merged target configuration file.
8. An electronic device comprising: processor; as well as A memory having computer-readable instructions stored thereon, wherein the computer-readable instructions, when executed by the processor, implement the resource access method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the resource access method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Data integration platform
CN102023982A
Analysis of the impact of application programs on resources stored in data stores
US20060282830A1