CN115495484A - Data return method, device and medium - Google Patents

Data return method, device and medium Download PDF

Info

Publication number
CN115495484A
CN115495484A CN202211193887.1A CN202211193887A CN115495484A CN 115495484 A CN115495484 A CN 115495484A CN 202211193887 A CN202211193887 A CN 202211193887A CN 115495484 A CN115495484 A CN 115495484A
Authority
CN
China
Prior art keywords
data
field
target
target data
returned
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.)
Pending
Application number
CN202211193887.1A
Other languages
Chinese (zh)
Inventor
黄珊丽
杜晓松
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
CCB Finetech Co Ltd
Original Assignee
China Construction Bank Corp
CCB Finetech 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 China Construction Bank Corp, CCB Finetech Co Ltd filed Critical China Construction Bank Corp
Priority to CN202211193887.1A priority Critical patent/CN115495484A/en
Publication of CN115495484A publication Critical patent/CN115495484A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • G06F16/2455Query execution
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application relates to the field of data access, in particular to a method, a device and a medium for returning data, which are used for solving the problems that time and labor are wasted and the maintenance is difficult when an external system returns data. The method comprises the following steps: the method comprises the steps of responding to first data request information, determining a corresponding first system identification and a corresponding first request field, determining a first storage field corresponding to the first request field based on the corresponding relation between the pre-configured request field and the storage field, determining a target data configuration rule corresponding to the first system identification based on the corresponding relation between the pre-configured system identification and the data configuration rule, reading first target data from the first storage field, combining the first target data according to the target data configuration rule to obtain first target data to be returned and returning the first target data to an external system sending the first data request information, flexibly and quickly locking fields in a table, generating the data to be returned by combining the data configuration rule, reducing the workload of code development and reducing maintenance cost.

Description

Data return method, device and medium
Technical Field
The present application relates to the field of data access, and in particular, to a method, an apparatus, and a medium for data return.
Background
With the continuous expansion of international trade online services, more and more external systems need to be accessed into the international settlement system to conduct online trade, and return data is acquired from the international settlement system by request.
However, different external systems have different requirements for returning data, and the data configuration rules corresponding to different external systems are also different. In the existing processing process, return data needs to be directly obtained from each table stored in the international settlement system through codes, and when an external system changes or when a data configuration rule corresponding to the external system changes, the codes need to be modified line by line. Meanwhile, each time a different external system is accessed, a set of codes needs to be correspondingly added, the code development amount is extremely high, time and labor are wasted, and the maintenance is difficult.
Disclosure of Invention
The embodiment of the application provides a data return method, a data return device and a data return medium, which are used for solving the problems that time and labor are wasted and maintenance is difficult in the data return process of an external system.
In a first aspect, a method for data return includes:
responding to the received first data request information, and determining a first system identifier and a first request field corresponding to the first data request information;
determining at least one first storage field corresponding to the first request field in the target table based on the corresponding relation between the pre-configured request field and the storage field;
determining a target data configuration rule corresponding to the first system identifier based on the corresponding relation between the pre-configured system identifier and the data configuration rule;
and reading the first target data from at least one first storage field, combining the first target data according to a target data configuration rule to obtain first target data to be returned, and returning the first target data to be returned to the external system sending the first data request information.
In the embodiment of the application, a first system identifier and a first request field corresponding to first data request information are determined in response to the received first data request information, at least one first storage field corresponding to the first request field in a target table is determined based on the corresponding relation between the pre-configured request field and the storage field, a target data configuration rule corresponding to the first system identifier is determined based on the corresponding relation between the pre-configured system identifier and the data configuration rule, first target data are read from the at least one first storage field and combined according to the target data configuration rule to obtain first target data to be returned, the first target data to be returned are returned to an external system sending the first data request information, the stored fields in the data table can be locked flexibly and quickly through the method, the data to be returned are generated by combining with the corresponding data configuration rule, the workload of code development is reduced, and the maintenance cost is reduced.
In a possible embodiment, after determining, in response to the received first data request information, a first system identifier and a first request field corresponding to the first data request information, the method further includes:
responding to the received second data request information, and determining a second system identifier and a second request field corresponding to the second data request information;
if the second system identification is the same as the first system identification, determining second target data based on the second request field, and obtaining new first target data to be returned based on the first target data to be returned and the second target data;
and if the second system identification is different from the first system identification, determining the data to be returned of the second target based on the second request field, and returning the data to be returned of the second target to the external system sending the second data request information.
In one possible embodiment, determining the second target data based on the second request field, and obtaining new first target data to be returned based on the first target data to be returned and the second target data, includes:
determining at least one second storage field corresponding to the second request field in the target table based on the corresponding relation between the pre-configured request field and the storage field;
reading second target data from at least one second storage field;
combining the second target data according to a target data configuration rule to obtain alternative target data to be returned; and
and splicing the data to be returned of the first target and the data to be returned of the alternative target to obtain new data to be returned of the first target.
In a possible embodiment, if the second system identifier is different from the first system identifier, determining the second target data to be returned based on the second request field includes:
determining a second target data configuration rule corresponding to the second system identifier based on the corresponding relation between the pre-configured system identifier and the data configuration rule;
determining at least one second target storage field corresponding to the second request field in the target table based on the corresponding relation between the pre-configured request field and the storage field;
and reading second target storage data from at least one second target storage field, and combining the second target storage data according to a second target data configuration rule to obtain second target data to be returned.
In one possible embodiment, the correspondence between the request field and the storage field is preconfigured by:
associating preset bitmap fields with preset request fields, wherein each bitmap field comprises a completed status bit or an uncompleted status bit;
obtaining each table stored in a database and a storage field in each table;
and establishing a corresponding relation between the request field and each storage field.
In a possible embodiment, before returning the first target data to be returned to the external system sending the first data request information, the method further includes:
determining a bitmap field corresponding to the data to be returned of the first target, and acquiring a status bit included by the bitmap field;
if the status bit is the completed status bit, returning the first target data to be returned to the external system sending the first data request information;
and if the status bit is an incomplete status bit, re-acquiring the status bit included by the bitmap field according to a preset interval.
In a second aspect, the present application provides an apparatus for returning data, the apparatus comprising:
the response unit is used for responding to the received first data request information and determining a first system identifier and a first request field corresponding to the first data request information;
the field determining unit is used for determining at least one first storage field corresponding to the first request field in the target table based on the corresponding relation between the pre-configured request field and the storage field;
the rule determining unit is used for determining a target data configuration rule corresponding to the first system identifier based on the corresponding relation between the pre-configured system identifier and the data configuration rule;
and the return unit is used for reading the first target data from the at least one first storage field, combining the first target data according to the target data configuration rule to obtain first target data to be returned, and returning the first target data to be returned to the external system sending the first data request information.
In a possible embodiment, after determining, in response to the received first data request information, a first system identifier and a first request field corresponding to the first data request information, the apparatus further includes:
responding to the received second data request information, and determining a second system identifier and a second request field corresponding to the second data request information;
if the second system identification is the same as the first system identification, determining second target data based on the second request field, and obtaining new first target data to be returned based on the first target data to be returned and the second target data;
and if the second system identification is different from the first system identification, determining the data to be returned of the second target based on the second request field, and returning the data to be returned of the second target to the external system sending the second data request information.
In a possible embodiment, the second target data is determined based on the second request field, and new first target data to be returned is obtained based on the first target data to be returned and the second target data, and the apparatus includes:
determining at least one second storage field corresponding to the second request field in the target table based on the corresponding relation between the pre-configured request field and the storage field;
reading second target data from at least one second storage field;
combining the second target data according to a target data configuration rule to obtain alternative target data to be returned; and
and splicing the data to be returned of the first target and the data to be returned of the alternative target to obtain new data to be returned of the first target.
In a possible embodiment, if the second system identifier is different from the first system identifier, determining that the second target data to be returned is based on the second request field, the apparatus includes:
determining a second target data configuration rule corresponding to the second system identifier based on the corresponding relation between the pre-configured system identifier and the data configuration rule;
determining at least one second target storage field corresponding to the second request field in the target table based on the corresponding relation between the pre-configured request field and the storage field;
and reading second target storage data from at least one second target storage field, and combining the second target storage data according to a second target data configuration rule to obtain second target data to be returned.
In one possible embodiment, the correspondence between the request field and the storage field is preconfigured by:
associating preset bitmap fields with preset request fields, wherein each bitmap field comprises a completed status bit or an uncompleted status bit;
obtaining each table stored in a database and a storage field in each table;
and establishing a corresponding relation between the request field and each storage field.
In a possible embodiment, before returning the first target data to be returned to the external system sending the first data request information, the apparatus further includes:
determining a bitmap field corresponding to the data to be returned of the first target, and acquiring a status bit included in the bitmap field;
if the status bit is the completed status bit, returning the first target data to be returned to the external system sending the first data request information;
and if the status bit is an incomplete status bit, re-acquiring the status bit included by the bitmap field according to a preset interval.
In a third aspect, the present application provides an electronic device, comprising:
a memory for storing program instructions;
a processor for calling the program instructions stored in the memory and executing the steps comprised in the method of any one of the first aspect according to the obtained program instructions.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program comprising program instructions which, when executed by a computer, cause the computer to perform the method of any one of the first aspects.
In a fifth aspect, the present application provides a computer program product comprising: computer program code which, when run on a computer, causes the computer to perform the method of any of the first aspects.
Drawings
Fig. 1 is a schematic view of a usage scenario of data return according to an embodiment of the present application;
fig. 2 is a flowchart of a method for returning data according to an embodiment of the present application;
fig. 3 is a flowchart for responding to and processing second data request information according to an embodiment of the present application;
fig. 4 is a flowchart for obtaining new data to be returned by the first target based on the data to be returned by the first target and the second target data according to the embodiment of the present application;
fig. 5 is a flowchart illustrating determining to-be-returned data of a second target based on a second request field according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of an apparatus for returning data according to an embodiment of the present application;
fig. 7 is a block diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more clearly understood, the technical solutions in the embodiments of the present application will be described below clearly and completely with reference to the accompanying drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application. In the present application, the embodiments and features of the embodiments may be arbitrarily combined with each other without conflict. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
The terms "first" and "second" in the description and claims of the present application and the above-described drawings are used for distinguishing between different objects and not for describing a particular order. Furthermore, the term "comprises" and any variations thereof, which are intended to cover non-exclusive protection. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements listed, but may alternatively include other steps or elements not listed, or inherent to such process, method, article, or apparatus. The "plurality" in the present application may mean at least two, for example, two, three or more, and the embodiments of the present application are not limited.
In the technical scheme, the data acquisition, transmission, use and the like all meet the requirements of relevant national laws and regulations.
Before describing a method for returning data provided by the embodiment of the present application, for ease of understanding, the following detailed description is first made on the technical background of the embodiment of the present application.
When the external system accesses the international settlement system and requests to acquire the return data from the international settlement system, because the requirements of different external systems on the return data are different, and the data configuration rules corresponding to different external systems are also different. In the existing processing process, return data needs to be directly obtained from each table stored in the international settlement system through codes, and when an external system changes or when a data configuration rule corresponding to the external system changes, the codes need to be modified line by line. Meanwhile, each time a different external system is accessed, a set of codes needs to be correspondingly added, the code development amount is extremely high, time and labor are wasted, and the maintenance is difficult.
In order to solve the above-mentioned problem that the external system is time-consuming, labor-consuming and difficult to maintain, a preferred embodiment of the present application will be described in detail below with reference to the accompanying drawings.
Referring to fig. 1, in the embodiment of the present application, an external system (e.g., an external platform a, an external platform B \8230, or an external platform N) sends data request information to a server (e.g., a server of the international settlement system 1), and the server processes the data request information and returns target data to be returned to the external system.
It should be noted that, in the embodiment of the present application, a plurality of external systems may be provided, and the execution subject is a server, and in the implementation process, the server can process data request information sent by one or a plurality of external systems respectively, which is described in detail below.
Referring to fig. 2, in the embodiment of the present application, a specific flow of a data return method is as follows:
step 201: and responding to the received first data request information, and determining a first system identifier and a first request field corresponding to the first data request information.
In the implementation process, the external system sending the first data request information is specifically described as an example, and after the external system sends the first data request information to the server, the server receives and responds to the first data request information, specifically, analyzes the first data request information, and the like, so as to determine a first system identifier and a first request field corresponding to the first data request information.
For example, the first data request information is xxxxxx, it is determined that the first system identifier corresponding to the first data request information is aa, and the first request field is a name.
Step 202: and determining at least one first storage field corresponding to the first request field in the target table based on the corresponding relation between the pre-configured request field and the storage field.
The process of establishing the correspondence between the request field and the storage field is described first, that is, the correspondence between the request field and the storage field is configured in advance in the following manner:
(1) Associating preset bitmap fields with preset request fields, wherein each bitmap field comprises a completed status bit or an incomplete status bit.
In order to distinguish the external systems and monitor the operating states of different external systems, in the implementation process of the present application, a bitmap field is preset, for example, a bitmap field with a length of 10 bits is set, each bitmap field is used to represent one external system, and usually, the external system is characterized by a system identifier, and if the 0 th bitmap field represents the external system aa, the 0 th bitmap field is written into the system identifier aa of the external system aa, the 1 st bitmap field represents the external system bb, the 1 st bitmap field is written into the system identifier bb of the external system bb, and so on.
In order to uniformly identify the request fields requested by different external systems, in the embodiment of the present application, the request fields are preset, for example, the request field "name" of the external system aa and the request field "name" of the external system bb are uniformly associated with the request field name, so that when the external system aa requests the field "name" and the external system bb requests the field "name", the same called data can be sent to the external system aa and the external system bb, respectively, after calling the name fields in the corresponding stored tables.
In addition, considering that the amount of data involved in the number return processing is huge, a batch processing mode is often adopted to process the data of the completed service uniformly, for example, after the settlement service 1 is completed, a corresponding status bit is set in a bitmap field to be in a completed status, and in this case, the target data corresponding to the data request information can be returned to the external system; and when the corresponding status bit is set in the bitmap field to be in an incomplete status, the corresponding target data is not allowed to be returned to the external system.
(2) And acquiring each table stored in the database and a storage field in each table.
After the request field is configured, further acquiring each table stored in a database connected with the server, for example, a settlement service sublist, a settlement service summary table, etc., and acquiring the value of the storage field in each table due to at least one storage field stored in different tables, wherein the value is the target data to be returned to the external system.
(3) And establishing a corresponding relation between the request field and each storage field.
In the implementation process, after the request field and the storage field are determined, the request field needs to be in one-to-one correspondence with each storage field, for example, the request field "name" of the external system aa and the request field "name" of the external system bb are both in correspondence with the storage field name, the request field "age" of the external system aa and the request field "age" of the external system bb are both in correspondence with the storage field age, and so on, and the correspondence between the request field and each storage field is established.
Step 203: and determining a target data configuration rule corresponding to the first system identifier based on the corresponding relation between the pre-configured system identifier and the data configuration rule.
Considering that the data configuration rules corresponding to different external systems are different, for example, the data configuration rule of the external system aa is XXX, the data configuration rule of the external system bb is YYY, in order to quickly return the target data to be returned to the external system, the system identifier and the data configuration rule are in one-to-one correspondence in advance, that is, after the data configuration rule XXX of the external system aa is obtained, the data configuration rule XXX is corresponding to the system identifier aa of the external system aa, after the data configuration rule yyyy of the external system bb is obtained, the data configuration rule YYY is corresponding to the system identifier bb of the external system bb, and so on, the correspondence between the system identifier and the data configuration rule is established in advance.
In the implementation process, after the first system identifier is determined according to the first data request information, the target data configuration rule corresponding to the first system identifier is further determined according to the corresponding relationship between the system identifier and the data configuration rule.
Step 204: and reading first target data from at least one first storage field, combining the first target data according to a target data configuration rule to obtain first target data to be returned, and returning the first target data to be returned to the external system sending the first data request information.
In the implementation process, after at least one first storage field corresponding to a first request field in a target table is determined, first target data in the stored target table is read according to the at least one first storage field, for example, when the first storage field is a name, the first target data is read as Zhang III; when the first storage field is age, the first target data is read to be 25 years old, and the target data is configured to return after the age is put in the name. In the implementation process, the first target data is combined according to the target data configuration rule, that is, the data to be returned of the first target is 'zhangsan 25 years old', and further, the data to be returned of the first target is 'zhangsan 25 years old' and is returned to the external system sending the first data request information.
It should be added that, before returning the data to be returned from the first target to the external system that sends the first data request information, the method further includes:
1) And determining a bitmap field corresponding to the data to be returned of the first target, and acquiring a status bit included by the bitmap field.
In order to ensure the integrity of the target data to be returned, in the implementation process, after the first target data to be returned is determined, the bitmap field corresponding to the first target data to be returned is further determined, and the included status bit is obtained from the bitmap field.
2) And if the status bit is the completed status bit, returning the first target data to be returned to the external system sending the first data request information.
In the first case: when the status bit in the bitmap field is the completed status bit, it indicates that the corresponding first target data to be returned is complete data after the service is completed, and when the first target data to be returned is a data set, it indicates that each data in the whole data set is complete data, and in this case, the first target data to be returned is returned to the external system that sends the first data request information.
3) And if the status bit is an incomplete status bit, re-acquiring the status bit included by the bitmap field according to a preset interval.
In the second case: when the status bit in the bitmap field is an incomplete status bit, it indicates that the corresponding first target data to be returned is not complete data after the service has been completed, and when the first target data to be returned is a data set, it indicates that all data in the entire data set are not complete data, under this condition, the first target data to be returned is not allowed to be returned to the external system sending the first data request information, and the status bit included in the bitmap field is correspondingly re-acquired at a preset interval (for example, 2 minutes) until the status bit is the completed status bit.
It should be added that, after determining the first system identifier and the first request field corresponding to the first data request information in response to the received first data request information, as shown in fig. 3, the method further includes:
step 301: and responding to the received second data request information, and determining a second system identification and a second request field corresponding to the second data request information.
In the implementation process, after receiving the second data request information, the same external system responds to the second data request information, and further determines a second system identifier and a second request field corresponding to the second data request information. The determination process here is similar to that of the first system identifier and the first request field, and is not described here again.
Step 302: and if the second system identification is the same as the first system identification, determining second target data based on the second request field, and obtaining new first target data to be returned based on the first target data to be returned and the second target data.
In the implementation process, if the second system identifier is the same as the first system identifier, it indicates that the external system sending the second data request information and the external system sending the first data request information are the same external system.
Determining second target data based on the second request field, and obtaining new data to be returned to the first target based on the data to be returned to the first target and the second target data, as shown in fig. 4, specifically including:
step 3021: and determining at least one second storage field corresponding to the second request field in the target table based on the corresponding relation between the pre-configured request field and the storage field.
Similarly, after the second request field is determined, at least one second storage field corresponding to the second request field in the target table is determined according to the correspondence between the preconfigured request field and the storage field, for example, the second request field corresponding to the second data request message sent by the external system aa is native, and the at least one second storage field corresponding to the second request field in the target table is determined as a native according to the correspondence between the preconfigured request field and the storage field.
Step 3022: the second target data is read from the at least one second storage field.
After determining at least one second storage field, reading second target data from the second storage field. For example, the location of the corresponding second storage field in the target table is north river, that is, the second target data is assigned to be north river.
Step 3023: combining the second target data according to a target data configuration rule to obtain alternative target data to be returned; and
the external system sending the second data request information and the external system sending the first data request information are the same external system, so that the target data configuration rule is the target data configuration rule corresponding to the first data request information, and in the implementation process, the second target data are combined according to the target data configuration rule to obtain the alternative target to-be-returned data.
It should be noted that, in general, the target data configuration rule includes data configuration rules corresponding to all request fields, and after the first target data or the second target data is obtained, the configuration item corresponding to the first target data is searched in the target data configuration rule, and the configuration item corresponding to the second target data is searched.
Step 3024: and splicing the data to be returned of the first target and the data to be returned of the alternative target to obtain new data to be returned of the first target.
After the data to be returned of the first target and the data to be returned of the alternative target are obtained, the data to be returned of the first target and the data to be returned of the alternative target are spliced, and a specific splicing mode can refer to a target data configuration rule, so that new data to be returned of the first target is obtained. By the method for splicing the original first target data to be returned to obtain the new first target data to be returned, the target data to be returned corresponding to the second data request information can be quickly and accurately returned to the external system.
Step 303: and if the second system identification is different from the first system identification, determining the data to be returned of the second target based on the second request field, and returning the data to be returned of the second target to the external system sending the second data request information.
In the implementation process, if the second system identifier is different from the first system identifier, it indicates that the external system sending the second data request information is not the same external system as the external system sending the first data request information.
If the second system identifier is different from the first system identifier, determining, based on the second request field, that the second target is to-be-returned data, referring to fig. 5, including:
step 3031: and determining a second target data configuration rule corresponding to the second system identifier based on the corresponding relation between the pre-configured system identifier and the data configuration rule.
Since the external system that issues the second data request message is not the same external system as the external system that issues the first data request message, the target data configuration rules may be different accordingly. In the implementation process, a second target data configuration rule corresponding to the second system identifier is determined according to the corresponding relation between the pre-configured system identifier and the data configuration rule. The obtaining process is similar to the first target data configuration rule and is not repeated one by one.
Step 3032: and determining at least one second target storage field corresponding to the second request field in the target table based on the corresponding relation between the pre-configured request field and the storage field.
After the second request field is determined, at least one second storage field corresponding to the second request field in the target table is determined according to the corresponding relationship between the preconfigured request field and the storage field, for example, the second request field corresponding to the second data request message sent by the external system bb is a gender, and at least one second storage field corresponding to the gender of the second request field in the target table is determined according to the corresponding relationship between the preconfigured request field and the storage field.
Step 3033: and reading second target storage data from at least one second target storage field, and combining the second target storage data according to a second target data configuration rule to obtain second target data to be returned.
And reading the second target data from the second storage field after determining that at least one second storage field is gender. For example, the corresponding second stored field in the destination table is gender male, i.e., the second destination data is assigned a gender of male.
After the data to be returned of the second target is obtained, the data to be returned of the second target is returned to the external system sending the second data request information.
Based on the same inventive concept, an embodiment of the present application provides a data returning apparatus, which, referring to fig. 6, includes:
a response unit 601, configured to determine, in response to the received first data request information, a first system identifier and a first request field corresponding to the first data request information;
a field determining unit 602, configured to determine, based on a pre-configured correspondence relationship between request fields and storage fields, at least one first storage field corresponding to a first request field in a target table;
a rule determining unit 603, configured to determine, based on a correspondence between a preconfigured system identifier and a data configuration rule, a target data configuration rule corresponding to the first system identifier;
a returning unit 604, configured to read the first target data from the at least one first storage field, combine the first target data according to a target data configuration rule to obtain first target data to be returned, and return the first target data to be returned to the external system that sends the first data request information.
In a possible embodiment, after determining, in response to the received first data request information, a first system identifier and a first request field corresponding to the first data request information, the method further includes:
responding to the received second data request information, and determining a second system identifier and a second request field corresponding to the second data request information;
if the second system identification is the same as the first system identification, determining second target data based on the second request field, and obtaining new first target data to be returned based on the first target data to be returned and the second target data;
and if the second system identification is different from the first system identification, determining the data to be returned of the second target based on the second request field, and returning the data to be returned of the second target to the external system sending the second data request information.
In one possible embodiment, determining the second target data based on the second request field, and obtaining new first target data to be returned based on the first target data to be returned and the second target data, includes:
determining at least one second storage field corresponding to the second request field in the target table based on the corresponding relation between the pre-configured request field and the storage field;
reading second target data from at least one second storage field;
combining the second target data according to a target data configuration rule to obtain alternative target data to be returned; and
and splicing the data to be returned of the first target and the data to be returned of the alternative target to obtain new data to be returned of the first target.
In a possible embodiment, if the second system identifier is different from the first system identifier, determining the second target data to be returned based on the second request field includes:
determining a second target data configuration rule corresponding to the second system identifier based on the corresponding relation between the pre-configured system identifier and the data configuration rule;
determining at least one second target storage field corresponding to the second request field in the target table based on the corresponding relation between the pre-configured request field and the storage field;
and reading second target storage data from at least one second target storage field, and combining the second target storage data according to a second target data configuration rule to obtain second target data to be returned.
In one possible embodiment, the correspondence between the request field and the storage field is preconfigured by:
associating preset bitmap fields with preset request fields, wherein each bitmap field comprises a completed status bit or an uncompleted status bit;
obtaining each table stored in a database and a storage field in each table;
and establishing a corresponding relation between the request field and each storage field.
In a possible embodiment, before returning the first target data to be returned to the external system sending the first data request information, the method further includes:
determining a bitmap field corresponding to the data to be returned of the first target, and acquiring a status bit included in the bitmap field;
if the status bit is a completed status bit, returning the first target data to be returned to the external system sending the first data request information;
and if the status bit is an incomplete status bit, re-acquiring the status bit included by the bitmap field according to a preset interval.
Based on the same inventive concept, embodiments of the present application provide an electronic device, which may implement the functions of data return discussed in the foregoing, and referring to fig. 7, the device includes a processor 701 and a memory 702, where the memory 702 stores program codes, and when the program codes are executed by the processor, the processor 701 executes the steps in the method for data return according to various exemplary embodiments of the present application described above in this specification.
Based on the same inventive concept, an embodiment of the present application provides a computer-readable storage medium, and a computer program product includes: computer program code which, when run on a computer, causes the computer to perform any of the methods of data return discussed above. Since the principle of solving the problem of the computer-readable storage medium is similar to the method for returning data, the implementation of the computer-readable storage medium may refer to the implementation of the method, and repeated details are not described herein.
Based on the same inventive concept, the embodiment of the present application further provides a computer program product, which includes: computer program code which, when run on a computer, causes the computer to perform any of the methods of data return discussed above. Because the principle of solving the problems of the computer program product is similar to the method of returning data, the implementation of the computer program product can refer to the implementation of the method, and repeated details are not repeated.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application 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 so forth) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to the application. 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 user-operated 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.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (10)

1. A method for returning data is applied to a server and comprises the following steps:
responding to received first data request information, and determining a first system identifier and a first request field corresponding to the first data request information;
determining at least one first storage field corresponding to the first request field in a target table based on a corresponding relation between a pre-configured request field and a storage field;
determining a target data configuration rule corresponding to the first system identifier based on a corresponding relation between a pre-configured system identifier and a data configuration rule;
and reading first target data from at least one first storage field, combining the first target data according to the target data configuration rule to obtain first target data to be returned, and returning the first target data to be returned to an external system sending the first data request information.
2. The method of claim 1, wherein after determining the first system identifier and the first request field corresponding to the first data request information in response to the received first data request information, further comprising:
responding to the received second data request information, and determining a second system identifier and a second request field corresponding to the second data request information;
if the second system identification is the same as the first system identification, determining second target data based on the second request field, and obtaining new first target data to be returned based on the first target data to be returned and the second target data;
and if the second system identification is different from the first system identification, determining second target data to be returned based on the second request field, and returning the second target data to be returned to an external system sending the second data request information.
3. The method of claim 2, wherein the determining second target data based on the second request field and deriving new first target data to be returned based on the first target data to be returned and the second target data comprises:
determining at least one second storage field corresponding to the second request field in a target table based on a corresponding relation between a pre-configured request field and a storage field;
reading second target data from at least one of the second storage fields;
combining the second target data according to the target data configuration rule to obtain alternative target data to be returned; and
and splicing the data to be returned of the first target and the data to be returned of the alternative target to obtain the new data to be returned of the first target.
4. The method of claim 2, wherein determining a second target data to return based on the second request field if the second system identification is different from the first system identification comprises:
determining a second target data configuration rule corresponding to the second system identifier based on a corresponding relation between a pre-configured system identifier and a data configuration rule;
determining at least one second target storage field corresponding to the second request field in a target table based on a corresponding relation between a pre-configured request field and a storage field;
and reading second target storage data from at least one second target storage field, and combining the second target storage data according to a second target data configuration rule to obtain second target data to be returned.
5. The method of any one of claims 1-4, wherein the correspondence of request fields to storage fields is preconfigured by:
associating preset bitmap fields with preset request fields, wherein each bitmap field comprises a completed status bit or an uncompleted status bit;
obtaining each table stored in a database and a storage field in each table;
and establishing a corresponding relation between the request field and each storage field.
6. The method of claim 5, wherein before returning the first target data to be returned to the external system that sent the first data request message, further comprising:
determining the bitmap field corresponding to the first target data to be returned, and acquiring a status bit included in the bitmap field;
if the status bit is a completed status bit, returning the first target data to be returned to an external system sending the first data request information;
and if the status bit is an incomplete status bit, re-acquiring the status bit included by the bitmap field according to a preset interval.
7. An apparatus for data return, comprising:
the response unit is used for responding to the received first data request information and determining a first system identifier and a first request field corresponding to the first data request information;
the field determining unit is used for determining at least one first storage field corresponding to the first request field in a target table based on the corresponding relation between the pre-configured request field and the storage field;
the rule determining unit is used for determining a target data configuration rule corresponding to the first system identifier based on the corresponding relation between the pre-configured system identifier and the data configuration rule;
and the return unit is used for reading first target data from at least one first storage field, combining the first target data according to the target data configuration rule to obtain first target data to be returned, and returning the first target data to be returned to the external system sending the first data request information.
8. An electronic device, comprising:
a memory for storing program instructions;
a processor for calling program instructions stored in said memory and for executing the steps comprised in the method of any one of claims 1 to 6 in accordance with the obtained program instructions.
9. A computer-readable storage medium, characterized in that it stores a computer program comprising program instructions which, when executed by a computer, cause the computer to carry out the method according to any one of claims 1-6.
10. A computer program product, the computer program product comprising: computer program code which, when run on a computer, causes the computer to perform the method according to any of the preceding claims 1-6.
CN202211193887.1A 2022-09-28 2022-09-28 Data return method, device and medium Pending CN115495484A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211193887.1A CN115495484A (en) 2022-09-28 2022-09-28 Data return method, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211193887.1A CN115495484A (en) 2022-09-28 2022-09-28 Data return method, device and medium

Publications (1)

Publication Number Publication Date
CN115495484A true CN115495484A (en) 2022-12-20

Family

ID=84473120

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211193887.1A Pending CN115495484A (en) 2022-09-28 2022-09-28 Data return method, device and medium

Country Status (1)

Country Link
CN (1) CN115495484A (en)

Similar Documents

Publication Publication Date Title
CN107633016B (en) Data processing method and device and electronic equipment
CN104134109A (en) Engineering configuration method and engineering configuration system integrating version management
CN111897826A (en) Parameter information updating method and device, electronic equipment and readable storage medium
CN114911522A (en) Software version release system, method, device and readable storage medium
CN113032263A (en) Case test processing method and device, server and readable storage medium
CN115495484A (en) Data return method, device and medium
CN114549137A (en) Request processing method and device
CN110955597B (en) Object testing method and device, electronic equipment and computer readable storage medium
CN111324368B (en) Data sharing method and server
CN113704123A (en) Interface test method, device, equipment and storage medium
CN111221847B (en) Monitoring data storage method, device and computer readable storage medium
CN113495723A (en) Method and device for calling functional component and storage medium
CN111159988A (en) Model processing method and device, computer equipment and storage medium
CN113868218A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN112580307A (en) Multi-data source access method, device, system and readable storage medium
CN111625866A (en) Authority management method, system, equipment and storage medium
CN112783954A (en) Data access method and device and server
CN117041356B (en) Index distribution method, index calculation method, apparatus, electronic device and system
CN112532750B (en) Big data push processing method and system and cloud platform
CN117313856B (en) Reliability test planning system and method
CN114900531B (en) Data synchronization method, device and system
CN110032569B (en) Method, device, equipment and system for checking changed data
CN115933979A (en) Service data processing method, device, equipment and medium
CN115422073A (en) mock service processing method, device, equipment and storage medium
CN118467526A (en) Data code generation method, terminal 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