CN113190576A - Data processing method and device, computer equipment and readable storage medium - Google Patents

Data processing method and device, computer equipment and readable storage medium Download PDF

Info

Publication number
CN113190576A
CN113190576A CN202110607450.7A CN202110607450A CN113190576A CN 113190576 A CN113190576 A CN 113190576A CN 202110607450 A CN202110607450 A CN 202110607450A CN 113190576 A CN113190576 A CN 113190576A
Authority
CN
China
Prior art keywords
data processing
storage medium
preset
index
indexes
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
CN202110607450.7A
Other languages
Chinese (zh)
Inventor
王贺宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jingdong Technology Holding Co Ltd
Original Assignee
Jingdong Technology Holding 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 Jingdong Technology Holding Co Ltd filed Critical Jingdong Technology Holding Co Ltd
Priority to CN202110607450.7A priority Critical patent/CN113190576A/en
Publication of CN113190576A publication Critical patent/CN113190576A/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
    • 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/28Databases characterised by their database models, e.g. relational or object models
    • G06F16/284Relational databases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/03Credit; Loans; Processing thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Development Economics (AREA)
  • General Business, Economics & Management (AREA)
  • Technology Law (AREA)
  • Strategic Management (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application provides a data processing method, a data processing device, a computer device and a readable storage medium, wherein the method comprises the following steps: responding to a data call request sent by a client, acquiring a preset context from a storage medium, inquiring from the storage medium to obtain a value corresponding to an index required by data processing, and processing a parameter required by the data processing and the value corresponding to the index required by the data processing according to a data processing method to obtain a data processing result. According to the technical scheme, the parameters, the indexes and the data processing method required in the data processing process are stored in the storage medium in advance, when the data processing is required, the parameters, the indexes and the data processing method required by the data processing can be directly called from the storage medium to process the data, the program codes are prevented from being executed to complete the data processing, when the system service is changed, the program codes do not need to be rewritten, and the cost input of research and development personnel is reduced.

Description

Data processing method and device, computer equipment and readable storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data processing method and apparatus, a computer device, and a readable storage medium.
Background
In the process of operating various systems, a large amount of data processing procedures are involved, for example, in the process of using a business system, four arithmetic operations relating to various data are required, and in order to enable the system to autonomously complete the data processing, a developer generally writes a computer programming language to guide the system to complete the data processing procedures.
In the prior art, a developer generally writes a corresponding data processing method directly in a computer programming language, and after a system reads the data processing method from the computer programming language, the system directly uses the data processing method to perform corresponding processing on data.
However, in the prior art, when a service of a system changes, a data processing method originally written into a computer program language cannot adapt to a newly generated service any more, at this time, research and development personnel need to rewrite a program code to adapt to the new service, and the written program code needs to be compiled again, released, deployed, restarted and other series of processes, so that the whole process is complicated, and the research and development personnel need to invest a large amount of labor cost.
Disclosure of Invention
The application provides a data processing method, a data processing device, computer equipment and a readable storage medium, which are used for solving the problem of low data processing efficiency of the existing system.
In a first aspect, an embodiment of the present application provides a data processing method, including:
responding to a data call request sent by a client, and acquiring a preset context from a storage medium, wherein the preset context comprises parameters required by data processing, indexes required by the data processing and a data processing method;
inquiring from the storage medium to obtain a value corresponding to the index required by the data processing according to the preset context;
and processing the parameters required by the data processing and the values corresponding to the indexes required by the data processing according to the data processing method to obtain a data processing result.
In a possible design of the first aspect, the querying, according to the preset context, from the storage medium to obtain a value corresponding to the index required for data processing includes:
extracting necessary parameters from the parameters required by the data processing of the preset context;
determining the query range of the indexes required by the data processing according to the necessary parameters;
and inquiring from the storage medium to obtain a value corresponding to the index required by data processing in the inquiry range according to the inquiry range and a preset processing method.
In another possible design of the first aspect, the obtaining, according to the query range and a preset processing method, a value corresponding to an index required for data processing in the query range by querying from the storage medium includes:
distributing the index required by data processing into at least two sub-indexes;
and acquiring a preset processing method corresponding to each sub-index, and inquiring from the storage medium to obtain a value corresponding to each sub-index in the inquiry range according to the preset processing method corresponding to each sub-index.
In yet another possible design of the first aspect, the obtaining, according to the preset processing method corresponding to each sub-indicator, a value corresponding to each sub-indicator in the query range from the storage medium by querying, includes:
acquiring the total number of the sub-indexes, and establishing query threads with the number corresponding to the total number of the sub-indexes;
and concurrently executing the query thread, wherein the query thread is used for querying and obtaining the value corresponding to each sub-index in the query range from the storage medium according to the preset processing method corresponding to each sub-index when being executed.
In another possible design of the first aspect, after obtaining, according to the preset context, a value corresponding to the index required for data processing by querying from the storage medium, the method further includes:
and writing the value corresponding to the index required by the data processing into the preset context.
In another possible design of the first aspect, the processing the parameter required for data processing and the value corresponding to the index required for data processing according to the data processing method to obtain the data processing result includes:
inputting the parameters required by data processing and the values corresponding to the indexes required by the data processing into the preset calculation formula;
and calculating by using the preset calculation formula to obtain a data processing result.
In another possible design of the first aspect, after obtaining the data processing result, the method further includes:
writing the data processing result into the preset context to obtain a target context;
and feeding back the target context to the client.
In another possible design of the first aspect, the obtaining, by querying from the storage medium according to the preset context, a value corresponding to the index required for data processing includes:
checking parameters required by data processing in the preset context, and determining whether the parameters required by the data processing comprise preset parameters;
if so, preprocessing the parameters required by the data processing, wherein the preprocessing comprises format conversion, date conversion and field conversion of the parameters required by the data processing;
and inquiring from the storage medium to obtain a value corresponding to the index required by the data processing according to the parameter required by the data processing after the preprocessing and the index required by the data processing.
In a second aspect, an embodiment of the present application provides a data processing apparatus, including:
the acquisition module is used for responding to a data call request sent by a client and acquiring a preset context from a storage medium, wherein the preset context comprises parameters required by data processing, indexes required by the data processing and a data processing method;
the query module is used for querying from the storage medium to obtain a value corresponding to the index required by the data processing according to the preset context;
and the calculation module is used for processing the parameters required by the data processing and the values corresponding to the indexes required by the data processing according to the data processing method to obtain a data processing result.
In a third aspect, an embodiment of the present application provides a computer device, including a memory and at least one processor;
the memory stores computer-executable instructions;
the at least one processor executes computer-executable instructions stored by the memory, causing the at least one processor to perform the method as described above.
In a fourth aspect, the present application provides a readable storage medium, in which computer instructions are stored, and when executed by a processor, the computer instructions are used to implement the method as described above.
In a fifth aspect, an embodiment of the present application provides a storage medium, in which parameters required for data processing, indexes required for data processing, and a data processing method are stored.
In a sixth aspect, embodiments of the present application provide a computer program product comprising computer programs/instructions, which when executed by a processor, implement the method as described above.
According to the data processing method, the data processing device, the computer equipment and the readable storage medium, the parameters, the indexes and the data processing method required in the data processing process are stored in the storage medium in advance, when the data processing is required, the parameters, the indexes and the data processing method required by the data processing can be directly called from the storage medium to process the data, the execution of program codes is avoided to complete the data processing, when the system service is changed, the program codes do not need to be rewritten, and the cost input of research and development personnel is reduced.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application;
fig. 1 is a schematic flowchart of a first embodiment of a data processing method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of a second embodiment of a data processing method according to an embodiment of the present application;
fig. 3 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application;
FIG. 4 is a schematic block diagram of a computer device provided by some embodiments of the present invention.
With the above figures, there are shown specific embodiments of the present application, which will be described in more detail below. These drawings and written description are not intended to limit the scope of the inventive concepts in any manner, but rather to illustrate the inventive concepts to those skilled in the art by reference to specific embodiments.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments of the present application, but not all 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.
The terms referred to in this application are explained first:
Context:
context, each program has many external variables, and once a program is written to have external variables, the program is incomplete and cannot run independently, and all values of all external variables must be passed in one to run, and the set of the values is called Context.
When a business system in a computer performs business processing, various data processing needs to be performed, for example, taking a house loan center system as an example, in an operation process, the system mainly involves calculation of some expenses, such as interest, default money and the like. For example, when a service to be processed changes, the calculation method written in the program code also needs to be adaptively adjusted, at this time, the research and development staff need to return to the original program code to modify the program code or rewrite the program code to adapt to the new service, and the modified or reprogrammed program code subsequently needs to be compiled, published, deployed, restarted and other series of processes again, so that when a new service occurs in the system, the research and development staff often need to spend a large amount of time and labor cost again to adjust the original program code.
In view of the above problems, embodiments of the present application provide a data processing method, an apparatus, a computer device, and a readable storage medium, in which parameters, indexes, and data processing methods that need to be performed are pre-stored in the storage medium, and when a business system needs to perform data processing, corresponding parameters, indexes, and data processing methods can be directly called from the storage medium to perform data processing, so that a developer only needs to transmit parameters, indexes, and data processing methods that are needed by data processing to the storage medium in advance, and does not need to modify program codes in the business system, and the parameters, indexes, and data processing methods transmitted to the storage medium can be reused, and when the same business is subsequently involved, the parameters, indexes, and data processing methods in the storage medium can be directly used, the workload of research personnel is greatly reduced.
Fig. 1 is a schematic flow diagram of a first embodiment of a data processing method provided in an embodiment of the present application, where the method may be applied to a computer, and as shown in fig. 1, the method may specifically be implemented by the following steps:
s101, responding to a data call request sent by a client, and acquiring a preset context from a storage medium.
The preset context comprises parameters required by data processing, indexes required by the data processing and a data processing method. For example, the preset context may be a data structure for storing data, and the parameters, the indicators, and the data processing methods may be stored in a classified manner.
In this embodiment, the client may be a software system installed in a computer, for example, the client may be a housing loan center system, the data call request may be transmitted inside the computer, and transmitted to a data processing module inside the computer through the client inside the computer, and the data processing module may retrieve parameters required for data processing, indexes required for data processing, and data processing methods from a storage medium according to the data call request to establish the preset context.
For example, the computer may be loaded with a physical hard disk, a virtual database, or the like as a storage medium to store parameters required for data processing, indexes required for data processing, and data processing methods in a preset context.
The data call request may include an externally-transmitted parameter, and the externally-transmitted parameter may be used to subsequently query a value corresponding to an index required for data processing, and illustratively, the externally-transmitted parameter includes a date, an ID number, a number, and the like, and the preset context is constructed and obtained by the externally-transmitted parameter, the parameter required for data processing, the index required for data processing, and the data processing method, which are stored in the storage medium in advance.
And S102, inquiring from a storage medium according to a preset context to obtain a value corresponding to an index required by data processing.
Specifically, the parameter required for data processing in the preset context may be in a numerical form, while the index required for data processing in the preset context is not in the numerical form, and the value of the index required for data processing needs to be obtained through query. Illustratively, the value of the index required by the data processing can be queried through the externally-transmitted parameters.
For example, if the externally-transmitted parameter is a date, a sum of certain types of data at a certain date may be obtained by querying, and the sum is used as a value of an index required by data processing. For example, if the parameter transmitted from the outside is a loan method a, a value corresponding to an index (i.e., interest) required for data processing may be obtained by querying according to the loan method a and is 1.
And S103, processing parameters required by data processing and values corresponding to indexes required by the data processing according to a data processing method to obtain a data processing result.
In this embodiment, the data processing method and the parameters required for data processing may be pre-stored in the storage medium, and the values corresponding to the indexes required for data processing may be obtained through querying.
For example, the data processing method may be a calculation method, such as (a-b) × c, where a, b, and c may be parameters or values of indexes. For example, if a house loan center system is taken as an example, a, b may represent money and c interest. And according to the calculation method, performing combined calculation on the parameters required by the data processing and the indexes required by the data processing to finally obtain a calculation result as a data processing result.
In the embodiment of the application, the parameters required by data processing, the indexes required by data processing and the data processing method are pre-stored in the storage medium, when an external client needs to process data, the stored parameters, indexes and data processing methods can be directly called to complete data processing without executing the data processing method written in the program codes by the client, so that, when the business change occurs, the research and development personnel do not need to modify the data processing method written in the program code or rewrite the program code, but only the parameters, indexes and data processing methods stored in the storage medium in advance are needed, and in the subsequent business adjustment, the parameters, indexes and data processing methods stored in the storage medium can be repeatedly used, so that the workload of research and development personnel is reduced, and the research and development cost is reduced.
For example, on the basis of the above embodiments, in some embodiments, the step S102 may be specifically implemented by the following steps:
extracting necessary parameters from parameters required by data processing of a preset context;
determining the query range of indexes required by data processing according to necessary parameters;
and inquiring from the storage medium according to a preset processing method to obtain a value corresponding to the index required by data processing in the inquiry range.
In this embodiment, the necessary parameter may be, for example, a date or a loan mode, which may be transmitted from the outside, for example, when the user or other code is called. Specifically, the necessary parameter is used to define a query range of the index required for data processing, and when the necessary parameter is a date, for example, the day before the current time is taken as the necessary parameter, the query range of the index required for data processing is the index required for data processing the day before the current time.
Optionally, the preset processing method may be a database Query processing method and a code block processing method, where the database Query processing method may be to Query the database through Structured Query Language (SQL) to obtain a value corresponding to an index required for data processing. In this embodiment, the code block processing may be to perform query by using the code block to obtain a value corresponding to an index required for data processing.
According to the method and the device, the necessary parameters are extracted from the parameters required by data processing, the values corresponding to the indexes required by data processing within the query range can be queried and obtained from the storage medium, and the query efficiency and the query accuracy are improved.
For example, on the basis of the above embodiments, in some embodiments, the "obtaining a value corresponding to an index required for data processing in an inquiry range from a storage medium by inquiring according to a preset processing method" may specifically be implemented by the following steps:
distributing the index required by data processing into at least two sub-indexes;
and acquiring a preset processing method corresponding to each sub-index, and inquiring from the storage medium to obtain a value corresponding to each sub-index in an inquiry range according to the preset processing method corresponding to each sub-index.
Specifically, the number of the indexes required for data processing may be multiple, for example, the indexes required for data processing include two different interests, the two different interests may be divided into two sub-indexes, and each sub-index may correspond to a preset processing method, so as to obtain a value corresponding to each sub-index through query.
Illustratively, the preset processing method corresponding to the interest may be a database query processing method, and the interest value corresponding to the loan A mode obtained through query is 1 through the database query processing method.
According to the method and the device, the indexes required by data processing are distributed into the plurality of sub-indexes, and then the preset processing method corresponding to each index is utilized to inquire to obtain the value corresponding to each sub-index, so that the inquiry means of the indexes required by data processing can be increased, and the inquiry efficiency is improved.
For example, on the basis of the foregoing embodiments, in some embodiments, the "obtaining the preset processing method corresponding to each sub-indicator, obtaining the value corresponding to each sub-indicator in the query range from the storage medium by querying according to the preset processing method corresponding to each sub-indicator" may specifically be implemented by the following steps:
acquiring the total number of the sub-indexes, and establishing query threads with the number corresponding to the total number of the sub-indexes;
the query threads are executed concurrently.
And the query thread is used for querying and obtaining the value corresponding to each sub-index in the query range from the storage medium according to the preset processing method corresponding to each sub-index when being executed.
In this embodiment, for example, the total number of the sub-indexes may be 2, then 2 query threads may be correspondingly set, the first query thread may query to obtain a value corresponding to the first sub-index by using a database query processing method or a code block processing method, and the second query thread may query to obtain a value corresponding to the second sub-index by using the database query processing method and the code block processing method.
According to the method and the device, the query efficiency can be improved and the query time can be shortened by establishing the plurality of query threads and executing the plurality of query threads concurrently to query the values corresponding to the sub-indexes within the query range.
For example, on the basis of the above embodiments, in some embodiments, the step S102 may be specifically implemented by the following steps:
establishing a query request according to parameters required by data processing and indexes required by the data processing;
and inquiring from the storage medium to obtain a value corresponding to the index required by data processing according to the inquiry request.
Specifically, the parameters required for data processing may include externally-transmitted parameters and parameters pre-stored in the storage medium, where the externally-transmitted parameters may be used to construct a query request together with the indexes required for data processing.
Illustratively, the externally-entered parameter may be a date, an ID, a number, etc., and the parameter pre-stored in the storage medium may be a value directly used to participate in data processing, such as an amount of money, etc.
In this embodiment, according to the parameters and the indexes required for data processing, which are transmitted from the outside, values corresponding to the indexes required for data processing can be obtained by querying from the storage medium.
Illustratively, taking a data processing method as an example for calculating the late payment, a calculation formula of the late payment is (a-B) × c, wherein parameters required for data processing may be an amount a and an amount B, indexes required for data processing may be interest, if an externally transmitted parameter is a loan mode a, according to the loan mode a, the interest corresponding to the loan mode a may be obtained by querying from a storage medium and is 1, that is, the value of c is 1, and if the loan mode is B, according to the loan mode B, the interest corresponding to the loan mode B may be obtained by querying from the storage medium and is 2, that is, the value of c is 2.
According to the method and the device, the query request is established through the parameters and the indexes required by the data processing, the values of the indexes required by the data processing can be queried and obtained from the storage medium, research and development personnel can conveniently set the values of the indexes required by the data processing in advance and store the values in the storage medium, and the situation that the values of the indexes required by the data processing are reset in the program codes when system business is changed is avoided.
Further, in some embodiments, the step "obtaining a value corresponding to an index required for data processing by querying from a storage medium according to a query request" may be specifically implemented in the following manner:
determining a preset processing method corresponding to the query request according to the query request;
and inquiring from the storage medium by using a preset processing method to obtain a value corresponding to the index required by data processing.
The preset processing method comprises database query processing and code block processing.
In this embodiment, the Query processing of the database may be to Query the database through Structured Query Language (SQL) to obtain a value corresponding to an index required by data processing. In this embodiment, the code block processing may be to perform query by using the code block to obtain a value corresponding to an index required for data processing.
According to the method and the device, the value corresponding to the index required by the data is inquired by using various methods, so that the inquiry efficiency can be improved, and the value corresponding to the index required by the data can be quickly inquired.
Further, in some embodiments, the "obtaining a value corresponding to an index required for data processing by querying from a storage medium using a preset processing method" may specifically be implemented by the following steps:
and acquiring the number of the query requests, establishing query threads with the number corresponding to the query requests, and executing the query threads concurrently.
The query thread is used for querying from the storage medium by using a preset processing method to obtain a value corresponding to an index required by data processing.
In this embodiment, there may be a plurality of values of the index required for data processing, and multiple threads may be established to query the value corresponding to each index required for data processing.
Illustratively, two query threads may be established, wherein one query thread queries a value of an index required for data processing by a database query processing method, and the other query thread queries a value of an index required for data processing by a code block processing method.
According to the embodiment of the application, the query efficiency can be improved by creating the plurality of query threads and executing the plurality of query threads concurrently to query the value corresponding to the index required by data processing.
Illustratively, on the basis of the foregoing embodiments, in some embodiments, before the foregoing step S101, the foregoing data processing method further includes the following steps:
acquiring external data transmitted by external equipment, establishing a preset context, and writing the external data into the preset context;
and storing the preset context into a storage medium.
Specifically, the external device may be a computer, and the user may transfer external data through the computer, or other code inside the computer may transfer external data when called.
Illustratively, the external data may include parameters required for data processing, indexes required for data processing, and data processing methods.
For example, the data processing method may be a calculation formula, the parameter required for data processing may be an amount, a loan mode, a date, an ID, a number, and the like, and the index required for data processing may be an interest and the like, wherein the interest value corresponds to a different value according to a different incoming loan mode.
According to the embodiment of the application, the external data is transmitted in advance through the external equipment by the research and development personnel, the external data is stored in the preset context, when the system needs to process data, the preset context can be directly obtained from the storage medium to complete the processing of the data, the program code does not need to be executed, and the research and development personnel need to modify or reprogram the program code when the subsequent data processing is changed.
For example, on the basis of the foregoing embodiments, in some embodiments, after the foregoing step S102, the foregoing data processing method may further include the following steps:
and writing the value corresponding to the index required by the data processing into a preset context.
Specifically, the value corresponding to the index required for data processing can be obtained by querying in the database of the storage medium through a database query processing method.
Illustratively, when the value corresponding to the index required for data processing is written into the preset context, a key-value pair relationship may be established, and the index required for data query and the corresponding value are used as the key-value pair.
According to the embodiment of the application, the value corresponding to the index required by data processing is written into the preset context, so that the value corresponding to the index required by data processing is directly extracted from the preset context when the same data processing is performed next time, and the data acquisition efficiency is improved.
In some embodiments, if the data processing method is a preset calculation formula, the step S103 may be specifically implemented by the following steps:
inputting parameters required by data processing and values corresponding to indexes required by the data processing into a preset calculation formula;
and calculating by using a preset calculation formula to obtain a data processing result.
For example, the preset calculation formula may be (a-b) × c, where a and b may be parameters, specifically, amount of money, and c may be an index required for data processing, specifically, interest, and the calculation result obtained by the calculation formula, which may be a default fund, is output as the data processing result.
According to the data processing method, the preset calculation formula is set as the data processing method, data processing is simple and convenient, and the method can be effectively applied to various data processing scenes.
Further, on the basis of the foregoing embodiments, in some embodiments, after the step "obtaining a data processing result", the following steps may be further included:
writing the data processing result into a preset context to obtain a target context;
and feeding back the target context to the client.
In this embodiment, the preset context may be a data structure, an area for storing a data processing structure may be constructed in the preset context, and after the computer processes the parameters and the indexes required for data processing by using a data processing method to obtain a data processing result, the data processing result may be stored in the area.
According to the embodiment of the application, the data processing result is written into the preset context and returned to the client, so that the client can obtain the data processing result in the preset context, and meanwhile, parameters, indexes and data processing methods required by data processing in the preset context can be obtained, various data related in the data processing process can be comprehensively obtained, and follow-up tracing is facilitated.
In some embodiments, the step S102 may be specifically implemented by the following steps:
checking parameters required by data processing in a preset context, and determining whether the parameters required by the data processing comprise preset parameters;
if so, preprocessing parameters required by data processing;
and inquiring from the storage medium to obtain a value corresponding to the index required by the data processing according to the parameter required by the data processing and the index required by the data processing after the preprocessing.
Wherein the preprocessing comprises format conversion, date conversion and field conversion of parameters required by data processing
Specifically, when querying the value of the index required for data processing, the parameter required for data processing in the preset context needs to be checked to determine whether the parameter includes a necessary parameter, and the preset parameter may be a date parameter.
For example, if the preset parameter is a date parameter, the preprocessing may specifically be date conversion, and for example, the date parameter is transmitted from the outside, and the format of the date parameter may be converted by preprocessing into a format that can be recognized by the computer.
According to the embodiment of the application, the parameters required by the data in the preset context are checked and preprocessed, so that the condition that necessary parameters exist in the preset context and the preset afternoon can be further ensured, and the value corresponding to the index required by the data processing can be accurately acquired according to the necessary parameters.
In some embodiments, after the step S103, the data processing method may further include the steps of:
receiving configuration information transmitted by external equipment;
and configuring parameters required by data processing, indexes required by the data processing and data processing methods in preset contexts in the storage medium according to the configuration information.
Illustratively, the external device may be a computer or the like, and the developer may input configuration information through the external device, where the configuration information may be a new parameter required for data processing, a new index required for data processing, and a new data processing method.
For example, if the system has a new service and the parameters, the indexes, and the data processing methods required for data processing in the current preset context cannot be adapted to the new service, the user may configure the preset context stored in the storage medium and adjust the parameters, the indexes, and the data processing methods required for data processing in the preset context.
According to the embodiment of the application, the preset context in the storage medium can be reconfigured by receiving the configuration information transmitted by the research and development personnel through the external equipment, and when the system service is changed, the parameters, indexes and data processing methods required by data processing in the preset context can be modified by using the configuration information, so that the problem that the research and development personnel need to rewrite program codes with great effort is avoided.
Optionally, in some embodiments, the storage medium may be a preset database.
Fig. 2 is a schematic flow chart of a second embodiment of a data processing method provided in the embodiment of the present application, and as shown in fig. 2, the method includes the following steps:
s201, external calling.
Specifically, the external may refer to other code in the computer, and the other code may call the Context from the storage medium.
Illustratively, when calling is performed outside, external parameters can be accessed, wherein the external parameters include dates, IDs, numbers and the like, and are used for querying values corresponding to indexes required by data.
S202, obtaining the Context from the storage medium.
Specifically, Context is a preset Context, where the Context includes parameters, indexes and methods required by data processing, and the parameters, indexes and methods may be pre-configured in a storage medium by a developer
S203, checking necessary parameters and preprocessing the parameters.
Specifically, when index query is performed, a value corresponding to an index required for data processing can be obtained only by querying through a parameter, and therefore whether the parameter exists needs to be checked, for example, if a certain type of data on a certain date needs to be queried, necessary parameters include a date parameter and the like.
The parameter preprocessing can be a data format conversion of the parameter, for example, a date format conversion, or a conversion of some specific fields into general fields.
And S204, executing data index query.
Specifically, after the necessary parameters are checked and the parameter preprocessing is completed, the query of the data index is started, and the value corresponding to the parameter required by the data processing is queried.
S205, establishing a query request according to the indexes and the parameters, and replacing the SQL parameters.
Specifically, the index may be SQL, that is, a sentence for searching data from the database, which is not in a numerical form, the index carries parameters, and the data in the numerical form, that is, a value corresponding to the index, may be queried from the storage medium through the parameters and the index.
For example, taking the parameter as a loan mode as an example, the interest corresponding to the loan mode a is 1, the interest corresponding to the loan mode B is 2, and the index may refer to inquiring the interest corresponding to the loan mode a, where the value searched from the storage medium is 1.
In this embodiment, replacing the SQL parameter means that the parameter needs to be replaced in the index, so that the value corresponding to the index can be queried by using the parameter.
S206, multithread calling inquiry.
Specifically, there may be a plurality of values corresponding to the indexes required for data processing, and the values may be distributed to a plurality of threads to invoke multithreading for query.
S207, writing the query result back to Context.
And S208, analyzing the data processing method.
Specifically, the data processing method in the Context may be a calculation formula, and the calculation formula is obtained by analyzing the data processing method.
And S209, filling data parameters and indexes, and calculating.
Specifically, the parameters required by the data processing in the Context and the values corresponding to the indexes obtained by the query are filled into a calculation formula, and a calculation result is obtained by calculation.
S210, writing the calculation result back to Context.
S211, returning the Context.
In particular, Context may be returned to the storage medium.
Optionally, in this embodiment, the storage medium may be a database or the like.
In summary, in the data processing method provided in the embodiment of the present application, the data processing parameters, the indexes required for data processing, and the data processing method are all obtained through the storage medium, so that only the data in the storage medium needs to be updated, and the program code does not need to be modified, for the data processing changes that may be encountered subsequently. Moreover, the information such as the indexes stored in the storage medium can be repeatedly used across data processing scenes, so that the workload of modifying program codes by research and development personnel is effectively reduced.
The following are embodiments of the apparatus of the present application that may be used to perform embodiments of the method of the present application. For details which are not disclosed in the embodiments of the apparatus of the present application, reference is made to the embodiments of the method of the present application.
Fig. 3 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application, where the data processing apparatus may be integrated in a computer, or may be independent of the computer and cooperate with the computer to implement the technical solution of the present application. As shown in fig. 3, the data processing apparatus 30 includes an obtaining module 31, a querying module 32, and a calculating module 33.
The obtaining module 31 is configured to obtain a preset context from a storage medium in response to a data call request sent by a client. The query module 32 is configured to query from the storage medium to obtain a value corresponding to an index required by data processing according to a preset context. And the calculating module 33 is configured to process the parameters required by the data processing and the values corresponding to the indexes required by the data processing according to the data processing method, so as to obtain a data processing result.
The preset context comprises parameters required by data processing, indexes required by the data processing and a data processing method.
For example, in some embodiments, the query module 32 may be specifically configured to:
establishing a query request according to parameters required by data processing and indexes required by the data processing;
and inquiring from the storage medium to obtain a value corresponding to the index required by data processing according to the inquiry request.
Optionally, in some embodiments, the query module 32 may be specifically configured to:
determining a preset processing method corresponding to the query request according to the query request, wherein the preset processing method comprises database query processing and code block processing;
and inquiring from the storage medium by using a preset processing method to obtain a value corresponding to the index required by data processing.
Optionally, in some embodiments, the calculating module 33 may be specifically configured to:
and acquiring the number of the query requests, and establishing query threads with the number corresponding to the query requests.
The query thread is used for querying from the storage medium by using a preset processing method to obtain a value corresponding to an index required by data processing.
Illustratively, on the basis of the foregoing embodiments, in some embodiments, the data processing apparatus 30 further includes a building module configured to:
acquiring external data transmitted by external equipment, establishing a preset context, and writing the external data into the preset context;
and storing the preset context into a storage medium.
In some embodiments, the data processing apparatus 30 may further include a value writing module, configured to write a value corresponding to an index required by data processing into a preset context.
In some embodiments, if the data processing method is a preset calculation formula, the calculation module 33 may specifically be configured to:
inputting parameters required by data processing and values corresponding to indexes required by the data processing into a preset calculation formula;
and calculating by using a preset calculation formula to obtain a data processing result.
In some embodiments, the data processing apparatus 30 may further include a feedback module configured to:
writing the data processing result into a preset context to obtain a target context;
and feeding back the target context to the client.
In some embodiments, the query module 32 may be specifically configured to:
checking parameters required by data processing in a preset context, and determining whether the parameters required by the data processing comprise preset parameters;
if so, preprocessing parameters required by data processing;
and inquiring from the storage medium to obtain a value corresponding to the index required by the data processing according to the parameter required by the data processing and the index required by the data processing after the preprocessing.
The preprocessing comprises format conversion, date conversion and field conversion of parameters required by data processing.
In some embodiments, the data processing apparatus 30 may further include a configuration module configured to:
receiving configuration information transmitted by external equipment;
and configuring parameters required by data processing, indexes required by the data processing and data processing methods in preset contexts in the storage medium according to the configuration information.
Optionally, in some embodiments, the storage medium may be a preset database, and the preset database may be stored in the computer in a virtual form.
It should be noted that the division of the modules of the above apparatus is only a logical division, and the actual implementation may be wholly or partially integrated into one physical entity, or may be physically separated. And these modules can be realized in the form of software called by processing element; or may be implemented entirely in hardware; and part of the modules can be realized in the form of calling software by the processing element, and part of the modules can be realized in the form of hardware. For example, the query module may be a processing element separately set up, or may be implemented by being integrated in a chip of the apparatus, or may be stored in a memory of the apparatus in the form of program code, and a processing element of the apparatus calls and executes the functions of the query module. Other modules are implemented similarly. In addition, all or part of the modules can be integrated together or can be independently realized. The processing element here may be an integrated circuit with signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in the form of software.
FIG. 4 is a schematic block diagram of a computer device provided by some embodiments of the present invention. As shown in fig. 4, the computer device 40 includes: at least one processor 41, a memory 42. Illustratively, the processor 41 may communicate with the memory 42 via a bus 43.
Wherein the memory 42 has stored therein computer-executable instructions. The processor 41 is configured to read the computer-executable instructions stored in the memory 42 and implement the relevant steps in the method described in the above embodiments. In particular, the computer executable instructions may be program code.
Illustratively, the computer device 40 may also include a communication interface 44, and the communication interface 44 may be used for communicating with external devices.
Processor 41 may be a central processing unit, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement embodiments of the present invention.
The memory 42 may comprise high-speed RAM memory and may also include non-volatile memory, such as at least one disk memory.
Alternatively, the memory 42 may be separate or integrated with the processor 41.
Optionally, an embodiment of the present application further provides a readable storage medium, where computer instructions are stored in the readable storage medium, and when at least one processor of a computer device executes the computer instructions, the computer device executes the data processing method provided in the foregoing various embodiments.
Optionally, an embodiment of the present application further provides a storage medium, where parameters required for data processing, indexes required for data processing, and a data processing method are stored in the storage medium.
For example, the storage medium may be a preset database, and the preset database may be loaded in the computer.
Optionally, the storage medium may be an entity hard disk, and the computer is enabled to obtain the stored parameters required for data processing, the indexes required for data processing, and the data processing method from the storage medium through a communication interface of the computer.
The present embodiments also provide a program product comprising a computer program/instructions stored in a readable storage medium. The computer program/instructions may be read from a readable storage medium by at least one processor of a computer device, and execution of the computer program/instructions by the at least one processor causes the computer device to implement the data processing methods provided by the various embodiments described above.
In the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone, wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship; in the formula, the character "/" indicates that the preceding and following related objects are in a relationship of "division". "at least one of the following" or similar expressions refer to any combination of these items, including any combination of the singular or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, a-b, a-c, b-c, or a-b-c, wherein a, b, c may be single or multiple.
It is to be understood that the various numerical references referred to in the embodiments of the present application are merely for convenience of description and distinction and are not intended to limit the scope of the embodiments of the present application. In the embodiment of the present application, the sequence numbers of the above-mentioned processes do not mean the execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiment of the present application.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (14)

1. A data processing method, comprising:
responding to a data call request sent by a client, and acquiring a preset context from a storage medium, wherein the preset context comprises parameters required by data processing, indexes required by the data processing and a data processing method;
inquiring from the storage medium to obtain a value corresponding to the index required by the data processing according to the preset context;
and processing the parameters required by the data processing and the values corresponding to the indexes required by the data processing according to the data processing method to obtain a data processing result.
2. The method according to claim 1, wherein the obtaining, by querying from the storage medium according to the preset context, a value corresponding to the index required for data processing includes:
extracting necessary parameters from the parameters required by the data processing of the preset context;
determining the query range of the indexes required by the data processing according to the necessary parameters;
and inquiring from the storage medium according to a preset processing method to obtain a value corresponding to the index required by the data processing in the inquiry range.
3. The method according to claim 1, wherein the querying from the storage medium according to a preset processing method to obtain a value corresponding to an index required for data processing within the query range includes:
distributing the index required by data processing into at least two sub-indexes;
and acquiring a preset processing method corresponding to each sub-index, and inquiring from the storage medium to obtain a value corresponding to each sub-index in the inquiry range according to the preset processing method corresponding to each sub-index.
4. The method according to claim 3, wherein the obtaining of the preset processing method corresponding to each sub-indicator queries, from the storage medium, a value corresponding to each sub-indicator within the query range according to the preset processing method corresponding to each sub-indicator, and includes:
acquiring the total number of the sub-indexes, and establishing query threads with the number corresponding to the total number of the sub-indexes;
and concurrently executing the query thread, wherein the query thread is used for querying and obtaining the value corresponding to each sub-index in the query range from the storage medium according to the preset processing method corresponding to each sub-index when being executed.
5. The method according to any one of claims 1 to 4, wherein after obtaining the value corresponding to the index required for data processing by querying from the storage medium according to the preset context, the method further includes:
and writing the value corresponding to the index required by the data processing into the preset context.
6. The method according to claim 1, wherein the data processing method is a preset calculation formula, and the processing the parameters required for data processing and the values corresponding to the indexes required for data processing according to the data processing method to obtain the data processing result includes:
inputting the parameters required by data processing and the values corresponding to the indexes required by the data processing into the preset calculation formula;
and calculating by using the preset calculation formula to obtain a data processing result.
7. The method of claim 1, wherein after obtaining the data processing result, further comprising:
writing the data processing result into the preset context to obtain a target context;
and feeding back the target context to the client.
8. The method according to claim 1, wherein the obtaining, by querying from the storage medium according to the preset context, a value corresponding to the index required for data processing includes:
checking parameters required by data processing in the preset context, and determining whether the parameters required by the data processing comprise preset parameters;
if so, preprocessing the parameters required by the data processing, wherein the preprocessing comprises format conversion, date conversion and field conversion of the parameters required by the data processing;
and inquiring from the storage medium to obtain a value corresponding to the index required by the data processing according to the parameter required by the data processing after the preprocessing and the index required by the data processing.
9. The method according to any one of claims 1 to 4, wherein after the processing the parameter required for data processing and the value corresponding to the index required for data processing according to the data processing method to obtain a data processing result, the method further comprises:
receiving configuration information transmitted by external equipment;
and configuring parameters, indexes and data processing methods required by data processing in a preset context in the storage medium according to the configuration information.
10. A data processing apparatus, comprising:
the acquisition module is used for responding to a data call request sent by a client and acquiring a preset context from a storage medium, wherein the preset context comprises parameters required by data processing, indexes required by the data processing and a data processing method;
the query module is used for querying from the storage medium to obtain a value corresponding to the index required by the data processing according to the preset context;
and the calculation module is used for processing the parameters required by the data processing and the values corresponding to the indexes required by the data processing according to the data processing method to obtain a data processing result.
11. A computer device comprising a memory and at least one processor;
the memory stores computer-executable instructions;
the at least one processor executing the computer-executable instructions stored by the memory causes the at least one processor to perform the method of any one of claims 1-9.
12. A readable storage medium having stored therein computer instructions, which when executed by a processor, are adapted to implement the method of any one of claims 1-9.
13. A storage medium is characterized in that parameters required for data processing, indexes required for data processing and a data processing method are stored in the storage medium.
14. A computer program product comprising computer programs/instructions, characterized in that the computer programs/instructions, when executed by a processor, implement the method of any of claims 1-9.
CN202110607450.7A 2021-06-01 2021-06-01 Data processing method and device, computer equipment and readable storage medium Pending CN113190576A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110607450.7A CN113190576A (en) 2021-06-01 2021-06-01 Data processing method and device, computer equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110607450.7A CN113190576A (en) 2021-06-01 2021-06-01 Data processing method and device, computer equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN113190576A true CN113190576A (en) 2021-07-30

Family

ID=76986127

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110607450.7A Pending CN113190576A (en) 2021-06-01 2021-06-01 Data processing method and device, computer equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN113190576A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113641677A (en) * 2021-08-24 2021-11-12 京东科技控股股份有限公司 Data processing method and device, electronic equipment and storage medium
CN115168056A (en) * 2022-09-02 2022-10-11 深圳华锐分布式技术股份有限公司 Information processing method, device, equipment and medium based on resource allocation

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110764700A (en) * 2019-10-12 2020-02-07 上海陆家嘴国际金融资产交易市场股份有限公司 Data storage method and device, computer equipment and storage medium
CN110765157A (en) * 2019-09-06 2020-02-07 中国平安财产保险股份有限公司 Data query method and device, computer equipment and storage medium
CN111105289A (en) * 2019-11-22 2020-05-05 北京美鲜科技有限公司 Aop-mode-based client order cancellation judgment method and device
CN111209310A (en) * 2020-04-23 2020-05-29 太平金融科技服务(上海)有限公司 Service data processing method and device based on stream computing and computer equipment
CN111638873A (en) * 2020-05-21 2020-09-08 平安普惠企业管理有限公司 Program code generation method and device, computer equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110765157A (en) * 2019-09-06 2020-02-07 中国平安财产保险股份有限公司 Data query method and device, computer equipment and storage medium
CN110764700A (en) * 2019-10-12 2020-02-07 上海陆家嘴国际金融资产交易市场股份有限公司 Data storage method and device, computer equipment and storage medium
CN111105289A (en) * 2019-11-22 2020-05-05 北京美鲜科技有限公司 Aop-mode-based client order cancellation judgment method and device
CN111209310A (en) * 2020-04-23 2020-05-29 太平金融科技服务(上海)有限公司 Service data processing method and device based on stream computing and computer equipment
CN111638873A (en) * 2020-05-21 2020-09-08 平安普惠企业管理有限公司 Program code generation method and device, computer equipment and storage medium

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113641677A (en) * 2021-08-24 2021-11-12 京东科技控股股份有限公司 Data processing method and device, electronic equipment and storage medium
CN115168056A (en) * 2022-09-02 2022-10-11 深圳华锐分布式技术股份有限公司 Information processing method, device, equipment and medium based on resource allocation
CN115168056B (en) * 2022-09-02 2022-12-02 深圳华锐分布式技术股份有限公司 Information processing method, device, equipment and medium based on resource allocation

Similar Documents

Publication Publication Date Title
KR102522274B1 (en) User grouping method, apparatus thereof, computer, computer-readable recording medium and computer program
US9684490B2 (en) Uniform interface specification for interacting with and executing models in a variety of runtime environments
CN111177231A (en) Report generation method and report generation device
CN110795455A (en) Dependency relationship analysis method, electronic device, computer device and readable storage medium
CN109634587B (en) Method and equipment for generating warehousing script and warehousing data
CN110704398A (en) Database migration method and device from MySQL to Oracle and computer equipment
US10372465B2 (en) System and method for controlling batch jobs with plugins
CN113190576A (en) Data processing method and device, computer equipment and readable storage medium
US10275234B2 (en) Selective bypass of code flows in software program
CN115438087A (en) Data query method and device based on cache library, storage medium and equipment
US10417234B2 (en) Data flow modeling and execution
US7739083B2 (en) Program and/or method for calculating tuning parameters for numerical computation library
CN115617338A (en) Method and device for quickly generating service page and readable storage medium
US11726818B1 (en) System for executing tasks in different programming languages
CN112580980B (en) Service processing method and device and electronic equipment
US11275490B2 (en) System and method for enabling user-defined data transformations through dynamic client-side workflows
CN114328486A (en) Data quality checking method and device based on model
CN117056343B (en) Multi-source data management method and system in power grid field and electronic equipment
CN117931164B (en) Form application design method and system based on low codes
CN112463146B (en) Health risk financial preparation gold output method and device and electronic equipment
US20230068947A1 (en) Systems and methods for processing inter-dependent data for risk modelling and analysis
CN106687999B (en) Generating a set of instructions implementing rules designed to update objects specified according to an application data model
CN115828867A (en) Feature width table construction method and device, terminal device and medium
CN112506944A (en) Data standard conversion access method, device, equipment and medium between service systems
CN115237690A (en) Test tool generation method and device, electronic 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