Note : Les descriptions sont présentées dans la langue officielle dans laquelle elles ont été soumises.
CA 03176864 2022-09-23
GENERAL-PURPOSE PROCESSING METHOD AND APPARATUS FOR DATA
EXCHANGE
BACKGROUND OF THE INVENTION
Technical Field
[0001] The present invention relates to the technical field of big data, and
more particularly to a
general-purpose processing method for data exchange and its apparatus.
Description of Related Art
[0002] Conventionally, in data exchange, data are acquired by sending
particular enquiry
conditions through data interface according to practical use scenarios. The
known method,
however, is not favorable to data processing in scenarios of general-purpose
data
exchange, for example, prompting users with different error messages in
response to
different error state codes, and is favorable to unified version control of
data exchange
interfaces.
SUMMARY OF THE INVENTION
[0003] For addressing the issues of the prior art, embodiment of the present
invention provides
a general-purpose processing method for data exchange and its apparatus, which
effectively enhances reusability, efficiency, and consistency of codes, while
improving
consistency of the method and its results for data exchange, version control,
application
expansion, environment monitoring, and error processing. The technical schemes
used
are described below.
[0004] In a first aspect, the present invention provides a general-purpose
processing method for
data exchange, comprising: according to predetermined rules for a data
exchange service,
setting up initialization data parameters for the data exchange service; for a
current use
scenario, according to the initialization data parameters, calling the data
exchange service;
1
Date Regue/Date Received 2022-09-23
CA 03176864 2022-09-23
according to differentiation data parameters corresponding to the current use
scenario,
issuing a corresponding data request; and according to data returned in
response to the
data request, performing data processing required by the current use scenario.
[0005] Combined with the first aspect, in the first possible implementation,
the step of according
to predetermined rules for a data exchange service, setting up initialization
data
parameters comprises: according to agreed rules for the data exchange service,
setting up
basic data exchange incoming parameters, in which the basic data exchange
incoming
parameters include data exchange basic addresses, local encrypted data for
recognizing
user identities, identifiers for recognizing user identities.
[0006] Combined with the first aspect, in the second possible implementation,
before the step of
according to differentiation data parameters corresponding to the current use
scenario,
issuing a corresponding data request, the method further comprises: setting up
markers
for the differentiation data parameters of the specific address information
for data
exchange required by the current use scenario, and setting up delivery
parameter markers
for data exchange required by the current use scenario, and initializing them
into null
objects.
[0007] Combined with the second possible implementation of the first aspect,
in a third possible
implementation, the step of according to differentiation data parameters
corresponding to
the current use scenario, issuing a corresponding data request comprises:
filling in the
differentiation data parameters corresponding to the current use scenario, and
filling out
the delivery parameters for data exchange required by the current use
scenario.
[0008] Combined with any of the first through the third possible
implementations of the first
aspect, in the fourth through the sixth possible implementations, the step of
according to
data returned in response to the data request, performing data processing
required by the
current use scenario comprises: determining whether the data returned in
response to the
data request is normal, and if yes, returning logic processing corresponding
to the normal
data, or if no, further monitoring the current use scenario to see whether
unusual
processing is required, and if unusual processing is required, placing an
unusual
processing logic corresponding to the unusual processing into unusual
callback.
2
Date Regue/Date Received 2022-09-23
CA 03176864 2022-09-23
[0009] In a second aspect, the present invention provides a general-purpose
processing apparatus
for data exchange, the apparatus comprising: an initialization data parameter
setting up
module, for according to predetermined rules for a data exchange service,
setting up
initialization data parameters for the data exchange service; a data exchange
service
calling module, for a current use scenario, according to the initialization
data parameters,
calling the data exchange service; a data request initiating module, for
according to
differentiation data parameters corresponding to the current use scenario,
issuing a
corresponding data request; and a data processing module, for according to
data returned
in response to the data request, performing data processing required by the
current use
scenario.
[0010] Combined with the second aspect, in the first possible implementation,
the initialization
data parameter setting up module is for: according to agreed rules for the
data exchange
service, setting up basic data exchange incoming parameters, in which the
basic data
exchange incoming parameters include data exchange basic addresses, local
encrypted
data for recognizing user identities, identifiers for recognizing user
identities.
[0011] Combined with the second aspect, in the second possible implementation,
the apparatus
further comprises differentiation setting up module, which is for: before the
data request
initiating module issues a corresponding data request according to
differentiation data
parameters corresponding to the current use scenario, setting up markers for
the
differentiation data parameters of the specific address information for data
exchange
required by the current use scenario, and setting up delivery parameter
markers for data
exchange required by the current use scenario, and initializing them into null
objects.
[0012] Combined with the second possible implementation of the second aspect,
in the third
possible implementation, the data request initiating module is for: filling in
the
differentiation data parameters corresponding to the current use scenario, and
filling out
the delivery parameters for data exchange required by the current use
scenario.
[0013] Combined with any of the first through third possible implementations
of the second
aspect, in the fourth through sixth possible implementations, the data
processing module
is for: determining whether the data returned in response to the data request
is normal,
3
Date Regue/Date Received 2022-09-23
CA 03176864 2022-09-23
and if yes, returning logic processing corresponding to the normal data, or if
no, further
monitoring the current use scenario to see whether unusual processing is
required, and if
unusual processing is required, placing an unusual processing logic
corresponding to the
unusual processing into unusual callback.
[0014] The technical schemes of the embodiments of the present invention
provide the following
beneficial effects:
[0015] (1) Providing consistency: in the project creation stage, the disclosed
apparatus is
initialized according to the regulations agreed with the data providing party.
In practical
use scenarios, data requests can be easily initiated by calling the data
exchange service
so as to obtain data feedback results, thereby realizing consistency of the
data exchange
method and its results, and ensuring unified processing for input parameters
and retuned
data during data exchange between the front- and back-ends for developing the
project.
This in turn reduces repeated works for setting up and data processing in
practical use
scenarios. Use of unified packaging processing for input parameters and
returned data
during data exchange for the project simplifies development in terms of code,
step and
logic, and enhances reusability of project codes, consistency of operation,
centralization
of data exchange, and controllability of versions, leading to significantly
improved
development efficiency.
[0016] (2) Specific to version control: according to the prior-art data
exchange solutions, when
developing a system, the developer has to set up and process input parameters
and output
parameters separately for data exchange between the front- and back-ends
according to
the current use scenario. This is not only adverse to decoupling and reuse of
code
functions, but also makes it challenging to maintain consistency of the
project as a whole.
In other words, the prior-art solution is unable to provide unified processing
and unified
version control for data exchange. The present invention thus innovatively
introduces the
concept of version control, which makes it possible to call different versions
of data
according to practical use scenarios, thereby easily achieving version control
of data and
enabling data control adaptive to different scenarios and different
situations.
[0017] (3) Expanding applications: the present invention reserves calling
parameters to facilitate
4
Date Regue/Date Received 2022-09-23
CA 03176864 2022-09-23
providing custom parameters specific to practical use scenarios. With
different custom
parameters, some unusual types of requests can be handled, thereby expanding
its
application scope and satisfying use needs in more scenarios.
[0018] (4) Providing environment monitoring: the present invention allows
different data request
addresses to be configured for the development stage, the testing stage, and
online release
of the project, so as to automatically acquire data from the corresponding
data providing
party in practical use scenarios.
[0019] (5) Realizing error processing: the present invention provides an error
processing
mechanism, which processes error data as regulated by the rules, and reserves
use
scenarios where the error processing mechanism selectively performs error
callback
processing.
BRIEF DESCRIPTION OF THE DRAWINGS
[0020] To better illustrate the technical schemes as disclosed in the
embodiments of the present
invention, accompanying drawings referred in the description of the
embodiments below
are introduced briefly. It is apparent that the accompanying drawings as
recited in the
following description merely provide a part of possible embodiments of the
present
invention, and people of ordinary skill in the art would be able to obtain
more drawings
according to those provided herein without paying creative efforts, wherein:
[0021] FIG. 1 is a flowchart of a general-purpose processing method for data
exchange according
to Embodiment 1 of the present invention;
[0022] FIG. 2 is a flowchart of sub-steps of a step 104 in the method of
Embodiment 1; and
[0023] FIG. 3 is a structural diagram of a general-purpose processing
apparatus for data
exchange according to Embodiment 2 of the present invention.
DETAILED DESCRIPTION OF THE INVENTION
[0024] To make the foregoing objectives, features, and advantages of the
present invention
clearer and more understandable, the following description will be directed to
some
Date Regue/Date Received 2022-09-23
CA 03176864 2022-09-23
embodiments as depicted in the accompanying drawings to detail the technical
schemes
disclosed in these embodiments. It is, however, to be understood that the
embodiments
referred herein are only a part of all possible embodiments and thus not
exhaustive. Based
on the embodiments of the present invention, all the other embodiments can be
conceived
without creative labor by people of ordinary skill in the art, and all these
and other
embodiments shall be encompassed in the scope of the present invention. It is
to be noted
that, in the description of the present invention, "plural" or "multiple" when
used to
describe an object means there are more than two such objects, unless
otherwise specified
in the context.
[0025] The general-purpose processing method for data exchange and its
apparatus of the
embodiments of the present invention dynamically set parameters so as to
provide and
initialize custom parameters specific to a predetermined use scenario, so that
the use
scenario can, according to predetermined parameter rules, call the parameters,
thereby
effectively enhancing reusability of codes, efficiency, and consistency, while
realizing
functions like consistency of the method and its results for data exchange,
version control,
application expansion, environment monitoring, and error processing.
Therefore, the
general-purpose processing method for data exchange and its apparatus of the
embodiments of the present invention can be applied to various use scenarios
involving
data exchange.
[0026] The general-purpose processing method for data exchange and its
apparatus as disclosed
in the embodiments of the present invention will be explained in detail with
reference to
the accompanying drawings.
[0027] Embodiment 1
[0028] FIG. 1 is a flowchart of a general-purpose processing method for data
exchange according
to Embodiment 1 of the present invention. As shown, the present embodiment of
the
present invention provides a general-purpose processing method for data
exchange,
which comprising the steps described below.
[0029] The step 101 is about, according to predetermined rules for a data
exchange service,
setting up initialization data parameters for the data exchange service.
6
Date Regue/Date Received 2022-09-23
CA 03176864 2022-09-23
[0030] Specifically, the basic data exchange incoming parameters are set
according to agreed
rules of the data exchange service. Therein, the basic data exchange incoming
parameters
include data exchange basic addresses, local encrypted data for recognizing
user identities,
identifiers for recognizing user identities. The agreed rules of the data
exchange service
as used herein refer to predetermined rules for provision of the data exchange
service set
forth in regulations of the project data providing party or agreed between the
project front-
and back-ends for data exchange.
[0031] Exemplarily, according to the rules agreed between the project front-
and back-ends for
data exchange, information from a storage unit or a baseUrl (i.e., a data
exchange basic
address), a cookie (encrypted data stored locally for recognizing the user
identity), a token
(i.e., an identifier agreed by two sides of data exchange for recognizing user
identities),
basic data exchange incoming parameters are set. In the creation stage of the
project,
according to the agreed rules for the project data exchange service,
initialization of data
parameter setting up is performed. In practical use scenarios, a data request
can be
initiated simply by calling the data exchange service so as to obtain the data
feedback
result, thereby maintaining consistency of the method and its results for data
exchange.
[0032] It is to be noted that, in the step 101, initialization data parameters
for the data exchange
service according to the predetermined rules for the data exchange service can
be
implemented in a way different from that described above. The embodiment of
the present
invention puts no specific limitations thereto.
[0033] The step 102 involves calling the data exchange service for the current
use scenario
according to initialized data parameters.
[0034] Specifically, the use scenarios herein include the project development
stage, the testing
stage, and online release. For these scenarios, calling parameters are
reserved to facilitate
providing custom parameters specific to practical use scenarios. With
different custom
parameters, some unusual types of requests can be handled, thereby expanding
its
application scope and satisfying use needs in more scenarios
[0035] It is to be noted that, in the step 102, calling the data exchange
service for the current use
scenario according to the initialized data parameters can be implemented in a
way
7
Date Regue/Date Received 2022-09-23
CA 03176864 2022-09-23
different from that described above. The embodiment of the present invention
puts no
specific limitations thereto.
[0036] The step 103 is about, according to differentiation data parameters
corresponding to the
current use scenario, issuing a corresponding data request.
[0037] Specifically, the differentiation data parameters corresponding to the
current use scenario
are filled in, and the delivery parameters for data exchange required by the
current use
scenario are filled out.
[0038] Exemplarily, to call the data exchange service for the current use
scenario, according to
practical needs, the differentiation data parameters of the exact data
exchange url (i.e.,
the specific address information for data exchange) are filled in the api
(i.e., information
for identifying specific addresses that is agreed for the data exchange
service) parameters,
and the parameters to be transmitted in the current data exchange are filled
in params (i.e.,
identifiers for transmitting parameters agreed for the data exchange service),
so as to
accomplish the corresponding data request for the current data exchange.
[0039] Before the step of according to differentiation data parameters
corresponding to the
current use scenario, issuing a corresponding data request, the general-
purpose processing
method for data exchange of the embodiment of the present invention further
comprises:
[0040] setting up markers for the differentiation data parameters of the
specific address
information for data exchange required by the current use scenario, and
setting up
delivery parameter markers for data exchange required by the current use
scenario, and
initializing them into null objects.
[0041] Exemplarily, the differentiation data parameters of the url (i.e., the
specific address
information for data exchange) for project front- and back-ends data exchange
are
customized as api (i.e., information for identifying specific addresses that
is agreed for
the data exchange service). The input parameter params (i.e., identifiers for
transmitting
parameters agreed for the data exchange service) for the data exchange service
are set and
initialized into null objects.
[0042] It is to be noted that, in the 103, issuing the corresponding data
request according to
differentiation data parameters corresponding to the current use scenario can
be
8
Date Regue/Date Received 2022-09-23
CA 03176864 2022-09-23
implemented in a way different from that described above. The embodiment of
the present
invention puts no specific limitations thereto.
[0043] The step 104 is to perform data processing required by the current use
scenario according
to the data returned in response to the data request.
[0044] FIG. 2 is a flowchart of sub-steps of a step 104 in the method of
Embodiment 1.
[0045] Specifically, as shown in FIG. 2, it is to be determined whether the
data returned in
response to the data request are normal. If yes, logic processing
corresponding to normal
data is returned. Otherwise, it is to be further determined whether the
current use scenario
requires unusual processing. If unusual processing is required, unusual
processing logic
corresponding to such unusual processing is placed into the unusual callback.
[0046] Exemplarily, the returned data are monitored for error codes according
to the agreed rules
for data exchange between the proj ect front- and back-ends, and different
error processing
mechanisms are implemented depending on the error codes. Therein, use
scenarios are
reserved for selective error callback processing conducted by the error
processing
mechanisms. For normal, successful callback without any unusual data, a
response body
for data exchange is returned for the use scenario to use. In practical use
scenarios, normal
requests can be satisfied by writing the logic processing returned for the
normal data used
for this time into the successful callback of the disclosed apparatus. If a
practical use
scenario requires unusual processing such as resetting data for a data-
returning error, the
logic for error processing may be placed into the error callback. If there is
no unusual
processing, this step can be skipped. For different scenarios, the foregoing
process may
be repeated.
[0047] It is to be noted that, in the step 104, performing data processing
required by the current
use scenario according to data returned in response to the data request can be
implemented in a way different from that described above. The embodiment of
the present
invention puts no specific limitations thereto.
[0048] Embodiment 2
[0049] FIG. 3 is a structural diagram of a general-purpose processing
apparatus for data
exchange in Embodiment 2 of the present invention. As shown, the general-
purpose
9
Date Regue/Date Received 2022-09-23
CA 03176864 2022-09-23
processing apparatus for data exchange 2 of the embodiment of the present
invention
comprises: an initialization data parameter setting up module 21, a data
exchange service
calling module 22, a data request initiating module 23, and a data processing
module 24.
[0050] The initialization data parameter setting up module 21 is for according
to predetermined
rules for a data exchange service, setting up initialization data parameters
for the data
exchange service. Specifically, the initialization data parameter setting up
module 21 is
for according to agreed rules for the data exchange service, setting up basic
data exchange
incoming parameters, in which the basic data exchange incoming parameters
include data
exchange basic addresses, local encrypted data for recognizing user
identities, identifiers
for recognizing user identities.
[0051] The data exchange service calling module 22 is used to, for a current
use scenario,
according to the initialization data parameters, call the data exchange
service.
[0052] The data request initiating module 23 is for issuing the corresponding
data request
according to the differentiation data parameters corresponding to the current
use scenario.
Specifically, data request initiating module 23 is for filling in the
differentiation data
parameters corresponding to the current use scenario, and filling out the
delivery
parameters for data exchange required by the current use scenario. 8, in the
apparatus of
claim 6, the apparatus further comprises a differentiation setting up module
25, which is
for:
[0053] before the data request initiating module issues a corresponding data
request according
to differentiation data parameters corresponding to the current use scenario,
setting up
markers for the differentiation data parameters of the specific address
information for
data exchange required by the current use scenario, and setting up delivery
parameter
markers for data exchange required by the current use scenario, and
initializing them into
null objects.
[0054] The data processing module 24 is for performing data processing
according to the data
returned in response to the data request required by the current use scenario.
Specifically,
the data processing module 24 is for determining whether the data returned in
response
to the data request is normal, and if yes, returning logic processing
corresponding to the
Date Regue/Date Received 2022-09-23
CA 03176864 2022-09-23
normal data, or if no, further monitoring the current use scenario to see
whether unusual
processing is required, and if unusual processing is required, placing an
unusual
processing logic corresponding to the unusual processing into unusual
callback.
[0055] It is to be noted that work division among the foregoing functional
modules for the
general-purpose processing apparatus for data exchange of the present
embodiment to
trigger the general-purpose processing method for data exchange is merely
exemplary. In
practical implementations, the work division may be made among different
functional
modules. In other words, the internal architecture of the order-based phoning
system may
be reconfigured with different functional modules to perform all or a part of
the functions
as described previously. In addition, since general-purpose processing
apparatus for data
exchange of the present embodiment and the disclosed general-purpose
processing
method for data exchange in the previous embodiment stem from the same
conception,
the details of its implementation can be learned from the description made to
the method
of the previous embodiment, and no repetition is made herein.
[0056] All of the foregoing alternative technical scheme may be combined in an
arbitrary manner
to form an alternative embodiment of the present invention, and these possible
combinations are not exhaustively described herein.
[0057] To sum up, the general-purpose processing method for data exchange and
its apparatus
as disclosed in the embodiments of the present invention provide the following
beneficial
effects over the prior-art solutions:
[0058] (1) Providing consistency: in the project creation stage, the disclosed
apparatus is
initialized according to the regulations agreed with the data providing party.
In practical
use scenarios, data requests can be easily initiated by calling the data
exchange service
so as to obtain data feedback results, thereby realizing consistency of the
method and its
results for data exchange, and ensuring unified processing for input
parameters and
retuned data during data exchange between the front- and back-ends for
developing the
project. This in turn reduces repeated works for setting up and data
processing in practical
use scenarios. Use of unified packaging processing for input parameters and
returned data
during data exchange for the project simplifies development in terms of code,
step and
11
Date Regue/Date Received 2022-09-23
CA 03176864 2022-09-23
logic, and enhances reusability of project codes, consistency of operation,
centralization
of data exchange, and controllability of versions, leading to significantly
improved
development efficiency.
[0059] (2) Specific to version control: according to the prior-art data
exchange solutions, when
developing a system, the developer has to set up and process input parameters
and output
parameters separately for data exchange between the front- and back-ends
according to
the current use scenario. This is not only adverse to decoupling and reuse of
code
functions, but also makes it challenging to maintain consistency of the
project as a whole.
In other words, the prior-art solution is unable to provide unified processing
and unified
version control for data exchange. The present invention thus innovatively
introduces the
concept of version control, which makes it possible to call different versions
of data
according to practical use scenarios, thereby easily achieving version control
of data and
enabling data control adaptive to different scenarios and different
situations.
[0060] (3) Expanding applications: the present invention reserves calling
parameters to facilitate
providing custom parameters specific to practical use scenarios. With
different custom
parameters, some unusual types of requests can be handled, thereby expanding
its
application scope and satisfying use needs in more scenarios.
[0061] (4) Providing environment monitoring: the present invention allows
different data request
addresses to be configured for the development stage, the testing stage, and
online release
of the project, so as to automatically acquire data from the corresponding
data providing
party in practical use scenarios.
[0062] (5) Realizing error processing: the present invention provides an error
processing
mechanism, which processes error data as regulated by the rules, and reserves
use
scenarios where the error processing mechanism selectively performs error
callback
processing.
[0063] As will be appreciated by people of ordinary skill in the art,
implementation of all or a
part of the steps of the method of the present invention as described
previously may be
realized by having a program instruct related hardware components. The program
may
be stored in a computer-readable storage medium, and the program is about
performing
12
Date Regue/Date Received 2022-09-23
CA 03176864 2022-09-23
the individual steps of the methods described in the foregoing embodiments.
The storage
medium may be a ROM/RAM, a hard drive, an optical disk, or the like.
[0064] The embodiments of the present disclosure have been described with
reference to
flowcharts and/or block diagrams of the method, the system, and the computer
program
product. It is to be understood that every step and/or block in the flowcharts
and/or block
diagrams and every combination of steps and/or blocks in the flowcharts and/or
block
diagrams may be implemented by computer program instructions. These computer
program instructions may be provided to a general-purpose computer, an
application-
specific computer, an embedded processor, or a processor of other programable
data
processing devices to generate a machine, so that the instructions executed by
the
computer or the processor of other programable data processing devices can
generate an
apparatus that realizes the function as specified in one or more steps in a
flowchart or in
one or more blocks in a block diagram.
[0065] These computer program instructions may alternatively be stored in a
computer-readable
memory that can guide a computer or other programable data processing devices
to work
in a particular manner, so that the instructions stored in the computer-
readable memory
generates a produced object comprising the instruction apparatus. The
instruction
apparatus implements the functions as specified in one or more steps in a
flowchart or in
one or more blocks in a block diagram.
[0066] These computer program instructions may alternatively be loaded to a
computer or other
programmable data processing devices, so that a series of operational steps
can be
executed on the computer or the programable device, so as to generate computer-
enabled
processing, so that the instructions executed on the computer or the
programable device
provide the steps realizing the functions as specified in one or more steps in
a flowchart
or in one or more blocks in a block diagram.
[0067] Although the preferred embodiments of the present application have been
described,
people skilled in the art can make additional changes and modifications to
these
embodiments once the basic inventive concepts are known by them. Therefore,
the
appended claims are intended to be construed to include the preferred
embodiments and
13
Date Regue/Date Received 2022-09-23
CA 03176864 2022-09-23
all changes and modifications that fall within the scope of the embodiments of
this
application.
[0068] It is obvious that people skilled in the art might make various
modifications and variations
to the present invention without departing from the spirit and scope of the
present
invention. Provided that these modifications and variations of the present
invention fall
within the scope of the claims of the present invention and their equivalents,
the present
invention is intended to encompass all modifications and variations.
[0069] The preferred embodiments of the present invention described previously
are not intended
to limit the present invention. Any modification, equivalent replacement, and
improvement made under the spirit and principle of the present invention shall
be
included in the scope of the present invention. Anything contained in the
disclosure but
not detailed herein shall be regarded as technology known to people skilled in
the art.
14
Date Regue/Date Received 2022-09-23