CN113901377B - Service calling method, device, storage medium and equipment of legacy system - Google Patents

Service calling method, device, storage medium and equipment of legacy system Download PDF

Info

Publication number
CN113901377B
CN113901377B CN202111502261.XA CN202111502261A CN113901377B CN 113901377 B CN113901377 B CN 113901377B CN 202111502261 A CN202111502261 A CN 202111502261A CN 113901377 B CN113901377 B CN 113901377B
Authority
CN
China
Prior art keywords
data packet
legacy system
mirror image
response
calling
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111502261.XA
Other languages
Chinese (zh)
Other versions
CN113901377A (en
Inventor
左磊
许绪满
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tianju Dihe Suzhou Technology Co ltd
Original Assignee
Tianju Dihe Suzhou Data Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tianju Dihe Suzhou Data Co ltd filed Critical Tianju Dihe Suzhou Data Co ltd
Priority to CN202111502261.XA priority Critical patent/CN113901377B/en
Publication of CN113901377A publication Critical patent/CN113901377A/en
Application granted granted Critical
Publication of CN113901377B publication Critical patent/CN113901377B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/972Access to data in other repository systems, e.g. legacy data or dynamic Web page generation
    • 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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application discloses a service calling method, a service calling device, a storage medium and equipment of a legacy system, and belongs to the technical field of networks. The method comprises the following steps: receiving a calling request sent by a calling end, wherein the calling request is used for requesting to call a predetermined service in a legacy system and carries a calling parameter; acquiring a first mirror image template corresponding to the calling request, wherein the first mirror image template is obtained by template extraction of a first original data packet, and the first original data packet is a data packet sent to the legacy system when a preset service is called through a webpage provided by the legacy system; filling the calling parameters into the first mirror image template to obtain a mirror image data packet; sending the mirror image data packet to a legacy system, wherein the legacy system is used for generating and sending a response data packet according to the mirror image data packet; acquiring a response data packet sent by a legacy system; and sending the response parameters in the response data packet to the calling terminal. The method and the device can call the predetermined service in the legacy system on the premise of not developing a call interface.

Description

Service calling method, device, storage medium and equipment of legacy system
Technical Field
The embodiment of the application relates to the technical field of networks, in particular to a service calling method, a service calling device, a storage medium and equipment of a legacy system.
Background
Legacy systems refer to computer systems or applications that are out of date technically, but are still used in the enterprise. In order to enable the legacy system to provide services to the outside, an external-facing call interface may be developed for the legacy system.
However, when the calling interface is developed for the legacy system, the legacy system needs to be modified greatly, which may affect the existing service, and thus the legacy system may not work normally.
Disclosure of Invention
The embodiment of the application provides a service calling method, a service calling device, a storage medium and equipment of a legacy system, which are used for solving the problem that the legacy system cannot work normally due to the fact that the existing service is possibly influenced when a calling interface is developed for the legacy system. The technical scheme is as follows:
in one aspect, a service invocation method of a legacy system is provided, which is used in a proxy device, and includes:
receiving a calling request sent by a calling end, wherein the calling request is used for requesting to call a predetermined service in a legacy system and carries a calling parameter;
acquiring a first mirror image template corresponding to the calling request, wherein the first mirror image template is obtained by template extraction of a first original data packet, and the first original data packet is a data packet sent to the legacy system when the predetermined service is called through a webpage provided by the legacy system;
filling the calling parameter into the first mirror image template to obtain a mirror image data packet;
sending the mirror image data packet to the legacy system, wherein the legacy system is used for generating and sending a response data packet according to the mirror image data packet;
acquiring the response data packet sent by the legacy system;
and sending the response parameters in the response data packet to the calling terminal.
In a possible implementation manner, the obtaining the response packet sent by the legacy system includes:
and intercepting the response data packet when the legacy system sends the response data packet to the source address in the mirror image data packet.
In a possible implementation manner, the sending the response parameter in the response packet to the calling end includes:
acquiring a second mirror image template corresponding to the response data packet, wherein the second mirror image template is obtained by template extraction of a second original data packet, and the second original data packet is a data packet fed back by the legacy system when the predetermined service is called through a webpage provided by the legacy system;
extracting the response parameters from the response data packet according to the second mirror image template;
and sending the response parameters to the calling terminal.
In a possible implementation manner, the extracting the response parameter from the response packet according to the second mirror template includes:
comparing the response data packet with the second mirror image template;
determining the position of the response parameter in the response data packet according to the comparison result;
extracting the response parameter from the location in the response packet.
In a possible implementation manner, if n times of interaction with the legacy system is required when the predetermined service is called, the calling request corresponds to n first mirror image templates arranged in sequence, wherein n is more than or equal to 2; after the sending the mirrored data packet to the legacy system, the method further comprises:
acquiring an ith request data packet sent by the legacy system, wherein i is more than or equal to 1 and less than n;
obtaining the ith intermediate parameter requested by the ith request data packet from the calling end, and filling the ith intermediate parameter into the (i + 1) th first mirror image template to obtain an (i + 1) th response data packet;
sending the (i + 1) th response data packet to the legacy system;
if i +1= n, triggering and executing the step of acquiring the response data packet sent by the legacy system;
if i +1 is less than n, updating i to i +1, and continuing to execute the step of obtaining the ith request data packet sent by the legacy system.
In one possible implementation, the method further includes:
simulating and inputting the calling parameter on a webpage provided by the legacy system;
intercepting the first original data packet sent to the legacy system, wherein the first original data packet carries the calling parameter;
and extracting a template of the first original data packet to obtain the first mirror image template.
In one possible implementation, the method further includes:
simulating and inputting the calling parameter on a webpage provided by the legacy system;
intercepting a second original data packet fed back by the legacy system, wherein the second original data packet carries the response parameter;
and extracting the template of the second original data packet to obtain the second mirror image template.
In one possible implementation, the calling end is an applet or application.
In one aspect, a service invocation apparatus of a legacy system is provided, which is used in a proxy device, and the apparatus includes:
the receiving module is used for receiving a calling request sent by a calling end, wherein the calling request is used for requesting to call a predetermined service in a legacy system and carries a calling parameter;
an obtaining module, configured to obtain a first mirror image template corresponding to the call request, where the first mirror image template is obtained by template extraction of a first original data packet, and the first original data packet is a data packet sent to the legacy system when the predetermined service is called through a webpage provided by the legacy system;
the filling module is used for filling the calling parameters into the first mirror image template to obtain a mirror image data packet;
the sending module is used for sending the mirror image data packet to the legacy system, and the legacy system is used for generating and sending a response data packet according to the mirror image data packet;
the obtaining module is further configured to obtain the response data packet sent by the legacy system;
the sending module is further configured to send the response parameters in the response data packet to the calling end.
In one aspect, a computer-readable storage medium is provided, in which at least one instruction is stored, the at least one instruction being loaded and executed by a processor to implement the service invocation method of the legacy system as described above.
In one aspect, a proxy device is provided that includes a processor and a memory having stored therein at least one instruction that is loaded and executed by the processor to implement a service invocation method for legacy systems as described above.
The technical scheme provided by the embodiment of the application has the beneficial effects that at least:
the method comprises the steps of obtaining a first mirror image template corresponding to a calling request sent by a calling end, filling calling parameters into the first mirror image template to obtain a mirror image data packet, and sending the mirror image data packet to a legacy system. Because the first mirror image template is extracted by the template from the first original data packet, and the first original data packet is a data packet sent to the legacy system when the predetermined service is called by the webpage provided by the legacy system, the legacy system can generate and send a response data packet according to the mirror image data packet, and the proxy equipment sends the response parameter in the response data packet to the calling end, so that the calling of the predetermined service in the legacy system by the external calling end can be realized on the premise of not developing the calling interface, the influence of developing the calling interface on the legacy system is avoided, and the normal work of the legacy system is ensured.
If n times of interaction with the legacy system is needed when the scheduled service is called, the calling request corresponds to n first mirror image templates which are arranged in sequence, therefore, the proxy equipment can sequentially generate n data packets according to the arrangement sequence of the first mirror image templates to carry out n times of interaction with the legacy system, and finally obtains the response parameters, so that the calling end can realize the n times of interaction with the legacy system only by sending the calling request once, and the operation complexity of service calling is simplified.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flowchart of a method for invoking a service in a legacy system according to an embodiment of the present application;
FIG. 2 is a flowchart of a method for invoking a service in a legacy system according to another embodiment of the present application;
FIG. 3 is a flowchart of a method for invoking a service in a legacy system according to another embodiment of the present application;
fig. 4 is a block diagram illustrating a service invocation apparatus of a legacy system according to still another embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present application more clear, the embodiments of the present application will be further described in detail with reference to the accompanying drawings.
In the prior art, a user may log in a web page provided by a legacy system by using a browser, input a call parameter in the web page, send a first original data packet carrying the call parameter to the legacy system by using the browser, return a second original data packet carrying a response parameter to the browser after the legacy system obtains the call parameter, and display the response parameter in the second original data packet by using the browser, so that the user may query information desired by the user in the web page. In this implementation, the user needs to log in the web page to call the service in the legacy system, which brings inconvenience to the user using the legacy system.
In this embodiment, the proxy device may intercept the first original data packet and the second original data packet, and extract corresponding mirror image templates from the first original data packet and the second original data packet, so that the proxy device may use the mirror image templates to construct and identify a data packet interacting with the legacy system, thereby invoking a predetermined service in the legacy system instead of a browser.
The proxy device may extract a first mirrored template from the first original packet, using the first mirrored template to construct a packet for transmission to the legacy system. Specifically, the proxy device may simulate an input call parameter on a web page provided by the legacy system; intercepting a first original data packet sent to a legacy system, wherein the first original data packet carries a calling parameter; and extracting the template of the first original data packet to obtain a first mirror image template.
The first original data packet may include, in addition to the call parameter, a source address, a destination address, verification information, and the like, and when the template extraction is performed, the proxy device may set the content of the field in which the call parameter is located to be null, or set the content of the field in which the call parameter is located to be a replaceable predetermined character, so as to obtain the first mirror image template.
The proxy device may extract a second mirror template from the second original packet, and identify the packet sent by the legacy system using the second mirror template. Specifically, the proxy device may simulate an input call parameter on a web page provided by the legacy system; intercepting a second original data packet fed back by the legacy system, wherein the second original data packet carries a response parameter; and extracting the template of the second original data packet to obtain a second mirror image template.
The first original data packet may include, in addition to the response parameter, a source address, a destination address, verification information, and the like, and when the template extraction is performed, the proxy device may set the content of the field in which the response parameter is located to be null, or set the content of the field in which the response parameter is located to be a replaceable predetermined character, so as to obtain the second mirror image template.
For example, when a user needs to log in to a legacy system, the invoking parameter in the first original data packet may be a user name and a password, and the responding parameter in the second original data packet may be login credentials.
Since the legacy system may provide multiple services, the proxy device may extract a corresponding mirror template for each service, store the mirror template, and subsequently, when a calling end needs to call a certain service in the legacy system, the proxy device may find the corresponding mirror template and call the service according to the mirror template.
It should be noted that, when a certain service is called, n times of interaction with the legacy system may be required, in this case, the proxy device may extract the original data packet of each interaction in sequence, and extract n mirror image templates in sequence. For example, if the legacy system is a public accumulation fund system and the user needs to query the balance of the public accumulation fund, the mirror template related to login can be extracted during the first interaction, and the mirror template related to query can be extracted during the second interaction.
Referring to fig. 1, a flowchart of a method for calling a service of a legacy system, which may be applied in a proxy device, according to an embodiment of the present application is shown. The service calling method of the legacy system may include:
step 101, receiving a call request sent by a call end, where the call request is used to request to call a predetermined service in a legacy system, and the call request carries a call parameter.
Wherein the calling parameter is a parameter used when a predetermined service in the legacy system is called. For example, when the predetermined service is a login, the invocation parameters may be a user name and password.
Step 102, obtaining a first mirror image template corresponding to the call request, wherein the first mirror image template is obtained by template extraction of a first original data packet, and the first original data packet is a data packet sent to the legacy system when a predetermined service is called through a webpage provided by the legacy system.
The extraction process of the first mirror image template may refer to the description above, and is not described herein again.
The proxy device may preset a corresponding relationship between the call request and the first mirror image template, so that when the proxy device receives a certain call request, the corresponding first mirror image template may be found from the corresponding relationship. Wherein different invocation requests correspond to different first mirrored templates.
And 103, filling the calling parameters into the first mirror image template to obtain a mirror image data packet.
Since the content of the predetermined field in the first mirror image template is empty or a replaceable predetermined character, the proxy device may fill the predetermined field with the call parameter, and the mirror image data packet may be obtained.
And 104, sending the mirror image data packet to a legacy system, wherein the legacy system is used for generating and sending a response data packet according to the mirror image data packet.
Since the contents of the mirror image data packet except the calling parameter are the same as those of the original data packet sent by the browser, the legacy system can identify the mirror image data packet and generate and send a response data packet.
And 105, acquiring a response data packet sent by the legacy system.
And step 106, sending the response parameters in the response data packet to the calling terminal.
The proxy device may extract the response parameter from the response packet and send the response parameter to the caller.
To sum up, the service invocation method for the legacy system according to the embodiment of the present application obtains the first mirror image template corresponding to the invocation request sent by the invocation end, fills the invocation parameter into the first mirror image template to obtain the mirror image data packet, and sends the mirror image data packet to the legacy system. Because the first mirror image template is extracted by the template from the first original data packet, and the first original data packet is a data packet sent to the legacy system when the predetermined service is called by the webpage provided by the legacy system, the legacy system can generate and send a response data packet according to the mirror image data packet, and the proxy equipment sends the response parameter in the response data packet to the calling end, so that the calling of the predetermined service in the legacy system by the external calling end can be realized on the premise of not developing the calling interface, the influence of developing the calling interface on the legacy system is avoided, and the normal work of the legacy system is ensured.
Referring to fig. 2, a flowchart of a service invocation method of a legacy system, which can be applied to a proxy device and which interacts with the legacy system once when a predetermined service is invoked, according to an embodiment of the present application is shown. The service calling method of the legacy system may include:
step 201, receiving a call request sent by a call end, where the call request is used to request to call a predetermined service in a legacy system, and the call request carries a call parameter.
Wherein the calling parameter is a parameter used when a predetermined service in the legacy system is called. For example, when the predetermined service is a login, the invocation parameters may be a user name and password.
The calling end in this embodiment may be an applet or an application.
Step 202, obtaining a first mirror image template corresponding to the call request, where the first mirror image template is obtained by template extraction of a first original data packet, and the first original data packet is a data packet sent to the legacy system when a predetermined service is called through a web page provided by the legacy system.
The extraction process of the first mirror image template may refer to the description above, and is not described herein again.
The proxy device may preset a corresponding relationship between the call request and the first mirror image template, so that when the proxy device receives a certain call request, the corresponding first mirror image template may be found from the corresponding relationship. Wherein different invocation requests correspond to different first mirrored templates.
And step 203, filling the calling parameters into the first mirror image template to obtain a mirror image data packet.
Since the content of the predetermined field in the first mirror image template is empty or a replaceable predetermined character, the proxy device may fill the predetermined field with the call parameter, and the mirror image data packet may be obtained.
Step 204, the mirror image data packet is sent to a legacy system, and the legacy system is configured to generate and send a response data packet according to the mirror image data packet.
Since the contents of the mirror image data packet except the calling parameter are the same as those of the original data packet sent by the browser, the legacy system can identify the mirror image data packet and generate and send a response data packet.
Step 205, when the legacy system sends a response packet to the source address in the mirror image packet, the response packet is intercepted.
Since the source address in the mirror packet is not the address of the proxy device, the proxy device needs to intercept when the legacy system sends a response packet to the source address. That is, the proxy device may employ redirection techniques to redirect response packets to the proxy device.
Step 206, obtaining a second mirror image template corresponding to the response data packet, where the second mirror image template is obtained by template extraction of a second original data packet, and the second original data packet is a data packet fed back by the legacy system when the predetermined service is called through a webpage provided by the legacy system.
The extraction process of the second mirror image template may refer to the description above, and is not described herein again.
The proxy device may preset a correspondence between the response data packet and the second mirror image template, so that when the proxy device receives a certain response data packet, the corresponding second mirror image template may be found from the correspondence. Wherein the different response packets correspond to different second mirrored templates.
Step 207, the response parameters are extracted from the response packet according to the second mirrored template.
Specifically, extracting the response parameter from the response packet according to the second mirror template may include: comparing the response data packet with the second mirror image template; determining the position of the response parameter in the response data packet according to the comparison result; response parameters are extracted from locations in the response packet.
Since the content of the predetermined field in the second mirror image template is empty or a replaceable predetermined character, the proxy device may compare the response data packet with the second mirror image template to determine the position of the predetermined field, and then extract the response parameter from the position in the response data packet.
And step 208, sending the response parameter to the calling terminal.
The proxy device may send the response parameters extracted from the response packet to the caller.
To sum up, the service invocation method for the legacy system according to the embodiment of the present application obtains the first mirror image template corresponding to the invocation request sent by the invocation end, fills the invocation parameter into the first mirror image template to obtain the mirror image data packet, and sends the mirror image data packet to the legacy system. Because the first mirror image template is extracted by the template from the first original data packet, and the first original data packet is a data packet sent to the legacy system when the predetermined service is called by the webpage provided by the legacy system, the legacy system can generate and send a response data packet according to the mirror image data packet, and the proxy equipment sends the response parameter in the response data packet to the calling end, so that the calling of the predetermined service in the legacy system by the external calling end can be realized on the premise of not developing the calling interface, the influence of developing the calling interface on the legacy system is avoided, and the normal work of the legacy system is ensured.
Referring to FIG. 3, it shows a flowchart of a method for calling a service of a legacy system according to an embodiment of the present application, where the method for calling a service of a legacy system can be applied to a proxy device, and the proxy device interacts with the legacy system n times when calling a predetermined service, where n ≧ 2. The service calling method of the legacy system may include:
step 301, receiving a call request sent by a call end, where the call request is used to request to call a predetermined service in a legacy system, and the call request carries a call parameter.
Wherein the calling parameter is a parameter used when a predetermined service in the legacy system is called. For example, when the predetermined service is a login, the invocation parameters may be a user name and password.
The calling end in this embodiment may be an applet or an application.
Step 302, obtaining a first mirror image template corresponding to the call request, where the first mirror image template is obtained by template extraction of a first original data packet, and the first original data packet is a data packet sent to the legacy system when a predetermined service is called through a web page provided by the legacy system.
The extraction process of the first mirror image template may refer to the description above, and is not described herein again.
In this embodiment, when the predetermined service is called, n times of interaction with the legacy system is required, the call request corresponds to n first mirror templates arranged in sequence, and then, the proxy device may preset a correspondence between the call request and the n first mirror templates, so that when the proxy device receives a certain call request, the corresponding n first mirror templates may be found from the correspondence.
Step 303, filling the calling parameter into the first mirror image template to obtain a mirror image data packet.
Since the content of the predetermined field in the first mirror image template is empty or a replaceable predetermined character, the proxy device may fill the calling parameter into the predetermined field in the first mirror image template, and the mirror image data packet may be obtained.
Step 304, the mirrored data packet is sent to the legacy system.
Since the contents of the mirror image data packet except the calling parameter are the same as those of the original data packet sent by the browser, the legacy system can recognize the mirror image data packet and respond.
Step 305, acquiring an ith request data packet sent by the legacy system; acquiring an ith intermediate parameter requested by an ith request data packet from a calling end, and filling the ith intermediate parameter into an (i + 1) th first mirror image template to obtain an (i + 1) th response data packet; and transmitting the (i + 1) th response data packet to the legacy system.
Wherein i is more than or equal to 1 and less than n.
When the predetermined service is called, the legacy system may need to acquire the intermediate parameter from the calling terminal for multiple times, and each time the intermediate parameter is acquired, the proxy device may receive a request data packet sent by the legacy system and compare the request data packet with the corresponding third mirror image template; determining the position of the request parameter in the request data packet according to the comparison result; and extracting the request parameters from the position in the request data packet, acquiring intermediate parameters from the calling end according to the request parameters, filling the acquired intermediate parameters into the corresponding first mirror image template to obtain a response data packet, and sending the response data packet to the legacy system.
The proxy device may preset a correspondence between the request data packet and the third mirror image template, so that when the proxy device receives a certain request data packet, the corresponding third mirror image template may be found from the correspondence. Wherein different request packets correspond to different third mirrored templates.
And step 306, if i +1 is less than n, updating i to i +1, and continuing to execute the step of obtaining the ith request data packet sent by the legacy system.
Step 307, if i +1= n, intercepting the response packet when the legacy system sends the response packet to the source address in the mirror image packet.
Since the source address in the mirror packet is not the address of the proxy device, the proxy device needs to intercept when the legacy system sends a response packet to the source address. That is, the proxy device may employ redirection techniques to redirect response packets to the proxy device.
Step 308, obtaining a second mirror image template corresponding to the response data packet, where the second mirror image template is obtained by template extraction of a second original data packet, and the second original data packet is a data packet fed back by the legacy system when a predetermined service is called through a webpage provided by the legacy system.
The extraction process of the second mirror image template may refer to the description above, and is not described herein again.
The proxy device may preset a correspondence between the response data packet and the second mirror image template, so that when the proxy device receives a certain response data packet, the corresponding second mirror image template may be found from the correspondence. Wherein the different response packets correspond to different second mirrored templates.
Step 309, response parameters are extracted from the response packet according to the second mirrored template.
Specifically, extracting the response parameter from the response packet according to the second mirror template may include: comparing the response data packet with the second mirror image template; determining the position of the response parameter in the response data packet according to the comparison result; response parameters are extracted from locations in the response packet.
Since the content of the predetermined field in the second mirror image template is empty or a replaceable predetermined character, the proxy device may compare the response data packet with the second mirror image template to determine the position of the predetermined field, and then extract the response parameter from the position in the response data packet.
Step 310, sending the response parameter to the calling terminal.
The proxy device may send the response parameters extracted from the response packet to the caller.
To sum up, the service invocation method for the legacy system according to the embodiment of the present application obtains the first mirror image template corresponding to the invocation request sent by the invocation end, fills the invocation parameter into the first mirror image template to obtain the mirror image data packet, and sends the mirror image data packet to the legacy system. Because the first mirror image template is extracted by the template from the first original data packet, and the first original data packet is a data packet sent to the legacy system when the predetermined service is called by the webpage provided by the legacy system, the legacy system can generate and send a response data packet according to the mirror image data packet, and the proxy equipment sends the response parameter in the response data packet to the calling end, so that the calling of the predetermined service in the legacy system by the external calling end can be realized on the premise of not developing the calling interface, the influence of developing the calling interface on the legacy system is avoided, and the normal work of the legacy system is ensured.
If n times of interaction with the legacy system is needed when the scheduled service is called, the calling request corresponds to n first mirror image templates which are arranged in sequence, therefore, the proxy equipment can sequentially generate n data packets according to the arrangement sequence of the first mirror image templates to carry out n times of interaction with the legacy system, and finally obtains the response parameters, so that the calling end can realize the n times of interaction with the legacy system only by sending the calling request once, and the operation complexity of service calling is simplified.
Referring to fig. 4, a block diagram of a service invocation apparatus of a legacy system provided in an embodiment of the present application is shown, where the service invocation apparatus of the legacy system can be applied to a proxy device. The service invoking device of the legacy system may include:
a receiving module 410, configured to receive a call request sent by a call end, where the call request is used to request to call a predetermined service in a legacy system, and the call request carries a call parameter;
an obtaining module 420, configured to obtain a first mirror image template corresponding to the call request, where the first mirror image template is obtained by performing template extraction on a first original data packet, and the first original data packet is a data packet sent to the legacy system when a predetermined service is called through a web page provided by the legacy system;
the filling module 430 is configured to fill the calling parameter into the first mirror image template to obtain a mirror image data packet;
a sending module 440, configured to send the mirror image data packet to a legacy system, where the legacy system is configured to generate and send a response data packet according to the mirror image data packet;
the obtaining module 420 is further configured to obtain a response data packet sent by the legacy system;
the sending module 440 is further configured to send the response parameter in the response packet to the calling end.
In an optional embodiment, the obtaining module 420 is further configured to intercept the response packet when the legacy system sends the response packet to the source address in the mirror packet.
In an optional embodiment, the sending module 440 is further configured to:
acquiring a second mirror image template corresponding to the response data packet, wherein the second mirror image template is obtained by template extraction of a second original data packet, and the second original data packet is a data packet fed back by the legacy system when a predetermined service is called through a webpage provided by the legacy system;
extracting response parameters from the response data packet according to the second mirror image template;
and sending the response parameters to the calling end.
In an optional embodiment, the sending module 440 is further configured to:
comparing the response data packet with the second mirror image template;
determining the position of the response parameter in the response data packet according to the comparison result;
response parameters are extracted from locations in the response packet.
In an optional embodiment, if n times of interaction with a legacy system is required when a predetermined service is called, the calling request corresponds to n first mirror image templates arranged in sequence, wherein n is greater than or equal to 2;
the obtaining module 420 is further configured to obtain an ith request data packet sent by the legacy system after the mirror image data packet is sent to the legacy system, where i is greater than or equal to 1 and is less than n; acquiring an ith intermediate parameter requested by an ith request data packet from a calling end, and filling the ith intermediate parameter into an (i + 1) th first mirror image template to obtain an (i + 1) th response data packet;
the sending module 440 is further configured to send the (i + 1) th response packet to the legacy system;
the obtaining module 420 is further configured to trigger execution of the step of obtaining the response packet sent by the legacy system if i +1= n; if i +1 is less than n, updating i to i +1, and continuing to execute the step of obtaining the ith request data packet sent by the legacy system.
In an optional embodiment, the apparatus further comprises:
the input module is used for simulating and inputting calling parameters on a webpage provided by a legacy system;
the intercepting module is used for intercepting a first original data packet sent to a legacy system, wherein the first original data packet carries a calling parameter;
and the extraction module is used for extracting the template of the first original data packet to obtain a first mirror image template.
In an optional embodiment, the input module is further configured to simulate an input call parameter on a webpage provided by the legacy system;
the interception module is further used for intercepting a second original data packet fed back by the legacy system, wherein the second original data packet carries a response parameter;
and the extraction module is also used for extracting the template of the second original data packet to obtain a second mirror image template.
In an alternative embodiment, the calling end is an applet or application.
To sum up, the service invocation device of the legacy system according to the embodiment of the present application obtains the first mirror image template corresponding to the invocation request sent by the invocation end, fills the invocation parameter into the first mirror image template, obtains the mirror image data packet, and sends the mirror image data packet to the legacy system. Because the first mirror image template is extracted by the template from the first original data packet, and the first original data packet is a data packet sent to the legacy system when the predetermined service is called by the webpage provided by the legacy system, the legacy system can generate and send a response data packet according to the mirror image data packet, and the proxy equipment sends the response parameter in the response data packet to the calling end, so that the calling of the predetermined service in the legacy system by the external calling end can be realized on the premise of not developing the calling interface, the influence of developing the calling interface on the legacy system is avoided, and the normal work of the legacy system is ensured.
If n times of interaction with the legacy system is needed when the scheduled service is called, the calling request corresponds to n first mirror image templates which are arranged in sequence, therefore, the proxy equipment can sequentially generate n data packets according to the arrangement sequence of the first mirror image templates to carry out n times of interaction with the legacy system, and finally obtains the response parameters, so that the calling end can realize the n times of interaction with the legacy system only by sending the calling request once, and the operation complexity of service calling is simplified.
One embodiment of the present application provides a computer-readable storage medium having at least one instruction stored therein, the at least one instruction being loaded and executed by a processor to implement the service invocation method of the legacy system as described above.
One embodiment of the present application provides a proxy device comprising a processor and a memory, wherein the memory stores at least one instruction, and the instruction is loaded and executed by the processor to implement the service calling method of the legacy system as described above.
It should be noted that: in the service invocation device of the legacy system provided in the foregoing embodiment, when the service invocation of the legacy system is performed, only the division of the functional modules is illustrated, and in practical applications, the function allocation may be completed by different functional modules according to needs, that is, the internal structure of the service invocation device of the legacy system is divided into different functional modules, so as to complete all or part of the functions described above. In addition, the service invocation device of the legacy system and the service invocation method embodiment of the legacy system provided by the above embodiments belong to the same concept, and the specific implementation process thereof is detailed in the method embodiment and will not be described herein again.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a magnetic disk or an optical disk, etc.
The above description should not be taken as limiting the embodiments of the present application, and any modifications, equivalents, improvements, etc. made within the spirit and principle of the embodiments of the present application should be included in the scope of the embodiments of the present application.

Claims (11)

1. A service invocation method of a legacy system, used in a proxy device, the method comprising:
receiving a calling request sent by a calling end, wherein the calling request is used for requesting to call a predetermined service in a legacy system and carries a calling parameter;
acquiring a first mirror image template corresponding to the calling request, wherein the first mirror image template is obtained by template extraction of a first original data packet, and the first original data packet is a data packet sent to the legacy system when the predetermined service is called through a webpage provided by the legacy system;
filling the calling parameter into the first mirror image template to obtain a mirror image data packet;
sending the mirror image data packet to the legacy system, wherein the legacy system is used for generating and sending a response data packet according to the mirror image data packet;
acquiring the response data packet sent by the legacy system;
and sending the response parameters in the response data packet to the calling terminal.
2. The method of claim 1, wherein the obtaining the response packet sent by the legacy system comprises:
and intercepting the response data packet when the legacy system sends the response data packet to the source address in the mirror image data packet.
3. The method according to claim 1, wherein the sending the response parameter in the response packet to the calling end comprises:
acquiring a second mirror image template corresponding to the response data packet, wherein the second mirror image template is obtained by template extraction of a second original data packet, and the second original data packet is a data packet fed back by the legacy system when the predetermined service is called through a webpage provided by the legacy system;
extracting the response parameters from the response data packet according to the second mirror image template;
and sending the response parameters to the calling terminal.
4. The method of claim 3, wherein extracting the response parameters from the response packet according to the second mirrored template comprises:
comparing the response data packet with the second mirror image template;
determining the position of the response parameter in the response data packet according to the comparison result;
extracting the response parameter from the location in the response packet.
5. The method according to claim 1, wherein if n interactions with the legacy system are required when the predetermined service is invoked, the invocation request corresponds to n first mirror templates arranged in sequence, where n is greater than or equal to 2; after the sending the mirrored data packet to the legacy system, the method further comprises:
acquiring an ith request data packet sent by the legacy system, wherein i is more than or equal to 1 and less than n;
obtaining the ith intermediate parameter requested by the ith request data packet from the calling end, and filling the ith intermediate parameter into the (i + 1) th first mirror image template to obtain an (i + 1) th response data packet;
sending the (i + 1) th response data packet to the legacy system;
if i +1= n, triggering and executing the step of acquiring the response data packet sent by the legacy system;
if i +1 is less than n, updating i to i +1, and continuing to execute the step of obtaining the ith request data packet sent by the legacy system.
6. The method of claim 1, further comprising:
simulating and inputting the calling parameter on a webpage provided by the legacy system;
intercepting the first original data packet sent to the legacy system, wherein the first original data packet carries the calling parameter;
and extracting a template of the first original data packet to obtain the first mirror image template.
7. The method of claim 3, further comprising:
simulating and inputting the calling parameter on a webpage provided by the legacy system;
intercepting a second original data packet fed back by the legacy system, wherein the second original data packet carries the response parameter;
and extracting the template of the second original data packet to obtain the second mirror image template.
8. The method according to any one of claims 1 to 7, wherein the calling end is an applet or an application.
9. A service invocation apparatus of a legacy system, used in a proxy device, the apparatus comprising:
the receiving module is used for receiving a calling request sent by a calling end, wherein the calling request is used for requesting to call a predetermined service in a legacy system and carries a calling parameter;
an obtaining module, configured to obtain a first mirror image template corresponding to the call request, where the first mirror image template is obtained by template extraction of a first original data packet, and the first original data packet is a data packet sent to the legacy system when the predetermined service is called through a webpage provided by the legacy system;
the filling module is used for filling the calling parameters into the first mirror image template to obtain a mirror image data packet;
the sending module is used for sending the mirror image data packet to the legacy system, and the legacy system is used for generating and sending a response data packet according to the mirror image data packet;
the obtaining module is further configured to obtain the response data packet sent by the legacy system;
the sending module is further configured to send the response parameters in the response data packet to the calling end.
10. A computer-readable storage medium having stored therein at least one instruction which is loaded and executed by a processor to implement a service invocation method for a legacy system according to any of claims 1 to 8.
11. A proxy device comprising a processor and a memory, the memory having stored therein at least one instruction that is loaded and executed by the processor to implement a service invocation method for a legacy system according to any of claims 1 to 8.
CN202111502261.XA 2021-12-10 2021-12-10 Service calling method, device, storage medium and equipment of legacy system Active CN113901377B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111502261.XA CN113901377B (en) 2021-12-10 2021-12-10 Service calling method, device, storage medium and equipment of legacy system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111502261.XA CN113901377B (en) 2021-12-10 2021-12-10 Service calling method, device, storage medium and equipment of legacy system

Publications (2)

Publication Number Publication Date
CN113901377A CN113901377A (en) 2022-01-07
CN113901377B true CN113901377B (en) 2022-03-25

Family

ID=79025709

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111502261.XA Active CN113901377B (en) 2021-12-10 2021-12-10 Service calling method, device, storage medium and equipment of legacy system

Country Status (1)

Country Link
CN (1) CN113901377B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101695070A (en) * 2009-09-30 2010-04-14 北京航空航天大学 Method and system for service encapsulation of Java legacy system
CN101840334A (en) * 2010-04-16 2010-09-22 中国电子科技集团公司第二十八研究所 Software component service packaging method
US9690577B1 (en) * 2004-02-09 2017-06-27 Akana, Inc. Legacy applications as web services
CN108268375A (en) * 2018-01-12 2018-07-10 深圳壹账通智能科技有限公司 Applied program testing method, device, computer equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9690577B1 (en) * 2004-02-09 2017-06-27 Akana, Inc. Legacy applications as web services
CN101695070A (en) * 2009-09-30 2010-04-14 北京航空航天大学 Method and system for service encapsulation of Java legacy system
CN101840334A (en) * 2010-04-16 2010-09-22 中国电子科技集团公司第二十八研究所 Software component service packaging method
CN108268375A (en) * 2018-01-12 2018-07-10 深圳壹账通智能科技有限公司 Applied program testing method, device, computer equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
云平台的应用迁移与大数据系统部署研究;鲁帆;《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》;20180215(第02期);第1-57页 *

Also Published As

Publication number Publication date
CN113901377A (en) 2022-01-07

Similar Documents

Publication Publication Date Title
CN108574604B (en) Test method and device
CN111159614B (en) Webpage resource acquisition method and device
CN109240697B (en) Call processing method and device and storage medium
CN113806037A (en) Service calling method and device, storage medium and electronic equipment
CN111694620B (en) Interaction method, device and equipment of third party service and computer storage medium
CN109725887B (en) Data interaction method and device based on message research and development framework and terminal equipment
CN112491940B (en) Request forwarding method and device of proxy server, storage medium and electronic equipment
CN112732547B (en) Service testing method and device, storage medium and electronic equipment
CN112650689A (en) Test method, test device, electronic equipment and storage medium
CN112699034A (en) Virtual login user construction method, device, equipment and storage medium
CN112417336A (en) Page display method and device, electronic equipment and storage medium
CN113901377B (en) Service calling method, device, storage medium and equipment of legacy system
CN115454878A (en) Interface calling test method applied to micro service and related device
CN110968497A (en) Tree-shaped interceptor-based request verification method, device, medium and electronic equipment
CN115774584A (en) Data processing method and device, electronic equipment and storage medium
CN114489603A (en) Code generation method, apparatus, electronic device, medium, and product
CN112000313A (en) Request response method, device, equipment and storage medium
CN113779122A (en) Method and apparatus for exporting data
CN114125067A (en) Front-end and back-end separated gray scale publishing method, front-end server and configuration server
CN111857736A (en) Cloud computing product generation method, device, equipment and storage medium
CN112182083A (en) File generation method, device, equipment and storage medium
CN115328778A (en) http request processing method, http request processing device, computer device, and storage medium
CN112559213B (en) Application communication method, device, computer equipment and storage medium
US20230401275A1 (en) Tenant network for rewriting of code included in a web page
CN111158671B (en) Micro-service architecture software module dynamic loading method based on registration and directional scanning

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder

Address after: Room 307, Zijin Oriental building, 288 Qiyue street, Suzhou Industrial Park, Suzhou City, Jiangsu Province

Patentee after: Tianju DIHE (Suzhou) Technology Co.,Ltd.

Address before: Room 307, Zijin Oriental building, 288 Qiyue street, Suzhou Industrial Park, Suzhou City, Jiangsu Province

Patentee before: TIANJU DIHE (SUZHOU) DATA CO.,LTD.

CP01 Change in the name or title of a patent holder