CN112861033B - Method and device for executing service - Google Patents

Method and device for executing service Download PDF

Info

Publication number
CN112861033B
CN112861033B CN202110156996.5A CN202110156996A CN112861033B CN 112861033 B CN112861033 B CN 112861033B CN 202110156996 A CN202110156996 A CN 202110156996A CN 112861033 B CN112861033 B CN 112861033B
Authority
CN
China
Prior art keywords
character string
recognized
task information
preset
determining
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
CN202110156996.5A
Other languages
Chinese (zh)
Other versions
CN112861033A (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.)
Beijing Sankuai Online Technology Co Ltd
Original Assignee
Beijing Sankuai Online 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 Sankuai Online Technology Co Ltd filed Critical Beijing Sankuai Online Technology Co Ltd
Priority to CN202110156996.5A priority Critical patent/CN112861033B/en
Publication of CN112861033A publication Critical patent/CN112861033A/en
Application granted granted Critical
Publication of CN112861033B publication Critical patent/CN112861033B/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/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9554Retrieval from the web using information identifiers, e.g. uniform resource locators [URL] by using bar codes
    • 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/903Querying
    • G06F16/90335Query processing
    • G06F16/90344Query processing by using string matching techniques

Abstract

The specification discloses a method and a device for executing a service. The method comprises the steps of obtaining a character string to be recognized, verifying the format of the character string to be recognized, determining first task information when the character string to be recognized is matched with a character string coding format, obtaining service data through an overseas server corresponding to the first task information, generating a service interface through a pre-configured tool pack, enabling a user to execute a service, analyzing the character string to be recognized when the character string to be recognized is matched with a link format, determining second task information, judging whether the character string to be recognized points to an domestic server or not according to the second task information, obtaining the service data through the domestic server if the character string to be recognized points to the domestic server, generating the service interface through the tool pack, enabling the user to execute the service, otherwise, obtaining the service data through the overseas server, and generating the service interface through the tool pack to enable the user to execute the service. According to different formats of the character strings to be recognized, data can be acquired through different servers, and a service interface is generated to enable a user to execute services.

Description

Method and device for executing service
Technical Field
The present disclosure relates to the field of information identification, and in particular, to a method and an apparatus for executing a service.
Background
With the development of internet technology, the consumption modes of people become more diversified and more convenient. At present, people can scan the cash register code of a merchant and carry out online payment through a payment platform in addition to cash payment when consuming.
Currently, the cash register of the merchant is usually a matrix two-dimensional code, which generally at least includes a link to a server of the payment platform and an identifier of the merchant, and the link is usually in the form of a Uniform Resource Locator (URL). After a user scans a two-dimensional code of a merchant by using a client of a payment platform, the client can firstly analyze the two-dimensional code, determine the content contained in the two-dimensional code, then identify the content obtained by analysis, determine a link contained in the two-dimensional code and an identifier of the merchant, and then acquire data of a payment interface from a server according to the link so as to display the payment interface in the client and enable the user to pay for the merchant through the payment interface.
Disclosure of Invention
The present specification provides a method and an apparatus for executing a service, so as to partially solve the above problems in the prior art.
The technical scheme adopted by the specification is as follows:
the present specification provides a method for executing a service, which specifically includes:
responding to the operation of a user on an entrance, and acquiring a character string to be recognized;
verifying whether the character string to be identified is matched with a preset character string coding format or a preset link format;
when the character string to be recognized is matched with the preset character string coding format, determining first task information according to a matching result, acquiring service data through an overseas server corresponding to the first task information, and generating a service interface through a pre-configured tool pack according to the service data and the first task information, so that the user executes service through the service interface;
when the character string to be recognized is matched with the preset link format, analyzing the character string to be recognized according to the link format, determining second task information, and judging whether the character string to be recognized points to an internal server or not according to the second task information;
if yes, acquiring service data through the domestic server according to the second task information, and generating the service interface through the toolkit to enable the user to execute services through the service interface;
if not, according to the second task information, acquiring service data through an overseas server corresponding to the second task information, and generating the service interface through the toolkit, so that the user executes services through the service interface.
Optionally, verifying whether the character string to be recognized is matched with a preset character string encoding format or a preset link format specifically includes:
identifying whether the character string to be identified contains a domain name or not according to a preset regular expression;
if so, determining that the character string to be recognized is matched with a preset link format;
if not, splitting the character string to be recognized according to a preset character string coding format, determining each label key value pair contained in the character string to be recognized, analyzing each label key value pair, if the analysis is successful, determining that the character string to be recognized is matched with the preset character string coding format, and if the analysis is failed, determining that the character string to be recognized is not matched with the preset character string coding format and the preset link format.
Optionally, splitting the character string to be recognized according to a preset character string encoding format, determining each label key value pair included in the character string to be recognized, and analyzing each label key value pair, specifically including:
according to a preset character string encoding format, starting from a first character of the character string to be recognized, determining a label number and a label length of a first label in the character string to be recognized, determining a label value corresponding to the label according to the label length, and taking the label number and the label value as a label key value pair;
sequentially determining each label key value pair from the character string to be identified;
determining the identification information of the overseas server contained in the character string to be recognized according to each label key value pair and the label rule in the character string coding format;
and judging whether the preset overseas server identification set is hit in the identification information, if so, determining that the analysis is successful, and if not, determining that the analysis is failed.
Optionally, judging whether the character string to be recognized points to an domestic server according to the second task information specifically includes:
and judging whether the domain name hits a preset domestic server domain name white list or not according to the server domain name pointed by the link contained in the second task information.
Optionally, before acquiring service data through an outbound server corresponding to the second task information according to the second task information, the method further includes:
judging whether the domain name hits a preset overseas server domain name white list or not according to the server domain name pointed by the link contained in the second task information;
if yes, acquiring service data through an overseas server corresponding to the second task information according to the second task information;
if not, determining that the character string to be identified is an invalid character string, and displaying error prompt information to the user.
Optionally, the method further comprises:
and when the character string to be recognized is not matched with a preset character string coding format and a preset link format, determining that the character string to be recognized is an invalid character string, and displaying error prompt information to the user.
Optionally, determining the first task information according to the matching result, and acquiring the service data through an outbound server corresponding to the first task information, specifically including:
determining data contained in each label key value pair as first task information according to each label key value pair and a label rule in the character string coding format;
and acquiring service data through the overseas server according to the identification information of the overseas server contained in the first task information.
The present specification provides a device for executing a service, where the device specifically includes:
the monitoring module is used for responding to the operation of a user on an entrance and acquiring a character string to be recognized;
the verification module is used for verifying whether the character string to be recognized is matched with a preset character string coding format or a preset link format;
the interface generation first module is used for determining first task information according to a matching result when the character string to be recognized is matched with the preset character string coding format, acquiring service data through an off-site server corresponding to the first task information, and generating a service interface through a pre-configured tool kit according to the service data and the first task information so that the user executes service through the service interface;
the judging module is used for analyzing the character string to be recognized according to the link format when the character string to be recognized is matched with the preset link format, determining second task information and judging whether the character string to be recognized points to an domestic server or not according to the second task information;
the interface generation second module is used for acquiring service data through the domestic server according to the second task information and generating the service interface through the toolkit if the second task information is true, so that the user can execute services through the service interface;
and the interface generation third module is used for acquiring service data through an overseas server corresponding to the second task information according to the second task information if the user does not execute the service through the service interface, and then generating the service interface through the toolkit.
The present specification provides a computer-readable storage medium storing a computer program which, when executed by a processor, implements the above-described method of performing a service.
The present specification provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the method of performing the service when executing the program.
The technical scheme adopted by the specification can achieve the following beneficial effects:
in the method for executing a service provided in this specification, a character string to be recognized is acquired, the format of the character string to be recognized is verified, when the character string to be recognized is matched with the character string coding format, determining first task information, acquiring service data through an overseas server corresponding to the first task information, and generates a service interface through a pre-configured tool pack to enable a user to execute the service, when the character string to be recognized is matched with the link format, analyzing the character string to be recognized, determining second task information, judging whether the character string to be recognized points to an domestic server according to the second task information, if so, and acquiring service data through the domestic server, generating a service interface through the toolkit, and enabling the user to execute the service, otherwise, acquiring the service data through the overseas server, and generating the service interface through the toolkit, and enabling the user to execute the service.
The method can be seen in that the method can identify the two-dimensional codes with different formats inside and outside the country through one entrance, analyze the character strings to be identified in the two-dimensional codes according to the identified two-dimensional code formats, acquire the data required for generating the service interface from the corresponding inside or outside server, and enable the user to execute the service through the service interface.
Drawings
The accompanying drawings, which are included to provide a further understanding of the specification and are incorporated in and constitute a part of this specification, illustrate embodiments of the specification and together with the description serve to explain the specification and not to limit the specification in a non-limiting sense. In the drawings:
fig. 1 is a schematic flow chart of a method for executing a service in the present specification;
FIG. 2 is a schematic diagram of a system for performing a service provided herein;
fig. 3 is a schematic diagram of a route identification process provided in the present specification;
fig. 4 is a schematic diagram of an apparatus for performing a service provided in the present specification;
fig. 5 is a schematic structural diagram of an electronic device corresponding to fig. 1 provided in this specification.
Detailed Description
In order to make the objects, technical solutions and advantages of the present disclosure more clear, the technical solutions of the present disclosure will be clearly and completely described below with reference to the specific embodiments of the present disclosure and the accompanying drawings. It is to be understood that the embodiments described are only a few embodiments of the present disclosure, and not all embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present specification without any creative effort belong to the protection scope of the present specification.
The technical solutions provided by the embodiments of the present description are described in detail below with reference to the accompanying drawings.
At present, when a user consumes online, cash is paid to a merchant, a collection code of the merchant can be scanned, and payment is made to the merchant through a payment platform. The merchant's checkout code includes a static code and a dynamic code. The static code is a two-dimensional code provided by the payment platform, and after the static code is scanned by a client of the payment platform, a user can input a corresponding amount to pay the merchant on a payment interface. The dynamic code is a collection code temporarily generated according to a business order of the user, after the user scans the dynamic code, the payment page can display the amount of money to be paid by the user, and the user can pay for the merchant after inputting a payment password or verifying a fingerprint. Typically, the merchant's checkout code is a URL formatted two-dimensional code or a two-dimensional code that conforms to EMVCo standards. The two-dimensional code conforming to the EMVCo standard is a two-dimensional code conforming to the technical specification of the two-dimensional code mode issued by EMVCo (international chip card and payment technical standard organization) by EMVCo (EMVCo merchant).
For a URL format two-dimensional code, it typically contains at least a URL link to a server of the payment platform and an identification of the payee merchant corresponding to the user's payment operation. After the client identifies the URL link in the character string and the merchant identifier, the client may obtain data required for completing the current payment operation from the server of the payment platform according to the merchant identifier to generate a payment page, so that the user performs payment.
For the two-dimensional code conforming to the EMVco standard, the character string is a TLV (tag Length value) format character string. After the client acquires the TLV character string in the merchant cash register code, the TLV character string needs to be analyzed according to the technical specification of the EMVCo merchant two-dimensional code mode, data contained in the merchant cash register code is acquired, a payment page is generated, and the user pays.
In general, it is difficult for an in-house payment platform to acquire a local payment service license abroad, and the in-house payment platform needs to perform a payment service in cooperation with an out-of-house payment platform when performing the out-of-house payment service. Therefore, the static code used by a general overseas merchant is a two-dimensional code configured by a local payment platform with a payment service license, the two-dimensional code is mostly a two-dimensional code conforming to the EMVco standard or a two-dimensional code in a URL format, and the static code used by an domestic merchant is a two-dimensional code in a URL format configured by a local payment platform. However, the client of the current payment platform can only analyze the two-dimensional code in one format to generate a payment page for the user to pay. Namely, a client of one payment platform can only analyze the two-dimensional code in the URL format or only the two-dimensional code in the EMVco standard.
Because two-dimensional codes used in different countries and regions are different at present, a client of one payment platform can only analyze two-dimensional codes in one format. Therefore, for different two-dimensional codes, when a user pays, the user needs to scan, identify and pay through the clients of different payment platforms, so that the user needs to install the clients of different payment platforms on the terminal, and especially when the user travels across countries or across borders, the user needs to switch different payment platforms when paying in different countries or regions, so that the payment operation is complicated when the user consumes online, and the payment efficiency is low.
In order to solve the problems of complex payment operation and low payment efficiency in the prior art, the application provides a method for executing a service.
Fig. 1 is a schematic flow chart of a method for executing a service in this specification, which specifically includes the following steps:
s100: and responding to the operation of the user on the entrance, and acquiring the character string to be recognized.
In this specification, the execution subject of the method for executing the service is a client of the payment platform.
In one or more embodiments of the present description, a client of the payment platform may monitor user access to an entry identifying a merchant checkout. And when the client monitors the operation of the user on the entrance, the client calls a camera on a terminal provided with the client to acquire an image in response to the operation of the user on the entrance, determines a two-dimensional code which is a collection code in the image, identifies the two-dimensional code and acquires a character string to be identified contained in the two-dimensional code. How to recognize the two-dimensional code and acquire the character strings contained in the two-dimensional code is a mature technology, and the description is not repeated herein.
S102: and verifying whether the character string to be identified is matched with a preset character string encoding format or a preset link format.
In one or more embodiments of the present description, the payee code of the merchant is usually a two-dimensional code in URL format or a two-dimensional code conforming to EMVCo specification. Therefore, after the character string to be recognized is obtained, the client can verify whether the character string to be recognized is in one of a URL format or a TLV format conforming to EMVCo specification, so that in subsequent steps, the character string to be recognized is analyzed in different ways according to the verification result, or error prompt information is displayed to the user.
Specifically, the client may verify whether the character string to be recognized matches a preset character string encoding format or a preset link format. The preset string encoding format may be a TLV format conforming to EMVCo specifications, and the preset link format may be a URL format, which may be specifically set as required, and this specification is not limited herein. The client may first identify whether the character string to be identified includes a domain name according to a preset Regular Expression (RE), and if so, determine that the character string to be identified matches a preset link format. Otherwise, the client can split the character string to be recognized according to a preset character string coding format, determine each label key value pair contained in the character string to be recognized, and analyze each label key value pair. When the client analyzes each label key value pair of the character string to be recognized, the client can determine the label number and the label length of the first label in the character string to be recognized from the first character of the character string to be recognized, then determine the label value corresponding to the label according to the label length, and take the label number and the label value as one label key value pair.
Wherein, the TLV format is a variable format, in the TLV format, an abbreviation of T is Tag to indicate a label number, an abbreviation of L is Length to indicate a Length of Value, an abbreviation of V is Value to indicate a Value of Tag, and lengths of Tag and Length are fixed, and are generally 2 or 4 bytes.
In one or more embodiments of the present specification, taking the to-be-recognized character string as "00041111250833333333580200" and taking the preset lengths of Tag and Length as an example, after the client acquires the to-be-recognized character string, the client may determine, starting from the first character "0", that the Tag number of the first Tag in the to-be-recognized character string is 00 and determine that the Tag Length of the Tag is 04, then determine, starting from the 5 th character of the to-be-recognized character string, that the 4-bit character "1111" is the Tag value of the Tag, and take the Tag number and the Tag value as a Tag key value pair. After determining the first label key-value pair of the character string to be recognized, the client may continue to determine the label key-value pairs in the character string to be recognized until all the label key-value pairs are determined from the character string to be recognized in sequence. Then, for the character string to be recognized "00041111250833333333580200", the finally determined pair of Tag key values in the character string to be recognized is "Tag-00, Value-1111", "Tag-25, Value-33333333", "Tag-58, and Value-00".
In one or more embodiments of the present specification, if a tag Value, that is, a tag key-Value pair whose Value also conforms to the TLV format exists in each determined tag key-Value pair, for example, the tag key-Value pair whose Value also conforms to the TLV format has the format T1L1V1Wherein V is1Also in TLV format, i.e. V1=T2L2V2The tag key-Value pair format, whose Value also conforms to the TLV format, is actually T1L1(T2L2V2). The client may continue to Value V for the tag key-Value pair according to the TLV format1And splitting, and continuously determining the label key Value pair in the Value as the label key Value pair of the character string to be identified until the Value conforming to the TLV format does not exist in all the determined label key Value pairs.
In one or more embodiments of the present specification, after determining each Tag key Value pair in the character string to be recognized, the client may determine the meaning represented by each Tag key Value pair according to each Tag key Value pair and the Tag rule in the character string encoding format, for example, if a Tag with Tag 58 represents a country, a Value corresponding to a Tag with Tag 58 indicates a country number, and a Tag with Tag 59 indicates a merchant name, a Value corresponding to a Tag with Tag 59 indicates a specific merchant name. After determining the meanings corresponding to the tag values, the client can determine the identification information of the overseas server contained in the character string to be recognized, and judge whether the identification information hits a preset overseas server identification set, if so, the analysis is determined to be successful, and if not, the analysis is determined to be failed.
In one or more embodiments of the present specification, if the parsing is successful, it is determined that the character string to be recognized matches a preset character string encoding format, and it is determined that the receipt code is an overseas receipt code, and if the parsing is failed, it is determined that the character string to be recognized does not match the preset character string encoding format and a preset link format.
In one or more embodiments of the present specification, when the to-be-recognized character string does not match a preset character string encoding format or a preset link format, the client may determine that the to-be-recognized character string is an invalid character string, and present an error prompt message to the user.
S104: when the character string to be recognized is matched with the preset character string coding format, determining first task information according to a matching result, acquiring service data through an overseas server corresponding to the first task information, generating a service interface according to the service data and the first task information and through a pre-configured tool pack, and enabling the user to execute services through the service interface.
In one or more embodiments of the present specification, when the client determines that the character string to be recognized matches a preset character string encoding format, that is, determines that the character string to be recognized is a TLV format character string, the client may determine, according to each tag key value pair obtained by matching and a tag rule in the character string encoding format, to-be-processed data included in each tag key value pair as the first task information. The first task information includes partial information required for generating the resource acquisition interface, for example, data such as a merchant identifier corresponding to a cash register scanned by a user, an identifier of an overseas server, a country code where the merchant is located, and a city code.
Because the cash register of the merchant only contains part of information for generating the service interface, after the first task information is determined, the client can send the merchant identifier contained in the first task information and the identity identifier of the client to the overseas server according to the identifier information of the overseas server contained in the first task information, so that the overseas server returns service data for generating the service interface according to the merchant identifier and the identity identifier. The client can generate a service interface through a pre-configured tool kit according to the received service data and the first task information, so that a user can execute a service through the service interface. The service interface may be a resource acquisition interface through which the user may pay the merchant to perform the payment service.
The identity is an identity of the client carried in a User-Agent header file of a hypertext Transfer Protocol over secure session Layer (HTTPS), and the overseas server can identify that the data acquisition request originates from the client according to the identity and return the service data to the client. The business data may include data such as exchange rates and other information about the merchant. The preconfigured toolkit may be a Software Development Kit (SDK) for generating payment pages.
S106: when the character string to be recognized is matched with the preset link format, analyzing the character string to be recognized according to the link format, determining second task information, and judging whether the character string to be recognized points to an internal server or not according to the second task information. If yes, go to step S108, otherwise go to step S110.
In one or more embodiments of the present specification, when the client determines that the character string to be recognized matches a preset link format, that is, when the character string to be recognized is determined to be a character string in a URL format, the character string to be recognized may be analyzed, and a merchant identifier and a URL link included in the character string to be recognized are determined to be second task information. The URL link includes at least one of a link to an outbound server and a link to an inbound server. The client can judge whether the character string to be identified points to an internal server according to the URL link so as to obtain other service data for generating a service interface in different modes according to different judgment results.
Specifically, the client may determine whether the domain name hits a preset domestic server domain name white list according to the domain name of the server pointed by the URL link included in the second task information. If yes, determining the URL link as a valid link, and determining that the character string to be recognized points to an internal server. If not, determining that the character string to be recognized does not point to the domestic server, and executing step S110.
S108: and acquiring service data through the domestic server according to the second task information, and generating the service interface through the toolkit to enable the user to execute the service through the service interface.
In one or more embodiments of the present specification, when the character string to be recognized points to an in-home server, the client may send a data acquisition request to the in-home server corresponding to the URL link according to a merchant identifier and the URL link included in the character string to be recognized, acquire other service data required for generating a service interface through the in-home server, generate the service interface through the toolkit, generate the service interface, and enable the user to execute a service through the service interface.
S110: and according to the second task information, acquiring service data through an overseas server corresponding to the second task information, and generating the service interface through the toolkit to enable the user to execute services through the service interface.
In one or more embodiments of the present specification, when it is determined that the character string to be recognized does not point to the domestic server, the client may determine whether the domain name hits a preset domain name white list of the overseas server. If the domain name hits a preset domain name white list of the overseas server, when the character string to be recognized points to the overseas server, the client can send a data acquisition request carrying the identity identifier to the overseas server corresponding to the URL link according to a merchant identifier and the URL link contained in the character string to be recognized, and generate a service interface through the tool pack according to service data returned by the overseas server and used for generating a resource acquisition interface, so that the user executes services through the service interface. And if the domain name does not hit a preset domain name white list of the overseas server, determining that the character string to be identified is an invalid character string, and displaying error prompt information to the user.
Based on the method for executing the service shown in fig. 1, a character string to be recognized is obtained, the format of the character string to be recognized is verified, when the character string to be recognized matches with the code format of the character string, first task information is determined, service data is obtained through an overseas server corresponding to the first task information, a service interface is generated through a pre-configured tool pack, a user executes the service, when the character string to be recognized matches with the link format, the character string to be recognized is analyzed, second task information is determined, whether the character string to be recognized points to an domestic server or not is judged according to the second task information, if yes, service data is obtained through the domestic server, the service interface is generated through the tool pack, the user executes the service, otherwise, the service data is obtained through the overseas server, and the service interface is generated through the tool pack, so that the user executes the service.
The method can be seen in that the method can identify the two-dimensional codes with different formats inside and outside the country through one entrance, analyze the character strings to be identified in the two-dimensional codes according to the identified two-dimensional code formats, acquire the data required for generating the service interface from the corresponding inside or outside server, and enable the user to execute the service through the service interface.
In addition, in step S102 in this specification, when it is determined that the identification information hits a preset overseas server identification set, the client may further determine whether the character string to be recognized includes a Tag key value pair of Tag 63, and if so, perform Cyclic Redundancy Check (CRC) on the character string to be recognized to verify whether the character string to be recognized includes error data. And when the verification is passed, determining that the analysis of each label key value pair of the character string to be recognized is successful.
In addition, in one or more embodiments of the present specification, before determining whether the domain name of the URL link included in the second task information hits a preset domestic server domain name white list in step S106, the client may determine whether the location of the user is consistent with the location corresponding to the domain name. If the URL link is not consistent, for example, the address corresponding to the domain name is the united states, and the location of the user is japan, the client may determine that the URL link included in the second task information is an invalid link, and present error notification information to the user.
Or, when the location of the user and the location corresponding to the domain name are located in different regions of the same country, the client may also continue to determine whether the domain name linked by the URL hits a preset domestic server domain name white list, that is, the location of the user and the location corresponding to the domain name are consistent on a national level. The positioning accuracy in determining the location, that is, to what extent the location of the user is consistent with the location corresponding to the domain name, may be set as required, and this specification is not limited herein. Or, when the location of the user and the location corresponding to the domain name are in the same overseas country or region, the client determines whether the domain name linked by the URL hits a preset overseas server domain name white list. The Internet Protocol (IP) Address corresponding to the terminal where the client is located may be used as the location where the user is located, a Global Positioning System (GPS) coordinate of the terminal where the client is located may also be used as the location where the user is located, and the location of the user may also be determined according to other methods, which is not limited herein.
Based on the method for executing a service shown in fig. 1, the present specification also provides a system for executing a service, where the system includes: a client, an inbound server, and an outbound server. The process of the system performing the service is shown in figure 2. Fig. 2 is a schematic diagram of a system for executing a service provided in this specification, as shown in fig. 2: the black square indicates a merchant's cash register, the rectangle with diagonal hatching indicates a terminal on which the client M is installed, the server P indicates a home server, and the server Q indicates an overseas server. Wherein:
the client M is used for responding to the operation of a user on an entrance after the user scans a payment code of a merchant, acquiring a character string to be recognized, verifying whether the character string to be recognized is matched with a preset character string coding format or a preset link format, namely verifying whether the character string to be recognized is in one of an internal URL format, an external URL format or an EMVco format, when the character string to be recognized conforms to the EMVco format or the external URL format, sending a service data acquisition request with an identity identifier to an external server Q, generating a service interface through a pre-configured tool pack according to service data returned by the server Q, enabling the user to execute service through the service interface, when the character string to be recognized conforms to the internal URL format, sending the service data acquisition request with the identity identifier to an internal server P, and according to the service data returned by the server P, and generating a service interface through the tool kit, so that the user executes the service through the service interface.
The domestic server P is configured to receive the service data acquisition request carrying the identity sent by the client M, and return the service data to the client M.
The overseas server Q is configured to receive a service data acquisition request with an identity sent by the client M, and send service data to the client M according to the identity.
The process of verifying whether the character string to be recognized matches the preset character string encoding format or the preset link format is a process of identifying a route, and the process of identifying a route is specifically shown in fig. 3, where fig. 3 is a schematic diagram of a process of identifying a route provided by this specification. As shown in the figure, after acquiring the character string to be recognized, the client determines whether the character string to be recognized includes a domain name. When the character string to be recognized contains the domain name, determining that the character string to be recognized contains the URL link, judging whether the URL link points to an in-home server, if so, determining that the character string to be recognized is the in-home URL link, if not, continuously judging whether the URL link points to an out-of-home server, determining that the character string to be recognized is the out-of-home URL link when the URL link points to the out-of-home server, and determining that the character string to be recognized is an invalid character string when the URL link does not point to the out-of-home server. When the character string to be recognized does not contain the domain name, the client can judge whether the character string to be recognized is matched with a preset character string coding format or not according to the preset character string coding format, if so, the character string to be recognized is determined to be the character string in the EMVco format, and if not, the character string to be recognized is determined to be the invalid character string.
Based on the same idea, the present specification further provides a corresponding apparatus for executing a service, as shown in fig. 4.
Fig. 4 is a schematic diagram of an apparatus for performing a service provided in this specification, where the apparatus includes:
the monitoring module 200 is used for responding to the operation of a user on an entrance and acquiring a character string to be recognized;
a verification module 201, configured to verify whether the character string to be recognized matches a preset character string encoding format or a preset link format;
an interface generation first module 202, configured to determine first task information according to a matching result when the character string to be recognized matches the preset character string encoding format, acquire service data through an outbound server corresponding to the first task information, and generate a service interface according to the service data and the first task information and through a pre-configured toolkit, so that the user executes a service through the service interface;
the judging module 203 is configured to, when the character string to be recognized matches the preset link format, analyze the character string to be recognized according to the link format, determine second task information, and judge whether the character string to be recognized points to an domestic server according to the second task information;
an interface generation second module 204, configured to, if yes, obtain, according to the second task information, service data through the domestic server, and generate, through the toolkit, the service interface, so that the user executes a service through the service interface;
an interface generating third module 205, configured to, if not, obtain, according to the second task information, service data through an outbound server corresponding to the second task information, and generate, through the toolkit, the service interface, so that the user executes a service through the service interface.
Optionally, the verification module 201 is configured to identify whether the character string to be identified includes a domain name according to a preset regular expression, if so, determine that the character string to be identified matches a preset link format, if not, split the character string to be identified according to a preset character string encoding format, determine each label key value pair included in the character string to be identified, and analyze each label key value pair, if the analysis is successful, determine that the character string to be identified matches the preset character string encoding format, and if the analysis is failed, determine that the character string to be identified does not match the preset character string encoding format and the preset link format.
Optionally, the verification module 201 is configured to determine, according to a preset character string encoding format, a tag number and a tag length of a first tag in the character string to be recognized, determine, according to the tag length, a tag value corresponding to the tag, use the tag number and the tag value as a tag key value pair, sequentially determine, from the character string to be recognized, each tag key value pair, determine, according to each tag key value pair and a tag rule in the character string encoding format, identification information of an overseas server included in the character string to be recognized, determine whether the identification information hits a preset overseas server identification set, if yes, determine that parsing is successful, and if not, determine that parsing is failed.
Optionally, the determining module 203 is configured to determine, according to the server domain name pointed by the link included in the second task information, whether the domain name hits a preset domestic server domain name white list.
Optionally, whether the domain name hits a preset domain name white list of an overseas server is judged according to the server domain name pointed by the link contained in the second task information, if yes, service data is obtained through the overseas server corresponding to the second task information according to the second task information, and if not, the character string to be identified is determined to be an invalid character string, and error prompt information is displayed to the user.
Optionally, when the character string to be recognized is not matched with a preset character string encoding format and a preset link format, determining that the character string to be recognized is an invalid character string, and displaying error prompt information to the user.
Optionally, the verification module 201 is configured to determine, according to each tag key value pair and a tag rule in the character string encoding format, data included in each tag key value pair as first task information, and obtain, through an overseas server, service data according to identification information of the overseas server included in the first task information.
The present specification also provides a computer-readable storage medium storing a computer program, which can be used to execute the method for executing the service provided in fig. 1.
This specification also provides a schematic block diagram of the electronic device shown in fig. 5. As shown in fig. 5, at the hardware level, the electronic device includes a processor, an internal bus, a memory, and a non-volatile memory, but may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs the computer program to implement the method for executing the service provided in fig. 1.
Of course, besides the software implementation, the present specification does not exclude other implementations, such as logic devices or a combination of software and hardware, and the like, that is, the execution subject of the following processing flow is not limited to each logic unit, and may be hardware or logic devices.
In the 90 s of the 20 th century, improvements in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an Integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Hardware Description Language), traffic, pl (core universal Programming Language), HDCal (jhdware Description Language), lang, Lola, HDL, laspam, hardward Description Language (vhr Description Language), vhal (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the various elements may be implemented in the same one or more software and/or hardware implementations of the present description.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, the description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the description may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
This description may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present specification, and is not intended to limit the present specification. Various modifications and alterations to this description will become apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification should be included in the scope of the claims of the present specification.

Claims (10)

1. A method of performing a service, comprising:
responding to the operation of a user on an entrance, determining a payment two-dimensional code, identifying the payment two-dimensional code, and acquiring a character string to be identified;
verifying whether the character string to be identified is matched with a preset character string coding format or a preset link format;
when the character string to be recognized is matched with the preset character string coding format, determining first task information according to a matching result, acquiring service data through an overseas server corresponding to the first task information, and generating a service interface through a pre-configured tool pack according to the service data and the first task information, so that the user executes service through the service interface;
when the character string to be recognized is matched with the preset link format, analyzing the character string to be recognized according to the link format, determining second task information, and judging whether the character string to be recognized points to an internal server or not according to the second task information;
if yes, acquiring service data through the domestic server according to the second task information, and generating the service interface through the toolkit to enable the user to execute services through the service interface;
if not, according to the second task information, acquiring service data through an overseas server corresponding to the second task information, and generating the service interface through the toolkit, so that the user executes services through the service interface.
2. The method according to claim 1, wherein verifying whether the character string to be recognized matches a preset character string encoding format or a preset link format specifically comprises:
identifying whether the character string to be identified contains a domain name or not according to a preset regular expression;
if so, determining that the character string to be recognized is matched with a preset link format;
if not, splitting the character string to be recognized according to a preset character string coding format, determining each label key value pair contained in the character string to be recognized, analyzing each label key value pair, if the analysis is successful, determining that the character string to be recognized is matched with the preset character string coding format, and if the analysis is failed, determining that the character string to be recognized is not matched with the preset character string coding format and the preset link format.
3. The method according to claim 2, wherein splitting the character string to be recognized according to a preset character string encoding format, determining each label key-value pair included in the character string to be recognized, and analyzing each label key-value pair specifically includes:
according to a preset character string encoding format, starting from a first character of the character string to be recognized, determining a label number and a label length of a first label in the character string to be recognized, determining a label value corresponding to the label according to the label length, and taking the label number and the label value as a label key value pair;
sequentially determining each label key value pair from the character string to be identified;
determining the identification information of the overseas server contained in the character string to be recognized according to each label key value pair and the label rule in the character string coding format;
and judging whether the preset overseas server identification set is hit in the identification information, if so, determining that the analysis is successful, and if not, determining that the analysis is failed.
4. The method according to claim 1, wherein determining whether the character string to be recognized is directed to an domestic server according to the second task information specifically includes:
and judging whether the domain name hits a preset domestic server domain name white list or not according to the server domain name pointed by the link contained in the second task information.
5. The method of claim 1, wherein before the service data is obtained by the outbound server corresponding to the second task information according to the second task information, the method further comprises:
judging whether the domain name hits a preset overseas server domain name white list or not according to the server domain name pointed by the link contained in the second task information;
if yes, acquiring service data through an overseas server corresponding to the second task information according to the second task information;
if not, determining that the character string to be identified is an invalid character string, and displaying error prompt information to the user.
6. The method of claim 2 or 4, wherein the method further comprises:
and when the character string to be recognized is not matched with a preset character string coding format and a preset link format, determining that the character string to be recognized is an invalid character string, and displaying error prompt information to the user.
7. The method according to claim 3, wherein the determining the first task information according to the matching result, and acquiring the service data through the outbound server corresponding to the first task information specifically comprises:
determining data contained in each label key value pair as first task information according to each label key value pair and a label rule in the character string coding format;
and acquiring service data through the overseas server according to the identification information of the overseas server contained in the first task information.
8. An apparatus for performing a service, the apparatus comprising:
the monitoring module is used for responding to the operation of a user on an entrance, determining a payment two-dimensional code, identifying the payment two-dimensional code and acquiring a character string to be identified;
the verification module is used for verifying whether the character string to be recognized is matched with a preset character string coding format or a preset link format;
the interface generation first module is used for determining first task information according to a matching result when the character string to be recognized is matched with the preset character string coding format, acquiring service data through an off-site server corresponding to the first task information, and generating a service interface through a pre-configured tool kit according to the service data and the first task information so that the user executes service through the service interface;
the judging module is used for analyzing the character string to be recognized according to the link format when the character string to be recognized is matched with the preset link format, determining second task information and judging whether the character string to be recognized points to an domestic server or not according to the second task information;
the interface generation second module is used for acquiring service data through the domestic server according to the second task information and generating the service interface through the toolkit if the second task information is true, so that the user can execute services through the service interface;
and the interface generation third module is used for acquiring service data through an overseas server corresponding to the second task information according to the second task information if the user does not execute the service through the service interface, and then generating the service interface through the toolkit.
9. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method of any of the preceding claims 1 to 7.
10. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1 to 7 when executing the program.
CN202110156996.5A 2021-02-04 2021-02-04 Method and device for executing service Active CN112861033B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110156996.5A CN112861033B (en) 2021-02-04 2021-02-04 Method and device for executing service

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110156996.5A CN112861033B (en) 2021-02-04 2021-02-04 Method and device for executing service

Publications (2)

Publication Number Publication Date
CN112861033A CN112861033A (en) 2021-05-28
CN112861033B true CN112861033B (en) 2022-04-01

Family

ID=75988609

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110156996.5A Active CN112861033B (en) 2021-02-04 2021-02-04 Method and device for executing service

Country Status (1)

Country Link
CN (1) CN112861033B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113419790A (en) * 2021-06-22 2021-09-21 杭州安恒信息技术股份有限公司 Service data processing method, device, equipment and computer readable storage medium
CN114492700A (en) * 2021-12-20 2022-05-13 青岛海尔科技有限公司 Two-dimensional code generation method, two-dimensional code identification method and two-dimensional code identification device

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102222294A (en) * 2011-05-31 2011-10-19 李镇波 Novel mobile phone payment method
US9405800B1 (en) * 2004-12-13 2016-08-02 Iqor Holdings Inc. Apparatuses, methods and systems for a universal payment integrator
CN111340464A (en) * 2016-09-20 2020-06-26 徐蔚 Digital currency payment method and device based on digital person and mobile terminal
CN111932223A (en) * 2020-06-01 2020-11-13 浙江数智未来控股集团有限公司 Multi-information aggregated two-dimensional code payment method, system and device

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5500480B2 (en) * 2010-06-24 2014-05-21 株式会社日立情報通信エンジニアリング Form recognition device and form recognition method
CN103544516B (en) * 2012-07-12 2016-09-07 中国移动通信集团公司 The coding and decoding method of Quick Response Code and Quick Response Code encoder, decoder
US9128915B2 (en) * 2012-08-03 2015-09-08 Oracle International Corporation System and method for utilizing multiple encodings to identify similar language characters
CN105279535B (en) * 2015-11-10 2018-07-27 福建优安米信息科技有限公司 A kind of identification code intellectual analysis processing system and its processing method
CN109829122B (en) * 2018-12-20 2021-03-09 浙江口碑网络技术有限公司 Method and device for acquiring service entrance, storage medium and electronic device
CN111738389B (en) * 2019-05-28 2024-03-01 北京京东乾石科技有限公司 Two-dimensional code generation method and generation system
CN110197376A (en) * 2019-06-03 2019-09-03 山东管理学院 A kind of cross-border electric business internet finance method of mobile payment
WO2021003607A1 (en) * 2019-07-05 2021-01-14 深圳海付移通科技有限公司 Aggregate payment method and related devices
CN110363529A (en) * 2019-08-22 2019-10-22 北京全迹科技有限公司 Method of payment, charging terminal and the payment system of safe and convenient

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9405800B1 (en) * 2004-12-13 2016-08-02 Iqor Holdings Inc. Apparatuses, methods and systems for a universal payment integrator
CN102222294A (en) * 2011-05-31 2011-10-19 李镇波 Novel mobile phone payment method
CN111340464A (en) * 2016-09-20 2020-06-26 徐蔚 Digital currency payment method and device based on digital person and mobile terminal
CN111932223A (en) * 2020-06-01 2020-11-13 浙江数智未来控股集团有限公司 Multi-information aggregated two-dimensional code payment method, system and device

Also Published As

Publication number Publication date
CN112861033A (en) 2021-05-28

Similar Documents

Publication Publication Date Title
CN107016420B (en) Service processing method and device
CN108491897B (en) Information identification method, server, client and system
CN112861033B (en) Method and device for executing service
CN107294999B (en) Information verification processing method, device and system, client and server
CN111160845A (en) Service processing method and device
CN109298926B (en) Method and device for entering resource transfer party into resource transfer platform and electronic equipment
CN111179061A (en) Resource transfer processing method, device and equipment
CN111260336B (en) Service checking method, device and equipment based on rule engine
CN111784356A (en) Payment verification method, device, equipment and storage medium
CN113435862B (en) Bill processing method and device based on mailbox
CN113408254A (en) Page form information filling method, device, equipment and readable medium
CN108596581B (en) Verification method and device for resource transfer and electronic payment verification method and device
CN109120509B (en) Information collection method and device
CN109816462A (en) A kind of recognition methods of invoice information and device
CN116304403A (en) Webpage access method and device, computer equipment and storage medium
CN107483534B (en) Service processing method and device
CN113435950B (en) Bill processing method and device
CN111488180B (en) Service information processing method and device, electronic equipment and storage medium
CN111784481B (en) Code scanning ordering method, service code creating method, device and electronic equipment
CN112596781A (en) Service execution and service configuration method and device
CN108920589B (en) Browsing hijacking identification method, device, server and storage medium
CN113138999B (en) Data processing method and device, computer storage medium and electronic equipment
US11532023B2 (en) System and method for streamlining a checkout process of e-commerce websites
CN113840020B (en) Positioning method and device based on IP address information, electronic equipment and storage medium
CN117880008A (en) Gateway-based service request processing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant