CN116483834A - Data index adding method and device, storage medium and computer equipment - Google Patents

Data index adding method and device, storage medium and computer equipment Download PDF

Info

Publication number
CN116483834A
CN116483834A CN202310444064.XA CN202310444064A CN116483834A CN 116483834 A CN116483834 A CN 116483834A CN 202310444064 A CN202310444064 A CN 202310444064A CN 116483834 A CN116483834 A CN 116483834A
Authority
CN
China
Prior art keywords
data
service object
newly
added
service
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
CN202310444064.XA
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.)
Ping An Commercial Factoring Co ltd
Original Assignee
Ping An Commercial Factoring 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 Ping An Commercial Factoring Co ltd filed Critical Ping An Commercial Factoring Co ltd
Priority to CN202310444064.XA priority Critical patent/CN116483834A/en
Publication of CN116483834A publication Critical patent/CN116483834A/en
Pending legal-status Critical Current

Links

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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2272Management thereof
    • 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/21Design, administration or maintenance of databases
    • 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
    • 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/23Updating
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

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

Abstract

The application discloses a data index adding method and device, a storage medium and computer equipment, which are applied to a service system, wherein the service system comprises an index adding function, and the index adding function is used for adding a service object index for a service object based on index adding operation of a user on an application program page on the service object, and the method comprises the following steps: responding to a data acquisition instruction, acquiring at least one piece of service object newly-added data from a third party database, and generating a newly-added data table based on the service object newly-added data; searching a target index adding function corresponding to each service object newly-added data in the newly-added data table according to the reflection mechanism, and configuring each service object newly-added data as a parameter in the corresponding target index adding function; and adding or updating the service object index to the service object corresponding to the new data of the service object through the configured target index adding function. The development flow is reduced by directly mapping and calling the index adding function corresponding to the data.

Description

Data index adding method and device, storage medium and computer equipment
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and apparatus for adding a data index, a storage medium, and a computer device.
Background
In the business development of a company, in order to better develop the company business, it is necessary to collect and sort the information of the service objects, and add a corresponding service object index to the collected and sorted data, so that the data related to the service objects can be quickly queried. Specifically, related data such as contract signing and the like is generated in the cooperation process with the service object, so that the data related to the service object needs to be dynamically acquired in a third party database, so that the addition or update of the service object index is realized by combining the original data and the newly added data of the service object. The current stage mainly depends on adding buried points in the middle and background systems, triggering after a buried point event, pushing to the service object system, and calling a functional module to realize the integration updating of data and adding corresponding service object indexes after the service object system receives parameters. For the middle and background systems, the nodes are buried one by one, version arrangement is needed, a large amount of development resources are consumed, the coupling with a service system is heavy, later newly-added data is needed to be developed independently and reissued, and the flow is complex.
Disclosure of Invention
In view of this, the application provides a method and apparatus for adding a data index, a storage medium, and a computer device, where by acquiring new data of a service object and storing the new data in a new data table, the data in the new data table is used as a parameter to invoke an index adding function to implement adding or adding of the service object index, and the index adding function corresponding to the data can be directly mapped and invoked according to the data, thereby reducing development flow.
According to one aspect of the present application, there is provided a data index adding method applied to a service system, the service system including an index adding function for adding a service object index to a service object based on an index adding operation of the service object by a user on an application page, the method comprising:
responding to a data acquisition instruction, acquiring at least one piece of service object newly-added data in a third party database, and generating a newly-added data table based on the service object newly-added data;
searching a target index adding function corresponding to each service object newly-added data in the newly-added data table according to a reflection mechanism, and configuring each service object newly-added data as a parameter in the corresponding target index adding function;
And adding or updating the service object index to the service object corresponding to the service object newly-added data through the configured target index adding function.
Optionally, the responding to the data obtaining instruction obtains at least one piece of service object newly-added data in a third party database, including:
responding to a data acquisition instruction, and executing a data acquisition task, wherein the data acquisition task is used for running a plurality of data extraction scripts at fixed time, and the plurality of data extraction scripts correspond to different third party databases;
and obtaining newly added data of the service object from a third party database corresponding to each data extraction script by running the data extraction script.
Optionally, after the performing the data acquisition task, the method further includes:
generating an operation batch number corresponding to a plurality of data extraction scripts in the operation, wherein the operation batch number comprises a third party database identifier corresponding to each data acquisition script;
if the data is obtained from the third-party database, generating abnormal alarm information based on the running batch number, and calling an information notification interface to send the abnormal alarm information to a preset receiver terminal so that a preset receiver can determine the database with the abnormality based on the third-party database identification.
Optionally, the running batch number further includes time stamps corresponding to the running multiple data extraction scripts; the generating a new data table based on the service object new data includes:
generating a temporary data table based on the service object newly-added data and the timestamp, wherein the newly-added data table comprises the temporary data table;
correspondingly, after the service object index is added or updated to the service object corresponding to the service object newly-added data through the configured target index adding function, the method further includes:
and determining the data table to be deleted in the temporary data table based on the timestamp corresponding to the temporary data table, and deleting the data table.
Optionally, the generating a new data table based on the service object new data includes:
and storing the newly added data of the service object as a temporary data table according to the sequence of the data configuration fields, wherein the newly added data table comprises the temporary data table.
Optionally, the method further comprises:
and responding to a data extraction script adding instruction, acquiring a data extraction script to be added, and adding the data extraction script to be added into the data acquisition task so as to regularly run a plurality of data extraction scripts containing the data extraction script to be added.
Optionally, the service system further includes a preset service function, and the method further includes:
searching a target preset service function corresponding to each service object newly-added data in the newly-added data table according to a reflection mechanism, and configuring each service object newly-added data as a parameter in the corresponding target preset service function;
and providing preset service functions for the service objects corresponding to the newly added data of the service objects through the configured target preset service functions.
According to another aspect of the present application, there is provided a data index adding apparatus, the apparatus including:
the data acquisition module is used for responding to a data acquisition instruction, acquiring at least one piece of service object newly-added data from a third party database and generating a newly-added data table based on the service object newly-added data;
the function matching module is used for searching a target index adding function corresponding to the newly added data of each service object in the newly added data table according to a reflection mechanism, and configuring the newly added data of each service object as a parameter in the corresponding target index adding function;
and the index adding module is used for adding or updating the service object index to the service object corresponding to the service object newly-added data through the configured target index adding function.
Optionally, the data acquisition module is further configured to:
responding to a data acquisition instruction, and executing a data acquisition task, wherein the data acquisition task is used for running a plurality of data extraction scripts at fixed time, and the plurality of data extraction scripts correspond to different third party databases;
and obtaining newly added data of the service object from a third party database corresponding to each data extraction script by running the data extraction script.
Optionally, the device further comprises an abnormality alarm module for:
generating an operation batch number corresponding to a plurality of data extraction scripts in the operation, wherein the operation batch number comprises a third party database identifier corresponding to each data acquisition script;
if the data is obtained from the third-party database, generating abnormal alarm information based on the running batch number, and calling an information notification interface to send the abnormal alarm information to a preset receiver terminal so that a preset receiver can determine the database with the abnormality based on the third-party database identification.
Optionally, the running batch number further includes time stamps corresponding to the running multiple data extraction scripts; the device also comprises a data table generation module for:
Generating a temporary data table based on the service object newly-added data and the timestamp, wherein the newly-added data table comprises the temporary data table;
optionally, the apparatus further comprises a data clearing module for:
and determining the data table to be deleted in the temporary data table based on the timestamp corresponding to the temporary data table, and deleting the data table.
Optionally, the data table generating module is further configured to:
and storing the newly added data of the service object as a temporary data table according to the sequence of the data configuration fields, wherein the newly added data table comprises the temporary data table.
Optionally, the apparatus further includes a script adding module configured to:
and responding to a data extraction script adding instruction, acquiring a data extraction script to be added, and adding the data extraction script to be added into the data acquisition task so as to regularly run a plurality of data extraction scripts containing the data extraction script to be added.
Optionally, the function matching module is further configured to:
searching a target preset service function corresponding to each service object newly-added data in the newly-added data table according to a reflection mechanism, and configuring each service object newly-added data as a parameter to the corresponding target preset service function, wherein the service system further comprises the preset service function; the method comprises the steps of carrying out a first treatment on the surface of the
Optionally, the index adding module is further configured to:
and providing preset service functions for the service objects corresponding to the newly added data of the service objects through the configured target preset service functions.
According to still another aspect of the present application, there is provided a storage medium having stored thereon a computer program which, when executed by a processor, implements the above-described data index adding method.
According to still another aspect of the present application, there is provided a computer apparatus including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, the processor implementing the above-mentioned data index adding method when executing the program.
By means of the technical scheme, the data index adding method and device, the storage medium and the computer equipment are applied to a service system, the service system comprises an index adding function, and the index adding function is used for adding a service object index for the service object based on index adding operation of a user on an application program page on the service object: responding to a data acquisition instruction, acquiring at least one piece of service object newly-added data from a third party database, and generating a newly-added data table based on the service object newly-added data; searching a target index adding function corresponding to each service object newly-added data in the newly-added data table according to the reflection mechanism, and configuring each service object newly-added data as a parameter in the corresponding target index adding function; and adding or updating the service object index to the service object corresponding to the new data of the service object through the configured target index adding function. The new data of the service object is obtained and stored in the new data table, the data in the new data table is used as parameters to call the index adding function to realize the adding or adding of the index of the service object, the index adding function corresponding to the data can be directly mapped and called according to the data, and the development flow is reduced.
The foregoing description is only an overview of the technical solutions of the present application, and may be implemented according to the content of the specification in order to make the technical means of the present application more clearly understood, and in order to make the above-mentioned and other objects, features and advantages of the present application more clearly understood, the following detailed description of the present application will be given.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
fig. 1 shows a flow chart of a data index adding method according to an embodiment of the present application;
FIG. 2 is a schematic flow chart of another method for adding a data index according to an embodiment of the present application;
FIG. 3 is a schematic flow chart of another method for adding a data index according to an embodiment of the present application;
FIG. 4 is a flowchart illustrating another method for adding a data index according to an embodiment of the present application;
fig. 5 shows a schematic structural diagram of a data index adding device according to an embodiment of the present application;
fig. 6 shows a schematic structural diagram of another data index adding device according to an embodiment of the present application.
Detailed Description
The present application will be described in detail hereinafter with reference to the accompanying drawings in conjunction with embodiments. It should be noted that, in the case of no conflict, the embodiments and features in the embodiments may be combined with each other.
In this embodiment, as shown in fig. 1, a data index adding method is provided, and is applied to a service system, where the service system includes an index adding function, and the index adding function is used to add a service object index to a service object based on an index adding operation of a user to the service object on an application page, and the method includes:
step 101, in response to a data acquisition instruction, acquiring at least one piece of service object newly-added data in a third party database, and generating a newly-added data table based on the service object newly-added data.
In the above embodiment of the present application, the method is applied to a service system, and the service system includes an index adding function for adding a service object index to a service object based on an index adding operation of the service object on an application page by a user. Specifically, the user may select a service object from application pages of the user terminal, such as a smart phone, a tablet, a computer, etc., then perform an index adding operation on the service object, and after the user triggers the index adding operation, the system responds to a data acquisition instruction to acquire at least one new data of the service object from a third party database, and generates a new data table based on the new data of the service object. The newly added data table may include: id: primary key, data_no: business data primary key, such as client number, data_type: service types, such as labels, etc., batch_no: synchronous data batch number, random number not repeated, each time task execution independently generates, user_no: operator, data_source: data source system, other_data: other data, large fields, need to use delimiters, op_time: operating time, status: state, 0 is unread, 1 is read.
Step 102, searching a target index adding function corresponding to each service object newly-added data in the newly-added data table according to a reflection mechanism, and configuring each service object newly-added data as a parameter to the corresponding target index adding function.
And searching a target index adding function corresponding to each service object newly-added data in the newly-added data table according to a reflection mechanism, and configuring each service object newly-added data as a parameter in the corresponding target index adding function. Specifically, after searching the target index adding function corresponding to each service object newly-added data in the newly-added data table according to the reflection mechanism, configuring the corresponding function and the service object newly-added data, calling the existing function () in the system by using the reflection mechanism, and executing the custMarketProgress (field 1, field2, field 3) if the script is configured.
And step 103, adding or updating the service object index to the service object corresponding to the new service object data through the configured target index adding function.
And adding or updating the service object index to the service object corresponding to the service object newly-added data through the configured target index adding function. Specifically, the addition or update of the service object index is performed according to the principles of the last come of the data. The method has the advantages that the traditional manual development is replaced by high-level configuration, the method is better applicable to continuous change of business logic, dynamic update and one-key release are supported, complex release processes are reduced, and development efficiency is greatly improved.
By applying the technical scheme of the embodiment, the service system comprises an index adding function, wherein the index adding function is used for adding a service object index for a service object based on the index adding operation of a user on an application page on the service object: responding to a data acquisition instruction, acquiring at least one piece of service object newly-added data from a third party database, and generating a newly-added data table based on the service object newly-added data; searching a target index adding function corresponding to each service object newly-added data in the newly-added data table according to the reflection mechanism, and configuring each service object newly-added data as a parameter in the corresponding target index adding function; and adding or updating the service object index to the service object corresponding to the new data of the service object through the configured target index adding function. The new data of the service object is obtained and stored in the new data table, the data in the new data table is used as parameters to call the index adding function to realize the adding or adding of the index of the service object, the index adding function corresponding to the data can be directly mapped and called according to the data, and the development flow is reduced.
Further, as a refinement and extension of the foregoing embodiment, in order to fully describe a specific implementation procedure of the present embodiment, another data index adding method is provided, as shown in fig. 2, applied to a service system, where the service system includes an index adding function, where the index adding function is used to add a service object index to a service object based on an index adding operation of a user to the service object on an application page, and the method includes:
In step 201, in response to a data acquisition instruction, a data acquisition task is executed, where the data acquisition task is used to regularly run a plurality of data extraction scripts, and the plurality of data extraction scripts correspond to different third party databases.
In the foregoing embodiments of the present application, in response to a data acquisition instruction, a data acquisition task is executed, where the data acquisition task is configured to periodically run a plurality of data extraction scripts, where the plurality of data extraction scripts correspond to different third party databases. Specifically, the timed interval may be preset, such as daily or weekly, to periodically run a plurality of data extraction scripts for data extraction after the data acquisition task is performed. The data extraction script is strongly associated with the service, and can be modified or added at any time after being released according to specific service rules, so that real-time release is supported. When more fields are used, the multiple fields can be spliced together by using separators and then stored in large fields (such as data1 and data2 and data 3). The execution frequency can be set independently through the timing task, so that the flexibility of the system is improved.
Step 202, obtaining newly added data of a service object from a third party database corresponding to each data extraction script by running the data extraction script.
And obtaining newly added data of the service object from a third party database corresponding to each data extraction script by running the data extraction script. Specifically, the running of the data extraction script flow is automatically executed by the system without service logic.
Step 203, generating an operation batch number corresponding to the plurality of data extraction scripts of the current operation, and if an abnormality occurs in the data acquired in the third party database, generating abnormality alarm information based on the operation batch number, wherein the operation batch number comprises a third party database identifier corresponding to each data acquisition script, and the operation batch number further comprises a timestamp corresponding to the plurality of data extraction scripts of the current operation.
Generating running batch numbers corresponding to a plurality of data extraction scripts of the current running, and generating abnormal alarm information based on the running batch numbers if the data are obtained from a third party database and are abnormal. The running batch number can be a random number which is not repeated, the running batch number comprises a third party database identifier corresponding to the data acquisition script, and the running batch number also comprises time stamps corresponding to a plurality of data extraction scripts of the running time, so that the data source can be queried according to the third party database identifier and the storage time of newly-added data of the service object can be determined through the time stamps.
And step 204, calling an information notification interface to send the abnormality alarm information to a preset receiver terminal so that the preset receiver can determine the database with the abnormality based on the third-party database identification.
And then, calling an information notification interface to send the abnormality alarm information to a preset receiver terminal so that the preset receiver can determine the database with the abnormality based on the third-party database identification. When the acquisition of all or part of data in the third-party database fails, an abnormal alarm is generated, and the abnormal database is sent together, so that a developer can search the source of an abnormal problem at the first time, the timely system maintenance is convenient, and the normal acquisition of the data is ensured.
Step 205, generating a temporary data table based on the service object newly added data and the timestamp, wherein the newly added data table includes the temporary data table.
And generating a temporary data table based on the service object newly added data and the time stamp. Specifically, the extracted new data of the service object may be stored in a temporary table (Oracle), where the new data table includes the temporary data table.
Step 206, searching a target index adding function corresponding to each service object newly-added data in the newly-added data table according to a reflection mechanism, and configuring each service object newly-added data as a parameter to the corresponding target index adding function.
Searching a target index adding function corresponding to each service object newly-added data in the newly-added data table according to a reflection mechanism, and configuring each service object newly-added data as a parameter in the corresponding target index adding function so that the index adding function can be directly called to realize the adding or updating of the service object index.
Step 207, adding or updating the service object index to the service object corresponding to the new data of the service object through the configured target index adding function.
And step 208, determining the data table to be deleted in the temporary data table based on the timestamp corresponding to the temporary data table, and deleting the data table.
And adding or updating the service object index to the service object corresponding to the new data of the service object through the configured target index adding function, so that the service object index is added or updated through acquiring the new data of the service object and calling the index adding function, and then determining and deleting the data table to be deleted in the temporary data table based on the timestamp corresponding to the temporary data table, so that the data in the temporary data table can be cleared regularly to reduce the memory.
By applying the technical scheme of the embodiment, the data acquisition task is executed in response to the data acquisition instruction, wherein the data acquisition task is used for running a plurality of data extraction scripts at regular time, and the plurality of data extraction scripts correspond to different third party databases. And acquiring newly added data of a service object from a third party database corresponding to each data extraction script by operating the data extraction script, generating operation batch numbers corresponding to a plurality of data extraction scripts operated at this time, if an abnormality occurs when the data is acquired from the third party database, generating abnormal alarm information based on the operation batch numbers, calling an information notification interface to send the abnormal alarm information to a preset receiver terminal, and enabling the preset receiver to determine that an abnormal database exists based on the third party database identification. Based on the service object newly-added data and the time stamp, a temporary data table is generated, a target index adding function corresponding to each service object newly-added data in the newly-added data table is searched according to a reflection mechanism, and each service object newly-added data is used as a parameter to be configured in the corresponding target index adding function. And adding or updating the service object index to the service object corresponding to the service object newly-added data through the configured target index adding function. And determining the data table to be deleted in the temporary data table based on the timestamp corresponding to the temporary data table, and deleting the data table. Through the combination of the data extraction script and the index adding function, the reusability of codes is improved, the cost of development and later maintenance is reduced, simultaneous processing of multiple types of services is supported, the method has strong expansibility, and meanwhile, data in a temporary data table can be cleared regularly to reduce the memory.
Further, as a refinement and extension of the foregoing embodiment, in order to fully describe a specific implementation procedure of the present embodiment, there is provided a further data index adding method, as shown in fig. 3, applied to a service system, where the service system includes an index adding function, where the index adding function is used to add a service object index to a service object based on an index adding operation of a user to the service object on an application page, where the method includes:
step 301, responding to a data extraction script adding instruction, obtaining a data extraction script to be added, and adding the data extraction script to be added into a data obtaining task so as to regularly run a plurality of data extraction scripts containing the data extraction script to be added.
In the above embodiment of the present application, a data extraction script to be added is obtained in response to a data extraction script adding instruction, and the data extraction script to be added is added to a data obtaining task, so as to regularly run a plurality of data extraction scripts including the data extraction script to be added. The data extraction script is strongly associated with the service and formulated according to specific service rules. The scripts can be modified or added at any time after the scripts are released, so that real-time release is supported. When more fields are available, the multiple fields can be spliced together by using separators and then stored in large fields.
Step 302, in response to a data acquisition instruction, a data acquisition task is executed, where the data acquisition task is used to regularly run a plurality of data extraction scripts, the plurality of data extraction scripts correspond to different third party databases, and new data of a service object is acquired in the third party database corresponding to each data extraction script by running the data extraction scripts.
And step 303, storing the newly added data of the service object as a temporary data table according to the sequence of the data configuration fields, wherein the newly added data table comprises the temporary data table.
And responding to the data acquisition instruction, executing a data acquisition task, wherein the data acquisition task is used for running a plurality of data extraction scripts at regular time, the data extraction scripts correspond to different third party databases, acquiring newly-added data of a service object in the third party database corresponding to each data extraction script by running the data extraction scripts, and storing the newly-added data of the service object as a temporary data table according to the sequence of data configuration fields, wherein the newly-added data table comprises the temporary data table. Specifically, the data configuration fields are stored in sequence, so that the integration and planning of the data can be facilitated.
Step 304, searching a target index adding function corresponding to each service object newly-added data in the newly-added data table according to a reflection mechanism, and configuring each service object newly-added data as a parameter to the corresponding target index adding function.
Searching a target index adding function corresponding to each service object newly-added data in the newly-added data table according to a reflection mechanism, and configuring each service object newly-added data as a parameter in the corresponding target index adding function so that the index adding function can be called to realize the adding or updating of the service object index.
And 305, adding or updating the service object index to the service object corresponding to the new service object data through the configured target index adding function.
The configured target index adding function is used for adding or updating the service object index of the service object corresponding to the new data of the service object, and the index adding function is called by combining the reflection technology to realize the index adding or updating of the service object, so that the complex version process is reduced, and the development efficiency is greatly improved.
By applying the technical scheme of the embodiment, the data extraction script to be added is obtained in response to the data extraction script adding instruction, and the data extraction script to be added is added into the data obtaining task so as to regularly run a plurality of data extraction scripts containing the data extraction script to be added. Responding to a data acquisition instruction, executing a data acquisition task, wherein the data acquisition task is used for running a plurality of data extraction scripts at regular time, the data extraction scripts correspond to different third party databases, acquiring service object newly-added data in the third party databases corresponding to each data extraction script by running the data extraction scripts, storing the service object newly-added data as a temporary data table according to a data configuration field sequence, searching a target index adding function corresponding to each service object newly-added data in the newly-added data table according to a reflection mechanism, and configuring each service object newly-added data as a parameter in the corresponding target index adding function. And adding or updating the service object index to the service object corresponding to the service object newly-added data through the configured target index adding function. Based on the timing task, the index adding function is called by using a parameter configuration form and combining the reflection technology to realize the index adding or updating of the service object, so that the complex version process is reduced, and the development efficiency is greatly improved.
Further, as a refinement and extension of the foregoing embodiment, in order to fully describe a specific implementation procedure of the present embodiment, there is provided a further data index adding method, as shown in fig. 4, applied to a service system, where the service system includes an index adding function, where the index adding function is used to add a service object index to a service object based on an index adding operation of a user to the service object on an application page, where the method includes:
step 401, in response to a data acquisition instruction, acquiring at least one piece of service object newly-added data in a third party database, and generating a newly-added data table based on the service object newly-added data.
In the above embodiment of the present application, at least one service object newly-added data is acquired in a third party database in response to a data acquisition instruction, and a newly-added data table is generated based on the service object newly-added data. So that the index addition function can be searched and invoked subsequently according to the newly added data table.
Step 402, searching a target preset service function corresponding to each service object newly-added data in the newly-added data table according to a reflection mechanism, and configuring each service object newly-added data as a parameter to the corresponding target preset service function.
Searching a target preset service function corresponding to each service object newly-added data in the newly-added data table according to a reflection mechanism, and configuring each service object newly-added data as a parameter in the corresponding target preset service function. After the target preset service function corresponding to the newly added data table is queried, the newly added data of each service object is used as a parameter to be configured in the corresponding target preset service function, and the configured preset service function can be directly called to realize the corresponding function.
Step 403, providing a preset service function for the service object corresponding to the new data of the service object through the configured target preset service function.
And providing preset service functions for the service objects corresponding to the newly added data of the service objects through the configured target preset service functions. Other preset service functions in the service system can be called to realize the preset service functions after the newly added data of the service object are acquired from the third-party data and configured, and other data sources can be dynamically added at any time in the later period.
By applying the technical scheme of the embodiment, at least one piece of service object newly-added data is acquired in a third party database in response to a data acquisition instruction, and a newly-added data table is generated based on the service object newly-added data. Searching a target preset service function corresponding to each service object newly-added data in the newly-added data table according to a reflection mechanism, and configuring each service object newly-added data as a parameter in the corresponding target preset service function. And providing preset service functions for the service objects corresponding to the newly added data of the service objects through the configured target preset service functions. Other preset service functions in the service system can be called to realize the preset service functions after the newly added data of the service object are acquired from the third-party data and configured, and other data sources can be dynamically added at any time in the later period.
Further, as a specific implementation of the method of fig. 1, an embodiment of the present application provides a data index adding device, as shown in fig. 5, including:
a data acquisition module 501, configured to acquire at least one service object newly-added data in a third party database in response to a data acquisition instruction, and generate a newly-added data table based on the service object newly-added data;
the function matching module 502 is configured to search a target index adding function corresponding to new data of each service object in the new data table according to a reflection mechanism, and configure each new data of the service object as a parameter to the corresponding target index adding function;
and the index adding module 503 is configured to add or update the service object index to the service object corresponding to the service object newly-added data through the configured target index adding function.
Optionally, the data acquisition module 501 is further configured to:
responding to a data acquisition instruction, and executing a data acquisition task, wherein the data acquisition task is used for running a plurality of data extraction scripts at fixed time, and the plurality of data extraction scripts correspond to different third party databases;
and obtaining newly added data of the service object from a third party database corresponding to each data extraction script by running the data extraction script.
Optionally, the function matching module 502 is further configured to:
searching a target preset service function corresponding to each service object newly-added data in the newly-added data table according to a reflection mechanism, and configuring each service object newly-added data as a parameter to the corresponding target preset service function, wherein the service system further comprises the preset service function;
optionally, the index adding module 503 is further configured to:
and providing preset service functions for the service objects corresponding to the newly added data of the service objects through the configured target preset service functions.
Further, another apparatus for adding a data index is provided in an embodiment of the present application, as shown in fig. 6, the apparatus includes:
the data acquisition module 601 is configured to acquire at least one service object newly-added data in a third party database in response to a data acquisition instruction, and generate a newly-added data table based on the service object newly-added data;
the function matching module 602 is configured to find a target index adding function corresponding to each service object newly added data in the newly added data table according to a reflection mechanism, and configure each service object newly added data as a parameter to the corresponding target index adding function;
And the index adding module 603 is configured to add or update a service object index to a service object corresponding to the service object newly-added data through the configured target index adding function.
The abnormality alarm module 604 is configured to generate an operation batch number corresponding to the multiple data extraction scripts for the current operation, if an abnormality occurs when data is acquired in the third party database, generate abnormality alarm information based on the operation batch number, and call an information notification interface to send the abnormality alarm information to a preset receiver terminal, so that the preset receiver determines that the database with the abnormality exists based on the third party database identifier, where the operation batch number includes the third party database identifier corresponding to each data acquisition script, and the operation batch number further includes a timestamp corresponding to the multiple data extraction scripts for the current operation.
And a data table generating module 605, configured to generate a temporary data table based on the service object newly added data and the timestamp, where the newly added data table includes the temporary data table.
The data clearing module 606 is configured to determine a data table to be deleted in the temporary data table based on the timestamp corresponding to the temporary data table, and delete the data table.
The script adding module 607 is configured to obtain a data extraction script to be added in response to a data extraction script adding instruction, and add the data extraction script to be added to the data obtaining task, so as to regularly run a plurality of data extraction scripts including the data extraction script to be added.
Optionally, the data acquisition module 601 is further configured to:
responding to a data acquisition instruction, and executing a data acquisition task, wherein the data acquisition task is used for running a plurality of data extraction scripts at fixed time, and the plurality of data extraction scripts correspond to different third party databases;
and obtaining newly added data of the service object from a third party database corresponding to each data extraction script by running the data extraction script.
Optionally, the data table generating module 605 is further configured to:
and storing the newly added data of the service object as a temporary data table according to the sequence of the data configuration fields, wherein the newly added data table comprises the temporary data table.
Optionally, the function matching module 602 is further configured to:
searching a target preset service function corresponding to each service object newly-added data in the newly-added data table according to a reflection mechanism, and configuring each service object newly-added data as a parameter to the corresponding target preset service function, wherein the service system further comprises the preset service function; the method comprises the steps of carrying out a first treatment on the surface of the
Optionally, the index adding module 603 is further configured to:
and providing preset service functions for the service objects corresponding to the newly added data of the service objects through the configured target preset service functions.
It should be noted that, other corresponding descriptions of each functional unit related to the data index adding device provided in the embodiment of the present application may refer to corresponding descriptions in the methods of fig. 1 to fig. 4, and are not repeated herein.
Based on the above-described methods shown in fig. 1 to 4, correspondingly, the embodiments of the present application further provide a storage medium having a computer program stored thereon, where the computer program, when executed by a processor, implements the above-described data index adding method shown in fig. 1 to 4.
Based on such understanding, the technical solution of the present application may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (may be a CD-ROM, a U-disk, a mobile hard disk, etc.), and includes several instructions for causing a computer device (may be a personal computer, a server, or a network device, etc.) to perform the methods described in various implementation scenarios of the present application.
Based on the methods shown in fig. 1 to fig. 4 and the virtual device embodiments shown in fig. 5 and fig. 6, in order to achieve the above objects, the embodiments of the present application further provide a computer device, which may specifically be a personal computer, a server, a network device, etc., where the computer device includes a storage medium and a processor; a storage medium storing a computer program; a processor for executing a computer program to implement the data index adding method as shown in fig. 1 to 4 described above.
Optionally, the computer device may also include a user interface, a network interface, a camera, radio Frequency (RF) circuitry, sensors, audio circuitry, WI-FI modules, and the like. The user interface may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (e.g., bluetooth interface, WI-FI interface), etc.
It will be appreciated by those skilled in the art that the architecture of a computer device provided in the present embodiment is not limited to the computer device, and may include more or fewer components, or may combine certain components, or may be arranged in different components.
The storage medium may also include an operating system, a network communication module. An operating system is a program that manages and saves computer device hardware and software resources, supporting the execution of information handling programs and other software and/or programs. The network communication module is used for realizing communication among all components in the storage medium and communication with other hardware and software in the entity equipment.
From the foregoing description of the embodiments, those skilled in the art will clearly understand that the present application may be implemented by means of software plus a necessary general hardware platform, or may be implemented by hardware, and applied to a service system, where the service system includes an index adding function for adding a service object index to a service object based on an index adding operation of a user to the service object on an application page: responding to a data acquisition instruction, acquiring at least one piece of service object newly-added data from a third party database, and generating a newly-added data table based on the service object newly-added data; searching a target index adding function corresponding to each service object newly-added data in the newly-added data table according to the reflection mechanism, and configuring each service object newly-added data as a parameter in the corresponding target index adding function; and adding or updating the service object index to the service object corresponding to the new data of the service object through the configured target index adding function. The new data of the service object is obtained and stored in the new data table, the data in the new data table is used as parameters to call the index adding function to realize the adding or adding of the index of the service object, the index adding function corresponding to the data can be directly mapped and called according to the data, and the development flow is reduced.
Those skilled in the art will appreciate that the drawings are merely schematic illustrations of one preferred implementation scenario, and that the modules or flows in the drawings are not necessarily required to practice the present application. Those skilled in the art will appreciate that modules in an apparatus in an implementation scenario may be distributed in an apparatus in an implementation scenario according to an implementation scenario description, or that corresponding changes may be located in one or more apparatuses different from the implementation scenario. The modules of the implementation scenario may be combined into one module, or may be further split into a plurality of sub-modules.
The foregoing application serial numbers are merely for description, and do not represent advantages or disadvantages of the implementation scenario. The foregoing disclosure is merely a few specific implementations of the present application, but the present application is not limited thereto and any variations that can be considered by a person skilled in the art shall fall within the protection scope of the present application.

Claims (10)

1. A data index adding method applied to a service system, the service system comprising an index adding function for adding a service object index to a service object based on an index adding operation of a user to the service object on an application page, the method comprising:
Responding to a data acquisition instruction, acquiring at least one piece of service object newly-added data in a third party database, and generating a newly-added data table based on the service object newly-added data;
searching a target index adding function corresponding to each service object newly-added data in the newly-added data table according to a reflection mechanism, and configuring each service object newly-added data as a parameter in the corresponding target index adding function;
and adding or updating the service object index to the service object corresponding to the service object newly-added data through the configured target index adding function.
2. The method of claim 1, wherein the obtaining, in response to the data obtaining instruction, at least one service object new data in the third party database comprises:
responding to a data acquisition instruction, and executing a data acquisition task, wherein the data acquisition task is used for running a plurality of data extraction scripts at fixed time, and the plurality of data extraction scripts correspond to different third party databases;
and obtaining newly added data of the service object from a third party database corresponding to each data extraction script by running the data extraction script.
3. The method of claim 2, wherein after the performing the data acquisition task, the method further comprises:
Generating an operation batch number corresponding to a plurality of data extraction scripts in the operation, wherein the operation batch number comprises a third party database identifier corresponding to each data acquisition script;
if the data is obtained from the third-party database, generating abnormal alarm information based on the running batch number, and calling an information notification interface to send the abnormal alarm information to a preset receiver terminal so that a preset receiver can determine the database with the abnormality based on the third-party database identification.
4. The method of claim 3, wherein the run lot number further comprises time stamps corresponding to the plurality of data extraction scripts run at the time; the generating a new data table based on the service object new data includes:
generating a temporary data table based on the service object newly-added data and the timestamp, wherein the newly-added data table comprises the temporary data table;
correspondingly, after the service object index is added or updated to the service object corresponding to the service object newly-added data through the configured target index adding function, the method further includes:
and determining the data table to be deleted in the temporary data table based on the timestamp corresponding to the temporary data table, and deleting the data table.
5. A method according to claim 3, wherein generating a new data table based on the service object new data comprises:
and storing the newly added data of the service object as a temporary data table according to the sequence of the data configuration fields, wherein the newly added data table comprises the temporary data table.
6. The method according to any one of claims 2 to 5, further comprising:
and responding to a data extraction script adding instruction, acquiring a data extraction script to be added, and adding the data extraction script to be added into the data acquisition task so as to regularly run a plurality of data extraction scripts containing the data extraction script to be added.
7. The method of claim 6, wherein the service system further comprises a preset service function; the method further comprises the steps of:
searching a target preset service function corresponding to each service object newly-added data in the newly-added data table according to a reflection mechanism, and configuring each service object newly-added data as a parameter in the corresponding target preset service function;
and providing preset service functions for the service objects corresponding to the newly added data of the service objects through the configured target preset service functions.
8. A data index adding apparatus, the apparatus comprising:
the data acquisition module is used for responding to a data acquisition instruction, acquiring at least one piece of service object newly-added data from a third party database and generating a newly-added data table based on the service object newly-added data;
the function matching module is used for searching a target index adding function corresponding to the newly added data of each service object in the newly added data table according to a reflection mechanism, and configuring the newly added data of each service object as a parameter in the corresponding target index adding function;
and the index adding module is used for adding or updating the service object index to the service object corresponding to the service object newly-added data through the configured target index adding function.
9. A storage medium having stored thereon a computer program, which when executed by a processor implements the data index addition method of any one of claims 1 to 7.
10. A computer device comprising a storage medium, a processor and a computer program stored on the storage medium and executable on the processor, characterized in that the processor implements the data index adding method of any one of claims 1 to 7 when executing the computer program.
CN202310444064.XA 2023-04-23 2023-04-23 Data index adding method and device, storage medium and computer equipment Pending CN116483834A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310444064.XA CN116483834A (en) 2023-04-23 2023-04-23 Data index adding method and device, storage medium and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310444064.XA CN116483834A (en) 2023-04-23 2023-04-23 Data index adding method and device, storage medium and computer equipment

Publications (1)

Publication Number Publication Date
CN116483834A true CN116483834A (en) 2023-07-25

Family

ID=87220840

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310444064.XA Pending CN116483834A (en) 2023-04-23 2023-04-23 Data index adding method and device, storage medium and computer equipment

Country Status (1)

Country Link
CN (1) CN116483834A (en)

Similar Documents

Publication Publication Date Title
CN107102941B (en) Test case generation method and device
CN107220142B (en) Method and device for executing data recovery operation
CN111859470B (en) Business data chaining method and device
CN103049515A (en) Method, device and equipment for classifying application programs
CN111309550A (en) Data acquisition method, system, equipment and storage medium of application program
CN108134696A (en) A kind of micro services configuration update method and device
CN103209153A (en) Method, device and system for processing messages
CN110162386B (en) Task issuing method and device
CN112115113A (en) Data storage system, method, device, equipment and storage medium
CN109408594B (en) Cross-chain data retrieval system based on block chain
CN111988429A (en) Algorithm scheduling method and system
CN107368407B (en) Information processing method and device
CN107291938B (en) Order inquiry system and method
CN112860662A (en) Data blood relationship establishing method and device, computer equipment and storage medium
CN110990350B (en) Log analysis method and device
CN116204540A (en) Operation log recording method, device, equipment and storage medium
CN112445861A (en) Information processing method, device, system and storage medium
CN113434742A (en) Account screening method and device, storage medium and electronic device
CN116703141A (en) Audit data processing method, audit data processing device, computer equipment and storage medium
CN116483834A (en) Data index adding method and device, storage medium and computer equipment
CN115563160A (en) Data processing method, data processing device, computer equipment and computer readable storage medium
CN108268545B (en) Method and device for establishing hierarchical user label library
CN110750561A (en) Method and device for mining associated application program
CN112035581B (en) Model-based task processing method, device, equipment and medium
CN115082038A (en) System integration method and device and electronic equipment

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