CN113687963A - Data calling method and device and computer equipment - Google Patents

Data calling method and device and computer equipment Download PDF

Info

Publication number
CN113687963A
CN113687963A CN202110962775.7A CN202110962775A CN113687963A CN 113687963 A CN113687963 A CN 113687963A CN 202110962775 A CN202110962775 A CN 202110962775A CN 113687963 A CN113687963 A CN 113687963A
Authority
CN
China
Prior art keywords
calling
data
configuration file
service
access request
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.)
Withdrawn
Application number
CN202110962775.7A
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.)
Beijing Qibao Xinan Technology Co ltd
Original Assignee
Beijing Qibao Xinan Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qibao Xinan Technology Co ltd filed Critical Beijing Qibao Xinan Technology Co ltd
Priority to CN202110962775.7A priority Critical patent/CN113687963A/en
Publication of CN113687963A publication Critical patent/CN113687963A/en
Withdrawn legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Abstract

The invention provides a data calling method, a system and computer equipment, which are used for data processing related to Internet resource service, wherein the data calling method comprises the following steps: configuring configuration files related to each internet resource service, and encapsulating the configuration files; receiving an access request of a user; calling the corresponding configuration file after the packaging processing, and sending the access request to a data server; and returning response information data to the user based on the access request. The invention can simplify the data calling process, the server connection process and the abnormal calling handling process, and can improve the development efficiency.

Description

Data calling method and device and computer equipment
Technical Field
The invention relates to the field of computer information processing, in particular to a data calling method and device and computer equipment.
Background
With the development of information data technology, data transmission between application systems is often required, and in the data interaction process of a multi-application system, a situation that a certain application system acquires data from another application system may be involved, and generally, such data interaction is realized by means of interface call.
Data interaction called by the existing interface usually needs to be carried out by the sending party and the receiving party to appoint a path, a format, a processing mode and the like, namely, the development can be started after the message format of the data is confirmed. However, for some application systems, the data is more diverse, the service side needs to provide a great variety of interfaces, and frequent updating is performed, which brings great difficulty to the cooperation of the service side and the calling side. In addition, in the process of project development, for data calling of the Redis database, each developer needs to use the Redis extension of the PHP for calling, and the problems of complex data calling process, difficulty and low effectiveness in calling exception handling, low data processing efficiency, blocking of service operation due to calling exception and the like exist.
Therefore, there is a need to provide a more optimized data call method.
Disclosure of Invention
In order to solve the following problems: the data calling process between business personnel and the Redis database is complicated, calling exception handling is difficult, effectiveness is low, data processing efficiency is low, and the like. The invention provides a data calling method, which is used for data processing related to Internet resource service, and the data calling method comprises the following steps: configuring configuration files related to each internet resource service, and encapsulating the configuration files; receiving an access request of a user; calling the corresponding configuration file after the packaging processing, and sending the access request to a data server; and returning response information data to the user based on the access request.
Preferably, the configuring a configuration file related to each internet resource service, and the encapsulating the configuration file includes: and configuring file names, calling time parameters, service ports and service addresses corresponding to different Internet resource services, and service passwords and abnormal judgment rules to generate a plurality of configuration files.
Preferably, the configuring a configuration file related to each internet resource service, and the encapsulating the configuration file includes: and encapsulating the configuration file and the corresponding calling modes thereof, wherein the calling modes comprise a first calling mode and a second calling mode, the first calling mode comprises a Socket mode, and the second calling mode comprises a PHP extension mode.
Preferably, the method further comprises the following steps: and packaging the acquired information of the data server, the connection service between the user and the server, a calling mode, exception handling, calling request duration and an operation instruction to generate a corresponding configuration file.
Preferably, the calling the encapsulated corresponding configuration file and sending the access request to the data server includes: and acquiring the corresponding configuration file after the encapsulation processing through an Executor component, and calling the corresponding configuration file to send the access request to a corresponding data server.
Preferably, the method further comprises the following steps: in the process of sending the access request to the corresponding data server, judging whether calling abnormity occurs according to an abnormity judgment rule in the corresponding configuration file, wherein when the retry time is greater than a set value and/or the calling request time is greater than specified time, the calling abnormity is judged to occur; and the Executor component judges the calling abnormality according to the abnormality judgment rule and acquires the replaced configuration file again so as to execute the calling process again.
Preferably, the method further comprises the following steps: and the Executor component converts the information data to be stored by the user into a specific format, then sends the information data to the data server and stores the information data to the corresponding storage module.
Preferably, the returning response information data to the user based on the access request includes:
and according to the request data of the access request, the Executor component converts the format of the response information from the corresponding service port and then returns the response information to the user.
Furthermore, a second aspect of the present invention provides a data call apparatus for data processing related to an internet resource service, the data call apparatus comprising: the configuration processing module is used for configuring configuration files related to each Internet resource service and packaging the configuration files; the receiving module is used for receiving an access request of a user; the sending module is used for calling the corresponding configuration file after the packaging processing and sending the access request to a data server; and the response processing module returns response information data to the user based on the access request.
Preferably, the configuration processing module is configured to configure a file name, a call time parameter, a service port, a service address, a service password, and an abnormality judgment rule corresponding to different internet resource services, so as to generate a plurality of configuration files; and/or the data calling device further comprises a packaging processing module, wherein the packaging processing module is used for packaging the configuration file and the corresponding calling mode thereof, the calling mode comprises a first calling mode and a second calling mode, the first calling mode comprises a Socket mode, and the second calling mode comprises a PHP extension mode.
Furthermore, a third aspect of the present invention provides a computer device comprising a processor and a memory for storing a computer executable program, which when executed by the processor performs the data call method according to the first aspect of the present invention.
Furthermore, a fourth aspect of the present invention provides a computer program product storing a computer executable program which, when executed, implements the data call method as described in the first aspect of the present invention.
Advantageous effects
Compared with the prior art, the method and the device have the advantages that the configuration files related to the internet resource services are configured, the configuration files are packaged, the packaged configuration files are called to perform data processing such as data calling or data storage, the data calling process, the server connection process and the abnormal calling processing process can be simplified, and the development efficiency can be improved.
Furthermore, the obtained information of the data server, the connection service between the user equipment and the server, the calling mode, the exception handling, the calling request duration and the operation instruction are packaged to generate a corresponding configuration file, so that the calling exception handling and the development process can be further simplified; the data processing process can be further optimized by calling the configuration files of different packaging modes (namely, by judging whether the configuration files are instantly packaged and processed) to carry out the calling process, so that the calling abnormal condition can be effectively judged; the calling abnormal condition can be more effectively judged through the configuration file encapsulated with the abnormal judgment rule, and the abnormal handling process of the calling abnormality can be effectively simplified; response information data is returned to the user through the Executor component based on the access request, so that a data calling process, a server connection process and an abnormal exception handling process can be further simplified, the data processing cost is reduced, and the data calling method is optimized.
Drawings
In order to make the technical problems solved by the present invention, the technical means adopted and the technical effects obtained more clear, the following will describe in detail the embodiments of the present invention with reference to the accompanying drawings. It should be noted, however, that the drawings described below are only illustrations of exemplary embodiments of the invention, from which other embodiments can be derived by those skilled in the art without inventive faculty.
FIG. 1 is a flow chart of an example of a data call method of the present invention.
FIG. 2 is a flow diagram of another example of a data call method of the present invention.
FIG. 3 is a flow chart of yet another example of a data call method of the present invention.
Fig. 4 is a schematic configuration block diagram of an example of a data call apparatus of embodiment 2 of the present invention.
Fig. 5 is a schematic configuration block diagram of another example of the data call apparatus of embodiment 2 of the present invention.
Fig. 6 is a schematic configuration block diagram of still another example of the data call apparatus of embodiment 2 of the present invention.
Fig. 7 is a block diagram of an exemplary embodiment of a computer device according to the present invention.
Fig. 8 is a block diagram of an exemplary embodiment of a computer program product according to the present invention.
Detailed Description
Exemplary embodiments of the present invention will now be described more fully with reference to the accompanying drawings. The exemplary embodiments, however, may be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. Rather, these exemplary embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the invention to those skilled in the art. The same reference numerals denote the same or similar elements, components, or parts in the drawings, and thus their repetitive description will be omitted.
Features, structures, characteristics or other details described in a particular embodiment do not preclude the fact that the features, structures, characteristics or other details may be combined in a suitable manner in one or more other embodiments in accordance with the technical idea of the invention.
In describing particular embodiments, the present invention has been described with reference to features, structures, characteristics or other details that are within the purview of one skilled in the art to provide a thorough understanding of the embodiments. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific features, structures, characteristics, or other details.
The flow charts shown in the drawings are merely illustrative and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, and some operations/steps may be combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
The block diagrams shown in the figures are functional entities only and do not necessarily correspond to physically separate entities. I.e. these functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor means and/or microcontroller means.
It will be understood that, although the terms first, second, third, etc. may be used herein to describe various elements, components, or sections, these terms should not be construed as limiting. These phrases are used to distinguish one from another. For example, a first device may also be referred to as a second device without departing from the spirit of the present invention.
The term "and/or" and/or "includes any and all combinations of one or more of the associated listed items.
In order to further optimize the data calling method, the invention provides a data calling method, which can simplify the data calling process, the process of connecting a server and the abnormal processing process of calling and can improve the development efficiency by configuring the configuration files related to the Internet resource services, encapsulating the configuration files and calling the encapsulated configuration files to perform data processing such as data calling or data storage.
It should be noted that, the innovation of the present invention is how to make the data call process between the user equipment and the database more automated, efficient and reduce the labor cost according to the interaction between the user equipment and the internet service platform (i.e. the information interaction between objects). However, for convenience, the implementation of the method of the present invention is described by taking the data call related to the internet service as an example, but the present invention is not to be construed as being limited thereto. The specific procedure of the data call method will be described in detail below.
In order that the objects, technical solutions and advantages of the present invention will become more apparent, the present invention will be further described in detail with reference to the accompanying drawings in conjunction with the following specific embodiments.
Example 1
Hereinafter, an embodiment of a data calling method of the present invention will be described with reference to fig. 1 to 3.
FIG. 1 is a flow chart of an example of a data call method of the present invention.
As shown in fig. 1, the data call method includes the following steps.
Step S101, configuring configuration files related to each Internet resource service, and encapsulating the configuration files.
Step S102, receiving the access request of the user.
Step S103, calling the corresponding configuration file after the packaging processing, and sending the access request to a data server.
And step S104, returning response information data to the user based on the access request.
It should be noted that, in the invention, the data call method is used for data processing related to internet resource services, and is particularly suitable for data call between user equipment and a database in a development environment or a test environment. The internet service comprises internet service resources such as shopping, riding, mapping, taking out, sharing a single vehicle and the like which are provided by a user device applying to an internet service platform. Such as resource allocation services, resource usage services, resource raising services, resource support or mutual aid services, group buying and taking bus services, etc. Where resources refer to any available substances, information, time, information resources including computing resources and various types of data resources. The data resources include various private data in various domains.
The following takes invoking data related to the internet resource securing service as an example, and the data invoking method is specifically described.
First, in step S101, a configuration file related to each internet resource service is configured, and the configuration file is encapsulated.
Specifically, the service personnel pre-configures configuration files related to each internet resource service, specifically, configures file names, calling time parameters, service ports and service addresses corresponding to different internet resource services, service passwords and an abnormality judgment rule to generate a plurality of configuration files, wherein the plurality of configuration files comprise a first configuration file related to an internet resource guarantee service, a second configuration file related to an internet resource raising service, a third configuration file related to an internet resource mutual assistance service, a fourth configuration file related to an internet resource use service and the like.
It should be noted that the above description is only given by way of example, and the present invention is not limited thereto.
More specifically, the call time parameter includes whether the time for calling the server is overtime, the call duration, and the like.
In one embodiment, a service person makes a data call by calling a configuration file as follows in a web development process related to an internet resource securing service using a PHP ("PHP: Hypertext Preprocessor, alphabetical abbreviation of Hypertext Preprocessor).
For example, the configuration file includes the following.
Figure BDA0003222857120000071
Specifically, the configuration file is called, a data server side needing to be accessed is connected, and a calling mode is determined to respond to data calling.
In order to further simplify the process of connecting the server, simplify the development flow and improve the development efficiency, the invention adopts a calling method provided by the Executor component to carry out data interaction with the data server so as to call corresponding data.
Specifically, the calling method provided by the Executor component includes encapsulating the configuration file and the calling mode corresponding to the configuration file.
Further, the encapsulated configuration file is called, for example, corresponding data is called from a data server of the Redis database, and the called corresponding data is sent to a user device through the Executor component, where the user device is, for example, a user device associated with a developer or other business personnel.
It should be noted that, in the present invention, Redis an open source log-type, Key-Value database written in ANSI C language, supporting network, based on memory and persistent, and providing API in multiple languages.
Specifically, the calling mode includes a first calling mode and a second calling mode, the first calling mode includes a Socket mode, and the second calling mode includes a PHP extension mode.
For the first calling mode, for example, the Socket mode: $ Redis @ fsockopen (Redis server address, port number, error code, error description, timeout);
$ redis- > auth (server password).
For the second calling mode, for example, a PHP extension (redis. so) mode:
$redis=new Redis();
$ Redis- > connect (Redis server address, port number, timeout time);
$redis->setOption(Redis::OPT_SCAN,Redis::SCAN_RETRY);
$ redis- > auth (server password);
thereafter, the operation data call operation is completed by calling the $ redis object.
In another embodiment, the Executor component obtains information of the data server, where the information includes a database name, port information of the server (i.e. data server), and/or an instruction for operating the corresponding database.
Specifically, the obtained information of the data server, the connection service between the user (i.e., user equipment) and the server, the calling mode, the exception handling, the calling request duration and the operation instruction are encapsulated by the Executor component to generate a corresponding configuration file. In other words, the connection method, the calling method, and the like between the user equipment and the data server of the database are encapsulated.
For example, the operation instruction includes a set, zset, hmset, etc. Redis native instruction.
In another embodiment, the network connection process and the operation instruction with the data server of the database are encapsulated by the Executor component to generate a corresponding configuration file.
Therefore, by configuring the configuration files related to the internet resource services and encapsulating the configuration files, call exception handling can be effectively simplified, a development flow can be simplified, and development efficiency can be improved. Furthermore, the obtained information of the data server, the connection service between the user equipment and the server, the calling mode, the exception handling, the calling request duration and the operation instruction are packaged to generate a corresponding configuration file, so that the calling exception handling and the development process can be further simplified.
It should be noted that the above description is only given by way of example, and the present invention is not limited thereto.
Next, a specific procedure of a data call of a user device (i.e. a user, such as a developer, a data operation and maintenance person, etc.) to a specific database, which includes data related to different internet resource services, in this example, a Redis database, will be specifically described.
In step S102, an access request of a user is received.
For example, when the user equipment of a developer is in network connection with a Redis database, the Executor component receives an access request of the developer (or the user equipment), calls a corresponding configuration file according to the access request, and transparently transmits the access request to a data server of the Redis database.
Specifically, the access request includes a user equipment identifier, a data call request, a data storage request, a service port for accessing or calling data, and the like.
In an embodiment, when the access request is a data call request, the access request includes a user equipment identifier, a service port for calling data, and a calling mode.
Optionally, the profile to be invoked is determined, for example, by user equipment identification and/or manner of invocation.
In another embodiment, when the access request is a data storage request, the access request includes a user equipment identifier, data to be stored, accessed database information, an accessible service port, and a calling mode.
Optionally, the configuration file to be invoked is determined, for example, by an accessible service port and/or manner of invocation.
It should be noted that, in the present invention, the configuration file to be called is a corresponding configuration file after encapsulation processing, where the corresponding configuration file is a configuration file corresponding to the access request and after encapsulation processing. The foregoing is illustrative only and is not to be construed as limiting the invention.
In step S103, the encapsulated corresponding configuration file is called, and the access request is sent to the data server.
Specifically, when the execution component receives an access request of a user, the user equipment identifier, the calling mode, the service port and the like in the access request are identified, and a configuration file to be called is determined.
Further, a corresponding configuration file is obtained through an execution component, and the corresponding configuration file is called, so that the access request is sent to a corresponding data server, where the data server is, for example, a server of one server or multiple servers.
Examples of the profile invoked are as follows, for example.
$ conf ═ configuration file;
$ redis ═ Vutils Executor:: loadRedis Executor ($ conf); // initial Redis Call
Note that, since the configuration file in step S103 has the same physical meaning and included data as the configuration file in step S101, the description thereof is omitted.
In one embodiment, it is determined by the Executor component whether the configuration file to be invoked is a configuration file for the just-in-time encapsulation process.
Specifically, when the configuration file is determined to be an instant encapsulation processing configuration file, the information (for example, information including calling time, service port, and the like) of the data service end obtained from the access request of the user, the connection service between the user and the service end (that is, between the user equipment and the service end), the calling mode, exception handling, the calling request duration, and the operation instruction are subjected to instant encapsulation processing, the configuration file after the instant encapsulation processing is obtained, and the configuration file is called, so that the access request is sent to the corresponding data service end.
It should be noted that, in this example, the encapsulation processing modes of the configuration file are set according to the data reuse period and/or the priority of the preset resource service type, where the encapsulation processing modes include an instant encapsulation processing and a pre-encapsulation processing. However, the present invention is not limited to this, and in other examples, the encapsulation process may be set according to other data influence parameters.
And when the configuration file is not the configuration file subjected to the instant encapsulation processing, calling the configuration file subjected to the pre-encapsulation processing to send the access request to the corresponding data server. For example, the configuration file after the pre-encapsulation includes a second configuration file and/or a third configuration file, and the pre-encapsulation is specifically performed on the second configuration file and a corresponding calling manner thereof.
Therefore, the data processing process can be further optimized by calling the configuration files of different packaging modes (namely, by judging whether the configuration files are configuration files for instant packaging processing) to perform the calling process, and the calling abnormal condition can be effectively judged.
Further, in the process of sending the access request to the corresponding data server, whether call exception occurs is judged according to the exception judgment rule in the corresponding configuration file.
Specifically, the Executor component judges that the call is abnormal according to the abnormal judgment rule and re-acquires the replaced configuration file to re-execute the call process.
More specifically, the abnormality determination rule includes determining that the number of retries is greater than a set value, a call request time is greater than a specified time, and the like.
In one embodiment, the call abnormality is determined to have occurred when the number of retries is greater than a set value and/or the call request time is greater than a specified time.
And when the calling abnormity is judged to occur, the replaced configuration file is acquired again so as to execute the calling process again.
Therefore, the calling abnormity can be more effectively judged through the configuration file encapsulated with the abnormity judgment rule, and the abnormity processing process of calling abnormity can be effectively simplified.
In another embodiment, when the access request is a data storage request, the Executor component converts original information data to be stored by a user into a specific format, then sends the converted information data to the data server, and stores the converted information data in a corresponding storage module.
For example, the original information data is converted into, for example, a Json format, and then sent to a data server and stored in a corresponding storage module.
It should be noted that the above description is only given by way of example, and the present invention is not limited thereto. In other examples, conversion to CSS format, XML format, or picture format, among others, may also be possible.
In another embodiment, the method further includes recording a plurality of call time parameters, such as call request time, data call time, total call time, and the like, of each user equipment, and call data corresponding to the call time parameters. And fitting a corresponding relation graph according to the calling time parameter and calling data corresponding to the calling time parameter. And adding the corresponding relation graph into an abnormity judgment rule of a configuration file for calling abnormity judgment.
In still another embodiment, as shown in fig. 2, step S103 is divided into step S103 and step S201.
In step S201, before the corresponding configuration file is called, it is determined whether the configuration file is called for the first time.
Specifically, according to the access request and the access time of the user, whether the call of the user to specific data is the first call is judged, wherein the specific data comprises continuous data related to the resource guarantee service, pushing data of a preferential certificate of a resource guarantee service product, invitation configuration data of preferential activities and the like.
It should be noted that the above description is only given by way of example, and the present invention is not limited thereto. In other examples, the specific data may further include resource usage application or authentication data, resource return data, resource overdue data, and resource collection data, etc. corresponding to the resource allocation service.
Specifically, under the condition that the corresponding configuration file is called for the first time, the corresponding configuration file is called according to the information, calling mode and the like of the service port, and data calling is carried out.
And under the condition that the corresponding configuration file is not called for the first time, judging whether the accessed data is in the multiplexing period of the data. And when the data is determined to be in the multiplexing period of the data, directly calling the corresponding configuration file to call the data. And when the data is determined not to be in the multiplexing period of the data, determining a new service port so as to call corresponding data from the database corresponding to the new service port.
In another embodiment, the user device information in the access request of the user is identified and authenticated, for example, the Executor component returns an authentication result, such as authentication failure or authentication pass, to the user.
Specifically, the authentication includes administrator authentication in a formal environment, authentication in a development environment, and the like.
Next, in step S104, response information data is returned to the user based on the access request.
In an embodiment, according to the request data of the access request, the Executor component performs format conversion on the response information from the corresponding service port and then returns the response information to the user.
Specifically, when a call exception does not occur, format conversion is performed on information data in a format such as a Json format, a CSS format, an XML format, or a picture format to restore the information data to original information data, and the original information data is returned to the user.
And returning calling exception information or information which cannot be called to the user when the calling exception occurs. And the user performs corresponding business logic processing aiming at the return information so as to avoid the problems of service breakdown and the like of the data server.
Therefore, by using the configuration file encapsulated with the calling abnormity judgment and performing data interaction with the service port of the database through the Executor component to call corresponding data or store corresponding data, the problem of service breakdown of the data service end can be effectively avoided, and the abnormal calling processing process can be effectively simplified.
In another embodiment, when the access request is a request for storing data, the executer component receives, for example, data to be stored of a developer and transmits the data to be stored to a Redis database, and simultaneously receives response information of the Redis database, and then sends the response information to the developer.
Therefore, response information data is returned to the user through the execution component based on the access request, a data calling process, a server connection process and an abnormal calling exception handling process can be further simplified, the data processing cost is reduced, and meanwhile, the data calling method is optimized.
The above-described procedure of the data call method is only for illustrating the present invention, and the order and number of the steps are not particularly limited. In addition, the steps in the method may also be split into two (for example, the step S101 is split into the step S101 and the step S301, see fig. 3 specifically), three, or some steps may also be combined into one step, and the adjustment is performed according to an actual example.
Compared with the prior art, the method and the device have the advantages that the configuration files related to the internet resource services are configured, the configuration files are packaged, the packaged configuration files are called to perform data processing such as data calling or data storage, the data calling process, the server connection process and the abnormal calling processing process can be simplified, and the development efficiency can be improved.
Furthermore, the obtained information of the data server, the connection service between the user equipment and the server, the calling mode, the exception handling, the calling request duration and the operation instruction are packaged to generate a corresponding configuration file, so that the calling exception handling and the development process can be further simplified; the data processing process can be further optimized by calling the configuration files of different packaging modes (namely, by judging whether the configuration files are instantly packaged and processed) to carry out the calling process, so that the calling abnormal condition can be effectively judged; the calling abnormal condition can be more effectively judged through the configuration file encapsulated with the abnormal judgment rule, and the abnormal handling process of the calling abnormality can be effectively simplified; response information data is returned to the user through the Executor component based on the access request, so that a data calling process, a server connection process and an abnormal exception handling process can be further simplified, the data processing cost is reduced, and the data calling method is optimized.
Those skilled in the art will appreciate that all or part of the steps to implement the above-described embodiments are implemented as programs (computer programs) executed by a computer data processing apparatus. When the computer program is executed, the method provided by the invention can be realized. Furthermore, the computer program may be stored in a computer readable storage medium, which may be a readable storage medium such as a magnetic disk, an optical disk, a ROM, a RAM, or a storage array composed of a plurality of storage media, such as a magnetic disk or a magnetic tape storage array. The storage medium is not limited to centralized storage, but may be distributed storage, such as cloud storage based on cloud computing.
Embodiments of the data call apparatus of the present invention are described below, which may be used to perform method embodiments of the present invention. The details described in the device embodiments of the invention should be regarded as complementary to the above-described method embodiments; reference is made to the above-described method embodiments for details not disclosed in the apparatus embodiments of the invention.
Example 2
Referring to fig. 4, 5 and 6, the present invention further provides a data invoking device 400 for data processing related to an internet resource service, wherein the data invoking device 400 comprises: a configuration processing module 401, configured to configure configuration files related to each internet resource service, and perform encapsulation processing on the configuration files; a receiving module 402, configured to receive an access request of a user; a sending module 403, configured to invoke the encapsulated corresponding configuration file, and send the access request to a data server; and the response processing module 404 returns response information data to the user based on the access request.
Optionally, the configuration processing module 401 is configured to configure file names, call time parameters, service ports, service addresses, service passwords, and exception judgment rules corresponding to different internet resource services, so as to generate a plurality of configuration files.
In another embodiment, as shown in fig. 5, the data invoking device 400 further includes an encapsulation processing module 501, that is, the configuration processing module 401 in fig. 4 is divided into the configuration processing module 401 and the encapsulation processing module 501, where the encapsulation processing module 501 is configured to encapsulate the configuration file and a corresponding invoking manner thereof, and the invoking manner includes a first invoking manner and a second invoking manner, where the first invoking manner includes a Socket manner, and the second invoking manner includes a PHP extension manner.
Optionally, the method further comprises: and packaging the acquired information of the data server, the connection service between the user and the server, a calling mode, exception handling, calling request duration and an operation instruction to generate a corresponding configuration file.
Optionally, the method further comprises: and acquiring the corresponding configuration file after the encapsulation processing through an Executor component, and calling the corresponding configuration file to send the access request to a corresponding data server.
In another embodiment, as shown in fig. 6, the data invoking device 400 further includes a determining module 601, where the determining module 601 is configured to determine whether an invoking exception occurs, and in the process of sending the access request to the corresponding data server, the determining module determines whether an invoking exception occurs according to an exception determining rule in the corresponding configuration file.
In yet another embodiment, a determination is made by the Executor component as to whether the configuration file to be invoked is a configuration file for the just-in-time encapsulation process.
Specifically, when the configuration file is determined to be an instant encapsulation processing configuration file, the information (for example, information including calling time, service port, and the like) of the data service end obtained from the access request of the user, the connection service between the user and the service end (that is, between the user equipment and the service end), the calling mode, exception handling, the calling request duration, and the operation instruction are subjected to instant encapsulation processing, the configuration file after the instant encapsulation processing is obtained, and the configuration file is called, so that the access request is sent to the corresponding data service end.
It should be noted that, in this example, the encapsulation processing modes of the configuration file are set according to the data reuse period and/or the priority of the preset resource service type, where the encapsulation processing modes include an instant encapsulation processing and a pre-encapsulation processing. However, the present invention is not limited to this, and in other examples, the encapsulation process may be set according to other data influence parameters.
And when the configuration file is not the configuration file subjected to the instant encapsulation processing, calling the configuration file subjected to the pre-encapsulation processing to send the access request to the corresponding data server. For example, the configuration file after the pre-encapsulation includes a second configuration file and/or a third configuration file, and the pre-encapsulation is specifically performed on the second configuration file and a corresponding calling manner thereof.
Therefore, the data processing process can be further optimized by calling the configuration files of different packaging modes (namely, by judging whether the configuration files are configuration files for instant packaging processing) to perform the calling process, and the calling abnormal condition can be effectively judged.
Further, in the process of sending the access request to the corresponding data server, whether call exception occurs is judged according to the exception judgment rule in the corresponding configuration file.
Specifically, the Executor component judges that the call is abnormal according to the abnormal judgment rule and re-acquires the replaced configuration file to re-execute the call process.
More specifically, the abnormality determination rule includes determining that the number of retries is greater than a set value, a call request time is greater than a specified time, and the like.
For example, when the number of retries is larger than a set value and/or the call request time is larger than a predetermined time, it is determined that a call abnormality has occurred.
And when the calling abnormity is judged to occur, the replaced configuration file is acquired again so as to execute the calling process again.
Therefore, the calling abnormity can be more effectively judged through the configuration file encapsulated with the abnormity judgment rule, and the abnormity processing process of calling abnormity can be effectively simplified.
In another embodiment, the method further comprises: and the Executor component converts the information data to be stored by the user into a specific format, then sends the information data to the data server and stores the information data to the corresponding storage module.
Optionally, the returning response information data to the user based on the access request includes: and according to the request data of the access request, the Executor component converts the format of the response information from the corresponding service port and then returns the response information to the user.
Specifically, according to the request data of the access request, the Executor component performs format conversion on the response information from the corresponding service port and then returns the response information to the user.
For example, when a call exception does not occur, format conversion is performed on information data in a format such as a Json format, a CSS format, an XML format, or a picture format to restore the information data to original information data, and the original information data is returned to the user.
For example, when a call exception occurs, call exception information or information that cannot be called is returned to the user. And the user performs corresponding business logic processing aiming at the return information so as to avoid the problems of service breakdown and the like of the data server.
In embodiment 2, the same portions as those in embodiment 1 are not described.
Those skilled in the art will appreciate that the modules in the above-described embodiments of the apparatus may be distributed as described in the apparatus, and may be correspondingly modified and distributed in one or more apparatuses other than the above-described embodiments. The modules of the above embodiments may be combined into one module, or further split into multiple sub-modules.
Compared with the prior art, the method and the device have the advantages that the configuration files related to the internet resource services are configured, the configuration files are packaged, the packaged configuration files are called to perform data processing such as data calling or data storage, the data calling process, the server connection process and the abnormal calling processing process can be simplified, and the development efficiency can be improved.
Furthermore, the obtained information of the data server, the connection service between the user equipment and the server, the calling mode, the exception handling, the calling request duration and the operation instruction are packaged to generate a corresponding configuration file, so that the calling exception handling and the development process can be further simplified; the data processing process can be further optimized by calling the configuration files of different packaging modes (namely, by judging whether the configuration files are instantly packaged and processed) to carry out the calling process, so that the calling abnormal condition can be effectively judged; the calling abnormal condition can be more effectively judged through the configuration file encapsulated with the abnormal judgment rule, and the abnormal handling process of the calling abnormality can be effectively simplified; response information data is returned to the user through the Executor component based on the access request, so that a data calling process, a server connection process and an abnormal exception handling process can be further simplified, the data processing cost is reduced, and the data calling method is optimized.
Example 3
In the following, embodiments of the computer apparatus of the present invention are described, which may be seen as specific physical embodiments for the above-described embodiments of the method and apparatus of the present invention. The details described in the computer device embodiment of the invention should be considered as additions to the method or apparatus embodiment described above; for details which are not disclosed in the embodiments of the computer device of the invention, reference may be made to the above-described embodiments of the method or apparatus.
Fig. 7 is a block diagram of an exemplary embodiment of a computer device according to the present invention. A computer apparatus 200 according to this embodiment of the present invention is described below with reference to fig. 7. The computer device 200 shown in fig. 7 is only an example and should not bring any limitation to the function and the scope of use of the embodiments of the present invention.
As shown in FIG. 7, computer device 200 is in the form of a general purpose computing device. The components of computer device 200 may include, but are not limited to: at least one processing unit 210, at least one storage unit 220, a bus 230 connecting different device components (including the storage unit 220 and the processing unit 210), a display unit 240, and the like.
Wherein the storage unit stores program code executable by the processing unit 210 to cause the processing unit 210 to perform steps according to various exemplary embodiments of the present invention described in the processing method section of the above-mentioned computer apparatus of the present specification. For example, the processing unit 210 may perform the steps as shown in fig. 1.
The memory unit 220 may include readable media in the form of volatile memory units, such as a random access memory unit (RAM)2201 and/or a cache memory unit 2202, and may further include a read only memory unit (ROM) 2203.
The storage unit 220 may also include a program/utility 2204 having a set (at least one) of program modules 2205, such program modules 2205 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 thereof, may comprise an implementation of a network environment.
Bus 230 may be 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.
The computer device 200 may also communicate with one or more external devices 300 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the computer device 200, and/or with any devices (e.g., router, modem, etc.) that enable the computer device 200 to communicate with one or more other computing devices. Such communication may occur via an input/output (I/O) interface 250. Also, computer device 200 may 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) through network adapter 260. Network adapter 260 may communicate with other modules of computer device 200 via bus 230. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the computer device 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments of the present invention described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiment of the present invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (which can be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to make a computing device (which can be a personal computer, a server, or a network device, etc.) execute the above-mentioned method according to the present invention. Which when executed by a data processing device, enables the computer program product to carry out the above-mentioned method of the invention.
Fig. 8 is a block diagram of an exemplary embodiment of a computer program product according to the present invention.
As shown in fig. 8, the computer program may be stored on one or more computer program products. The computer program product may be, for example but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer program product include: an electrical connection having 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The computer program product may comprise a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer program product may be transmitted, propagated, or transported for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer program product may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind 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).
In summary, the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that some or all of the functionality of some or all of the components in embodiments in accordance with the invention may be implemented in practice using a general purpose data processing device such as a microprocessor or a Digital Signal Processor (DSP). The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such a program implementing the invention may be stored on a computer program product or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
While the foregoing detailed description has described the objects, aspects and advantages of the present invention in further detail, it should be appreciated that the present invention is not inherently related to any particular computer, virtual machine, or computer apparatus, as various general purpose devices may implement the present invention. The invention is not to be considered as limited to the specific embodiments thereof, but is to be understood as being modified in all respects, all changes and equivalents that come within the spirit and scope of the invention.

Claims (11)

1. A data call method for data processing associated with an internet resource service, the data call method comprising:
configuring configuration files related to each internet resource service, and encapsulating the configuration files;
receiving an access request of a user;
calling the corresponding configuration file after the packaging processing, and sending the access request to a data server;
and returning response information data to the user based on the access request.
2. The data call method according to claim 1, wherein the configuring a configuration file associated with each internet resource service, and encapsulating the configuration file comprises:
and configuring file names, calling time parameters, service ports and service addresses corresponding to different Internet resource services, and service passwords and abnormal judgment rules to generate a plurality of configuration files.
3. The data call method according to claim 1, wherein the configuring a configuration file associated with each internet resource service, and encapsulating the configuration file comprises:
and encapsulating the configuration file and the corresponding calling modes thereof, wherein the calling modes comprise a first calling mode and a second calling mode, the first calling mode comprises a Socket mode, and the second calling mode comprises a PHP extension mode.
4. The data calling method according to claim 3, wherein encapsulating the configuration file and the calling method corresponding thereto comprises: and packaging the acquired information of the data server, the connection service between the user and the server, a calling mode, exception handling, calling request duration and an operation instruction to generate a corresponding configuration file.
5. The data calling method of claim 1, wherein the calling the encapsulated corresponding configuration file and sending the access request to a data server comprises:
and acquiring the corresponding configuration file after the encapsulation processing through an Executor component, and calling the corresponding configuration file to send the access request to a corresponding data server.
6. The data call method according to claim 5, further comprising:
in the process of sending the access request to the corresponding data server, judging whether calling abnormity occurs according to an abnormity judgment rule in the corresponding configuration file, wherein,
when the retry times are larger than a set value and/or the calling request time is larger than a specified time, judging that calling abnormity occurs;
and the Executor component judges the calling abnormality according to the abnormality judgment rule and acquires the replaced configuration file again so as to execute the calling process again.
7. The data call method according to claim 6, further comprising:
and the Executor component converts the information data to be stored by the user into a specific format, then sends the information data to the data server and stores the information data to the corresponding storage module.
8. The data call method according to claim 7, wherein the returning response information data to the user based on the access request comprises:
and according to the request data of the access request, the Executor component converts the format of the response information from the corresponding service port and then returns the response information to the user.
9. A data invocation means for data processing associated with an internet resource service, said data invocation means comprising:
the configuration processing module is used for configuring configuration files related to each Internet resource service and packaging the configuration files;
the receiving module is used for receiving an access request of a user;
the sending module is used for calling the corresponding configuration file after the packaging processing and sending the access request to a data server;
and the response processing module returns response information data to the user based on the access request.
10. The data calling device according to claim 9, wherein the configuration processing module is configured to configure file names, calling time parameters, service ports, service addresses, service passwords, and exception rules corresponding to different internet resource services to generate a plurality of configuration files; and/or
The data calling device further comprises a packaging processing module, wherein the packaging processing module is used for packaging the configuration file and the corresponding calling modes, the calling modes comprise a first calling mode and a second calling mode, the first calling mode comprises a Socket mode, and the second calling mode comprises a PHP extension mode.
11. A computer device comprising a processor and a memory, the memory for storing a computer executable program, characterized in that:
when the computer program is executed by the processor, the processor performs the data call method of claim 1.
CN202110962775.7A 2021-08-20 2021-08-20 Data calling method and device and computer equipment Withdrawn CN113687963A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110962775.7A CN113687963A (en) 2021-08-20 2021-08-20 Data calling method and device and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110962775.7A CN113687963A (en) 2021-08-20 2021-08-20 Data calling method and device and computer equipment

Publications (1)

Publication Number Publication Date
CN113687963A true CN113687963A (en) 2021-11-23

Family

ID=78581371

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110962775.7A Withdrawn CN113687963A (en) 2021-08-20 2021-08-20 Data calling method and device and computer equipment

Country Status (1)

Country Link
CN (1) CN113687963A (en)

Similar Documents

Publication Publication Date Title
US10636084B2 (en) Methods and systems for implementing on-line financial institution services via a single platform
US10482262B2 (en) Static analysis based on abstract program representations
US8661420B2 (en) System and method for runtime interface versioning
US8346897B2 (en) System and method for deploying and maintaining software applications
KR102391806B1 (en) Integrated apis and uis for consuming services across different distributed networks
US9354998B2 (en) Automated conformance and interoperability test lab
CN110032392B (en) Service management method and device, storage medium and electronic equipment
CN111290865A (en) Service calling method and device, electronic equipment and storage medium
US20100242031A1 (en) Systems and Methods for Dynamically Linking Application Software into a Running Operating System Kernel
US10996997B2 (en) API-based service command invocation
CN110289983B (en) Load balancing application creation method and device, computer equipment and storage medium
US10530773B2 (en) Updating database drivers for client applications through a database server push
US11822947B2 (en) Automated management of machine images
US8250226B2 (en) Generating one or more clients for generating one or more synthetic transactions with one or more web service operations
US11531526B1 (en) Creating portable serverless applications
US11288170B1 (en) Log analysis debugging without running on real production environment
US11494184B1 (en) Creation of transportability container files for serverless applications
CN112153012B (en) Multi-terminal contact access method, device and storage medium
US20210216343A1 (en) Safely processing integrated flows of messages in a multi-tenant container
US11803786B2 (en) Enterprise integration platform
US20150378689A1 (en) Application instance staging
CN113687963A (en) Data calling method and device and computer equipment
CN115794372A (en) Method and system for communication between cross-language application systems
CN112287327B (en) Method, device, medium and equipment for easily reconstructing single sign-on system
Srinivasmurthy et al. Web2exchange: A model-based service transformation and integration environment

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
WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20211123