CN113722548A - Method and device for processing reference relationship in business system - Google Patents

Method and device for processing reference relationship in business system Download PDF

Info

Publication number
CN113722548A
CN113722548A CN202111005125.XA CN202111005125A CN113722548A CN 113722548 A CN113722548 A CN 113722548A CN 202111005125 A CN202111005125 A CN 202111005125A CN 113722548 A CN113722548 A CN 113722548A
Authority
CN
China
Prior art keywords
service
hash table
module
service data
business
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
CN202111005125.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.)
Beijing Skyguard Network Security Technology Co ltd
Original Assignee
Beijing Skyguard Network Security Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Skyguard Network Security Technology Co ltd filed Critical Beijing Skyguard Network Security Technology Co ltd
Priority to CN202111005125.XA priority Critical patent/CN113722548A/en
Publication of CN113722548A publication Critical patent/CN113722548A/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/90Details of database functions independent of the retrieved data types
    • G06F16/901Indexing; Data structures therefor; Storage structures
    • G06F16/9014Indexing; Data structures therefor; Storage structures hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/75Structural analysis for program understanding

Landscapes

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

Abstract

The invention discloses a processing method and device of a reference relationship in a business system, and relates to the technical field of computers. One embodiment of the method comprises: receiving module information of a plurality of business modules in a business system, reference relations among the business modules and reference relations among business data in the business modules; respectively constructing an internal hash table corresponding to each business module according to the module information; and respectively constructing an external hash table corresponding to each service data in each service module according to the reference relationship among the service modules and the reference relationship among the service data in the service modules, and storing the external hash table. The embodiment reduces the system load, shortens the system response time, and is beneficial to quickly inquiring and acquiring the reference relation in the service system; the development cost and the difficulty coefficient of code maintenance are reduced during processing, and the processing efficiency of the reference relation is improved.

Description

Method and device for processing reference relationship in business system
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a reference relationship in a business system.
Background
With the continuous development of internet services, the complexity of a service system is higher and higher, various references and dependency (referenced) relationships are inevitably generated between service modules implementing different functions in the service system and service data therein, and the reference relationship in the service system includes two layers: reference relationships between business modules, and reference relationships between business data. How to design a method and a device for efficiently processing a reference relationship aiming at the reference relationship in a business system to improve the stability and performance of the business system and improve user experience is a problem which needs to be solved at present.
The prior art has at least the following problems:
in the existing processing method for the reference relationship in the service system, the relevant information of the service module or the service data which is referred by the reference relationship is usually directly stored in the service module or the service data which needs to be referred, and the method is mainly suitable for the service system with a simpler reference relationship; meanwhile, when the reference relation needs to be processed, the required development cost is high, the difficulty coefficient of code maintenance is also high, and the processing efficiency of the reference relation is low; and when a user needs to acquire the reference relationship in the service system, the problems of difficulty in query and long consumed time exist.
Disclosure of Invention
In view of this, embodiments of the present invention provide a method and an apparatus for processing a reference relationship in a service system, which can store the reference relationship in the service system by using a nested hash structure composed of an inner hash table and an outer hash table, reduce system load, shorten system response time, and are also suitable for a service system with a complex reference relationship, and are also helpful for quickly querying and acquiring the reference relationship in the service system; by uniformly storing the reference relationship in the service system, when the reference relationship needs to be processed, the development cost can be reduced, the difficulty coefficient of code maintenance is reduced, and the processing efficiency of the reference relationship is improved.
In order to achieve the above object, according to a first aspect of the embodiments of the present invention, a method for processing a reference relationship in a business system is provided, including:
receiving module information of a plurality of business modules in a business system, reference relations among the business modules and reference relations among business data in the business modules; the module information comprises a service module number and a service data number;
respectively constructing an internal hash table corresponding to each business module according to the module information, wherein keys of the internal hash table are business module numbers of the business modules, and values of the internal hash table are a set of business data numbers in the business modules;
respectively constructing an external hash table corresponding to each service data in each service module according to the reference relationship among the service modules and the reference relationship among the service data in the service modules, and storing the external hash tables; the key of the external hash table is the service data number of the service data, and the value of the external hash table is the internal hash table corresponding to the service module with reference relation with the service data.
Further, respectively constructing an external hash table corresponding to each service data in each service module according to the reference relationship among the plurality of service modules and the reference relationship among the plurality of service data in each service module, including:
aiming at any service data in any service module, the following steps are executed:
determining candidate service modules with reference relations between the service modules corresponding to the service data and internal hash tables corresponding to the candidate service modules according to the reference relations among the plurality of service modules;
determining target business data with reference relation with the business data according to the reference relation among the business data in the plurality of business modules;
updating the candidate service module and the corresponding internal hash table according to the target service data;
constructing an outer hash table corresponding to the service data according to the service data number of the service data, the updated candidate service module and the updated inner hash table; and the number of the values of the external hash table is consistent with the number of the updated candidate service modules.
Further, still include:
and receiving a reference relation updating request, and updating the outer hash table according to the reference relation updating request.
Further, if the reference relationship update request is a reference relationship addition request between the service data, receiving the reference relationship update request, and updating the external hash table according to the reference relationship update request, including:
inquiring the stored external hash table according to the service data number of the quoting party and the service data number of the quoted party in the quoting relation adding request;
judging whether a first external hash table exists or not, wherein a key of the first external hash table is a service data number of a quoted party;
if so, judging whether a first internal hash table exists in the values of the first external hash table, wherein the key of the first internal hash table is the number of the business module of the citation party; if so, inserting the service data of the citation party into the value of the first internal hash table; if not, adding a first internal hash table taking the serial number of the functional module of the citation party as a key in the value of the first external hash table;
and if the functional module number does not exist, creating a first internal hash table taking the functional module number of the reference party as a key, and inserting the first internal hash table into the value of the first external hash table.
Further, if the reference relationship update request is a reference relationship deletion request between the service data, receiving the reference relationship update request, and updating the external hash table according to the reference relationship update request, including:
determining the service data number of the quoting party and the service data number of the quoted party according to the quoting relation deletion request;
determining a second external hash table according to the service data number of the quoted party, and determining a second internal hash table according to the second external hash table and the service data number of the quoted party; the key of the second external hash table is the service data number of the quoted party; the key of the second inner hash table is the number of the business module of the citation party;
and deleting the service data number of the reference party in the value of the second internal hash table.
Further, if the reference relationship update request indicates to delete the service data in the service module, receiving the reference relationship update request, and updating the external hash table according to the reference relationship update request, including:
judging whether a third external hash table with the service data number indicated to be deleted as a key exists in the stored external hash tables;
if yes, sending prompt information to the user;
and if the reference relation does not exist, the service data in the service module which is indicated to be deleted by the reference relation updating request is deleted.
Further, still include:
and receiving a reference relation display request, inquiring the stored external hash table and internal hash table according to the service module number and/or the service data number indicated in the reference relation display request to acquire a target reference relation corresponding to the service module number and/or the service data number, and displaying the target reference relation.
Further, after the step of receiving module information of a plurality of business modules in the business system, reference relations among the plurality of business modules, and reference relations among business data in the plurality of business modules, the method further comprises:
determining at least one basic service module only having a referenced relation according to the referenced relation among the plurality of service modules;
respectively constructing a tree-shaped storage structure corresponding to the basic service module by taking the basic service module as a root node according to the reference relationship among the plurality of service modules; and each node of the tree-shaped storage structure stores the module information of the corresponding service module.
According to a second aspect of the embodiments of the present invention, there is provided a processing apparatus for a reference relationship in a business system, including:
the receiving module is used for receiving module information of a plurality of business modules in the business system, reference relations among the business modules and reference relations among business data in the business modules; the module information comprises a service module number and a service data number;
the internal hash table building module is used for respectively building an internal hash table corresponding to each service module according to the module information, wherein keys of the internal hash tables are service module numbers of the service modules, and values of the internal hash tables are a set of service data numbers in the service modules;
the storage module is used for respectively constructing an external hash table corresponding to each service data in each service module according to the reference relationship among the service modules and the reference relationship among the service data in the service modules, and storing the external hash table; the key of the external hash table is the service data number of the service data, and the value of the external hash table is the internal hash table corresponding to the service module with reference relation with the service data.
According to a third aspect of embodiments of the present invention, there is provided an electronic apparatus, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for processing the reference relationship in any business system as described above.
According to a fourth aspect of the embodiments of the present invention, there is provided a computer-readable medium, on which a computer program is stored, which when executed by a processor, implements a processing method of a reference relationship in any one of the business systems as described above.
One embodiment of the above invention has the following advantages or benefits: the method adopts the module information of a plurality of business modules in the receiving business system, the reference relation among the business modules and the reference relation among the business data in the business modules; the module information comprises a service module number and a service data number; respectively constructing an internal hash table corresponding to each business module according to the module information, wherein keys of the internal hash table are business module numbers of the business modules, and values of the internal hash table are a set of business data numbers in the business modules; respectively constructing an external hash table corresponding to each service data in each service module according to the reference relationship among the service modules and the reference relationship among the service data in the service modules, and storing the external hash tables; the key of the external hash table is a service data number of the service data, and the value of the external hash table is a technical means of the internal hash table corresponding to the service module having a reference relation with the service data, so that the technical means of the existing method, which is only applicable to the service system having a simple reference relation, is overcome, when the complex coefficient of the reference relation in the service system is increased, the system load is increased, the system response time is prolonged, and the risk of causing the downtime of the service system is existed; when the reference relationship needs to be processed, the required development cost is high, the difficulty coefficient of code maintenance is high, the query difficulty is high, and the time consumption is long, so that the reference relationship in the service system is stored by adopting a nested hash structure consisting of an inner hash table and an outer hash table, the system load is reduced, the system response time is shortened, the method is also suitable for the service system with a more complex reference relationship, and meanwhile, the reference relationship in the service system is favorably and quickly queried and acquired; by uniformly storing the reference relationship in the service system, when the reference relationship needs to be processed, the development cost can be reduced, and the technical effect of the difficulty coefficient of code maintenance is reduced.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
fig. 1 is a schematic diagram of a main flow of a processing method of a reference relationship in a business system provided according to a first embodiment of the present invention;
fig. 2a is a schematic diagram of a main flow of a processing method of a reference relationship in a business system provided according to a second embodiment of the present invention;
FIG. 2b is a schematic diagram of the main flow of updating the hash table in the method of FIG. 2 a;
FIG. 2c is a schematic diagram of a tree-like storage structure constructed in the method of FIG. 2 a;
FIG. 2d is a schematic diagram of an external hash table constructed in the method of FIG. 2 a;
FIG. 2e is a schematic diagram of another external hash table constructed in the method of FIG. 2 a;
FIG. 3 is a schematic diagram of the main modules of a processing apparatus for referencing relationships in a business system provided according to an embodiment of the present invention;
FIG. 4 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 5 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of a processing method of a reference relationship in a business system provided according to a first embodiment of the present invention; as shown in fig. 1, a method for processing a reference relationship in a service system provided in an embodiment of the present invention mainly includes:
step S101, receiving module information of a plurality of business modules in a business system, reference relations among the business modules and reference relations among business data in the business modules; the module information comprises a service module number and a service data number.
Specifically, according to the embodiment of the present invention, the reference relationship between the service modules and the reference relationship between the service data are determined during the construction process of the service system. One service module number corresponds to at least one service data number, and the service data is service data corresponding to a service function executing a corresponding service (implementing a corresponding function).
Further, according to the embodiment of the present invention, after the step of receiving the module information of the plurality of service modules, the reference relationship between the plurality of service modules, and the reference relationship between the service data in the plurality of service modules in the service system, the method further includes:
determining at least one basic service module only having a referenced relation according to the referenced relation among the plurality of service modules;
respectively constructing a tree-shaped storage structure corresponding to the basic service module by taking the basic service module as a root node according to the reference relationship among the plurality of service modules; and each node of the tree-shaped storage structure stores the module information of the corresponding service module.
Through the arrangement, the service module only with the referenced relation (namely, other service modules do not need to be referenced, the service module belongs to the basic service module in the service system, and other service modules need to be referenced when executing corresponding services) is used as the root node to construct the tree-shaped storage structure, the service module referencing the basic service module or indirectly referencing the basic service module is used as the middle node of the tree-shaped storage structure, and the module information of the corresponding service module is stored in each node, so that the reference relation among a plurality of service modules in the service system is quickly and comprehensively determined, and the situations of disorder, downtime and the like in the execution process of the service system caused by omission are avoided when a developer writes codes.
And step S102, respectively constructing an internal hash table corresponding to each service module according to the module information, wherein the key of the internal hash table is the service module number of the service module, and the value of the internal hash table is the collection of service data numbers in the service module.
Specifically, the reference between the service modules in the service system refers to different service data in the service modules substantially according to different specific services. Through the arrangement, the inner hash table corresponding to each service module is constructed, which is beneficial to displaying all service data corresponding to the service module, so that the external hash table based on the service data is constructed in combination with the reference relation between the service data in the follow-up process, and the nested hash tables of the reference relation between the service modules and the service data in the service system are sequentially constructed, so that the embodiment of the invention is suitable for the service system with more complex reference relation, simultaneously, the system load is reduced, the system response time is shortened, and the reference relation in the service system is beneficial to being quickly inquired and obtained.
Step S103, respectively constructing an external hash table corresponding to each service data in each service module according to the reference relationship among the plurality of service modules and the reference relationship among the plurality of service data in each service module, and storing the external hash tables; the key of the external hash table is the service data number of the service data, and the value of the external hash table is the internal hash table corresponding to the service module with reference relation with the service data.
According to the embodiment of the invention, the external hash table constructed according to the service data is characterized in that the number of the referenced service data is used as the key of the external hash table, taking the inner hash table corresponding to the service module (the service module of the reference party) with reference relation with the service data as the value of the outer hash table, according to the above description, it can be known that the construction of the outer hash table not only combines the reference relationship between a plurality of business modules, but also considers the reference relationship between the business data in the business modules, and therefore, it can be understood that, the value of the external hash table (i.e. the internal hash table corresponding to the service module of the citation party) needs to be updated by combining the reference relationship between multiple service data to the service data number set in the internal hash table, and only reserving the service data number of the service data of the quoting party which quotes the quoted service data in the service data number set corresponding to the value of the internal hash table.
According to the embodiment of the invention, the business module of the quoted party is taken as the first module, the business data of the quoted party is taken as the first data, the business module of the quoted party is taken as the second module, and the business data of the quoted party is taken as the second data, so that the business data number set of the second data in the internal hash table corresponding to the second module is in the value of the external hash table corresponding to the first data.
Specifically, according to the embodiment of the present invention, the respectively constructing the external hash table corresponding to each service data in each service module according to the reference relationship among the plurality of service modules and the reference relationship among the plurality of service data in each service module includes:
aiming at any service data in any service module, the following steps are executed:
determining candidate service modules with reference relations between the service modules corresponding to the service data and internal hash tables corresponding to the candidate service modules according to the reference relations among the plurality of service modules;
determining target business data with reference relation with the business data according to the reference relation among the business data in the plurality of business modules;
updating the candidate service module and the corresponding internal hash table according to the target service data;
constructing an outer hash table corresponding to the service data according to the service data number of the service data, the updated candidate service module and the updated inner hash table; and the number of the values of the external hash table is consistent with the number of the updated candidate service modules.
Preferably, according to an embodiment of the present invention, the method further includes:
and receiving a reference relation updating request, and updating the outer hash table according to the reference relation updating request.
Through the arrangement, after the request for updating the reference relationship is received, the reference relationship in the business system is updated based on the stored external hash table (including the internal hash table, which is the value of the external hash table), and the reference relationship among a plurality of business modules/business data in the business system can be rapidly and comprehensively obtained, so that when a developer writes codes, the situations that the execution process of the business system is disordered and crashed and the like due to the fact that the reference relationship among certain or some business modules of the business data is omitted are effectively avoided.
Illustratively, according to an embodiment of the present invention, if the reference relationship update request is a new reference relationship addition request between service data, the receiving a reference relationship update request, and updating the external hash table according to the reference relationship update request includes:
inquiring the stored external hash table according to the service data number of the quoting party and the service data number of the quoted party in the quoting relation adding request;
judging whether a first external hash table exists or not, wherein a key of the first external hash table is a service data number of a quoted party;
if so, judging whether a first internal hash table exists in the values of the first external hash table, wherein the key of the first internal hash table is the number of the business module of the citation party; if so, inserting the service data of the citation party into the value of the first internal hash table; if not, adding a first internal hash table taking the serial number of the functional module of the citation party as a key in the value of the first external hash table;
and if the functional module number does not exist, creating a first internal hash table taking the functional module number of the reference party as a key, and inserting the first internal hash table into the value of the first external hash table.
The embodiment shows that when the reference relationship is newly added, the reference relationship in the recorded service system is directly adjusted in the original nested hash table, so that the consumed storage resource is effectively reduced, developers and users can quickly determine the adjusted reference relationship, and the user experience is improved.
Illustratively, according to an embodiment of the present invention, if the reference relationship update request is a reference relationship deletion request between service data, receiving the reference relationship update request, and updating the external hash table according to the reference relationship update request, includes:
determining the service data number of the quoting party and the service data number of the quoted party according to the quoting relation deletion request;
determining a second external hash table according to the service data number of the quoted party, and determining a second internal hash table according to the second external hash table and the service data number of the quoted party; the key of the second external hash table is the service data number of the quoted party; the key of the second inner hash table is the number of the business module of the citation party;
and deleting the service data number of the reference party in the value of the second internal hash table.
The above embodiment shows that when deleting a reference relationship, a corresponding second external hash table may be determined by a service data number of a referent, a second internal hash table may be determined by combining the service data number of the referent, and then the service data number of the referent in the second internal hash table may be directly deleted, so that a group of reference relationships to be deleted is deleted in a reference relationship of a service system recorded in a nested hash table composed of the internal hash table and the external hash table.
Illustratively, according to the embodiment of the present invention, if the reference relationship update request indicates to delete the service data in the service module, the receiving of the reference relationship update request and the updating of the external hash table according to the reference relationship update request include:
judging whether a third external hash table with the service data number indicated to be deleted as a key exists in the stored external hash tables;
if yes, sending prompt information to the user;
and if the reference relation does not exist, the service data in the service module which is indicated to be deleted by the reference relation updating request is deleted.
Through the arrangement, before deleting the service data in a certain service module, whether a third external hash table with the service data number to be deleted as a key exists needs to be judged, if yes, the fact that the existing reference relationship in the service system exists the reference relationship for referring to the service data to be deleted is indicated, and therefore prompt information needs to be sent to a user, wherein the prompt information indicates the service module for referring to the service data to be deleted and the specifically-referenced service data, so that the user can conveniently determine whether to delete the service data, and if the user indicates to delete the service data, the third external hash table with the service data number to be deleted as a key needs to be deleted integrally; meanwhile, it is also necessary to determine whether the service data to be deleted exists in other internal hash tables, and if so, the service data to be deleted also needs to be deleted in the internal hash tables (that is, the reference relationship update request is a case described by a reference relationship deletion request between service data); if the reference relation does not exist, the reference relation for referring the service data to be deleted does not exist in the existing reference relation in the service system, so that the service data in the service module can be directly deleted.
Illustratively, according to an embodiment of the present invention, the method further includes:
and receiving a reference relation display request, inquiring the stored external hash table and internal hash table according to the service module number and/or the service data number indicated in the reference relation display request to acquire a target reference relation corresponding to the service module number and/or the service data number, and displaying the target reference relation.
According to a specific implementation manner of the embodiment of the invention, the external hash table and the internal hash table can be queried as well as the tree-shaped storage structure constructed above for the reference relationship display request. The two query modes can quickly query and acquire the reference relation in the service system.
According to the technical scheme of the embodiment of the invention, the module information of a plurality of service modules in the service system, the reference relation among the service modules and the reference relation among the service data in the service modules are received; the module information comprises a service module number and a service data number; respectively constructing an internal hash table corresponding to each business module according to the module information, wherein keys of the internal hash table are business module numbers of the business modules, and values of the internal hash table are a set of business data numbers in the business modules; respectively constructing an external hash table corresponding to each service data in each service module according to the reference relationship among the service modules and the reference relationship among the service data in the service modules, and storing the external hash tables; the key of the external hash table is a service data number of the service data, and the value of the external hash table is a technical means of the internal hash table corresponding to the service module having a reference relation with the service data, so that the technical means of the existing method, which is only applicable to the service system having a simple reference relation, is overcome, when the complex coefficient of the reference relation in the service system is increased, the system load is increased, the system response time is prolonged, and the risk of causing the downtime of the service system is existed; when the reference relationship needs to be processed, the required development cost is high, the difficulty coefficient of code maintenance is high, the query difficulty is high, and the time consumption is long, so that the reference relationship in the service system is stored by adopting a nested hash structure consisting of an inner hash table and an outer hash table, the system load is reduced, the system response time is shortened, the method is also suitable for the service system with a more complex reference relationship, and meanwhile, the reference relationship in the service system is favorably and quickly queried and acquired; by uniformly storing the reference relationship in the service system, when the reference relationship needs to be processed, the development cost can be reduced, and the technical effect of the difficulty coefficient of code maintenance is reduced.
Fig. 2a is a schematic diagram of a main flow of a processing method of a reference relationship in a business system provided according to a second embodiment of the present invention; as shown in fig. 2a, the method for processing a reference relationship in a service system provided in the embodiment of the present invention mainly includes:
step S201, receiving module information of a plurality of business modules in a business system, reference relations among the business modules and reference relations among business data in the business modules; the module information comprises a service module number and a service data number.
Specifically, according to the embodiment of the present invention, the reference relationship between the service modules and the reference relationship between the service data are both determined during the construction process of the service system, and particularly for the service system with a relatively complex reference relationship, the above configuration is adopted to obtain a plurality of reference relationships determined during the construction of the service system, which is beneficial to subsequently storing the reference relationships in the form of a nested hash table, so that the reference relationships can be rapidly and comprehensively displayed when a subsequent user inquires the reference relationships; meanwhile, when the reference relationship is processed (such as newly added or deleted), the reference relationship of the service system can be quickly adjusted through the nested hash table, and meanwhile, for the deletion process, the influence of the execution of the deletion process on the reference relationship of the current service system can be quickly determined, and prompt information is sent to a user.
Step S202, determining at least one basic service module only having a referenced relation according to the referenced relation among a plurality of service modules; respectively constructing a tree-shaped storage structure corresponding to the basic service module by taking the basic service module as a root node according to the reference relationship among the plurality of service modules; and each node of the tree-shaped storage structure stores the module information of the corresponding service module.
According to the embodiment of the invention, in the process of building the service system, partial basic service modules, such as account modules, are set for storing login account information, administrator account information and the like; if the other modules need to realize the functions of login or control management, the related information of the account module needs to be called to verify the login information so as to realize the management after login/login. For a base business module, such as an account module, it belongs to a business module that is only referenced. The basic service module is used as a root node, a tree-shaped storage structure is constructed by combining the reference relations among a plurality of service modules, the service module which refers to the basic service module or indirectly refers to the basic service module is used as a middle node of the tree-shaped storage structure, and the module information of the corresponding service module is stored in each node. It can be understood that if there are multiple basic service modules, multiple tree-like storage structures will be finally constructed.
According to a specific implementation manner of the embodiment of the present invention, as shown in fig. 2c, an oval frame represents a service module, and fig. 2c represents a tree-like storage structure corresponding to a basic service module 5, it can be seen that service modules 2, 7, and 11 all have a direct reference relationship to the basic service module 5, while a service module 3 has a direct reference relationship to the service modules 2 and 7, and a service module 8 has a direct reference relationship to the service module 7, so that the service modules 3 and 8 refer to the basic service module 5 indirectly through other service modules.
Through the setting, the reference relation among a plurality of service modules in the service system can be quickly and comprehensively determined by utilizing the tree-shaped storage structure, so that the situations of disorder, downtime and the like in the execution process of the service system caused by omission are avoided when developers write codes.
Step S203, respectively constructing an internal hash table corresponding to each service module according to the module information, wherein the key of the internal hash table is the service module number of the service module, and the value of the internal hash table is the collection of the service data numbers in the service module.
Specifically, the reference between the service modules in the service system refers to different service data in the service modules substantially according to different specific services; for example, if the role module wants to realize the login of the administrator, the role module refers to the account information of the administrator in the account module; and if the role module wants to realize the login of the user, the role module refers to the account information of the corresponding user in the account module. Through the arrangement, the inner hash table corresponding to each service module is constructed, which is beneficial to displaying all service data corresponding to the service module, so that the external hash table based on the service data is constructed in combination with the reference relation between the service data in the follow-up process, and the nested hash tables of the reference relation between the service modules and the service data in the service system are sequentially constructed, so that the embodiment of the invention is suitable for the service system with more complex reference relation, simultaneously, the system load is reduced, the system response time is shortened, and the reference relation in the service system is beneficial to being quickly inquired and obtained.
Step S204, determining candidate service modules with reference relations between the service modules corresponding to the service data and internal hash tables corresponding to the candidate service modules according to the reference relations among the plurality of service modules; determining target business data with reference relation with the business data according to the reference relation among the business data in the plurality of business modules; updating the candidate service module and the corresponding internal hash table according to the target service data; constructing an outer hash table corresponding to the service data according to the service data number of the service data, the updated candidate service module and the updated inner hash table; and the number of the values of the external hash table is consistent with the number of the updated candidate service modules.
According to a specific implementation manner of the embodiment of the present invention, the service module of the referenced party is used as the first module, the service data of the referenced party is used as the first data, the service module of the referencing party is used as the second module, and the service data of the referencing party is used as the second data, so that the value of the outer hash table corresponding to the first data is a set of service data numbers of the second data in the inner hash table corresponding to the second module.
In the above arrangement, the external hash table constructed based on the service data uses the service data number (referred service data number) of the first data as a key of the external hash table, and uses the internal hash table corresponding to the second module (referred service module) having a reference relationship with the service data as a value of the external hash table. According to the above description, it can be known that the construction of the external hash table not only combines the reference relationship among the plurality of service modules, but also considers the reference relationship among the service data in the service modules, and therefore, it can be understood that the value of the external hash table (i.e., the internal hash table corresponding to the service module of the reference party) needs to be updated to the service data number set in the internal hash table in combination with the reference relationship among the plurality of service data, and in the service data number set corresponding to the value of the internal hash table, only the service data number of the reference party service data which references the referenced service data is reserved.
Specifically, as shown in fig. 2d and 2e, oval-shaped boxes represent service modules, and rectangular boxes represent service data. Fig. 2d is an external hash table constructed by the basic service data 511 in the basic service module 5, and it can be known that the service data 702, 705, and 712 in the service module 7 have a reference relationship with the service data 511; fig. 2e shows an external hash table constructed by the basic service data 702 in the non-basic service module 7, and it can be seen that the service data 306 in the service module 3 and the service data 803 and 816 in the service module 8 both have a reference relationship with the service data 702.
Step S205, receiving the reference relationship update request, and updating the external hash table according to the reference relationship update request.
Specifically, as shown in fig. 2b, the reference update request in step S205 mainly indicates three cases of a newly added reference relationship (reference relationship newly added request), a reference relationship to be deleted (reference relationship deleted request), and service data to be deleted (service data deleted request), and specifically the following steps are performed:
step S2051, receiving a new quote relationship request, and inquiring a stored external hash table according to the service data number of the quote party and the service data number of the quoted party in the new quote relationship request; judging whether a first external hash table exists or not, wherein a key of the first external hash table is a service data number of a quoted party; if so, judging whether a first internal hash table exists in the values of the first external hash table, wherein the key of the first internal hash table is the number of the business module of the citation party; if so, inserting the service data of the citation party into the value of the first internal hash table; if not, adding a first internal hash table taking the serial number of the functional module of the citation party as a key in the value of the first external hash table; and if the functional module number does not exist, creating a first internal hash table taking the functional module number of the reference party as a key, and inserting the first internal hash table into the value of the first external hash table.
The embodiment shows that when the reference relationship is newly added, the reference relationship in the recorded service system is directly adjusted in the original nested hash table, so that the consumed storage resource is effectively reduced, developers and users can quickly determine the adjusted reference relationship, and the user experience is improved.
Step S2052, receiving a reference relation deleting request, and determining the service data number of the reference party and the service data number of the referenced party according to the reference relation deleting request; determining a second external hash table according to the service data number of the quoted party, and determining a second internal hash table according to the second external hash table and the service data number of the quoted party; the key of the second external hash table is the service data number of the quoted party; the key of the second inner hash table is the number of the business module of the citation party; and deleting the service data number of the reference party in the value of the second internal hash table.
The above embodiment shows that when deleting a reference relationship, a corresponding second external hash table may be determined by a service data number of a referent, a second internal hash table may be determined by combining the service data number of the referent, and then the service data number of the referent in the second internal hash table may be directly deleted, so that a group of reference relationships to be deleted is deleted in a reference relationship of a service system recorded in a nested hash table composed of the internal hash table and the external hash table.
Step S2053, receiving the service data deletion request, and determining whether a third external hash table keyed by the service data number indicated for deletion exists in the stored external hash tables; if yes, sending prompt information to the user; and if the reference relation does not exist, the service data in the service module which is indicated to be deleted by the reference relation updating request is deleted.
Through the arrangement, before deleting the service data in a certain service module, whether a third external hash table with the service data number to be deleted as a key exists needs to be judged, if yes, the fact that the existing reference relationship in the service system exists the reference relationship for referring to the service data to be deleted is indicated, and therefore prompt information needs to be sent to a user, wherein the prompt information indicates the service module for referring to the service data to be deleted and the specifically-referenced service data, so that the user can conveniently determine whether to delete the service data, and if the user indicates to delete the service data, the third external hash table with the service data number to be deleted as a key needs to be deleted integrally; meanwhile, it is also necessary to determine whether the service data to be deleted exists in other internal hash tables, and if so, the service data to be deleted also needs to be deleted in the internal hash tables (that is, the reference relationship update request is a case described by a reference relationship deletion request between service data); if the reference relation does not exist, the reference relation for referring the service data to be deleted does not exist in the existing reference relation in the service system, so that the service data in the service module can be directly deleted.
Step S206, receiving the reference relationship display request, inquiring the stored external hash table and internal hash table according to the service module number and/or the service data number indicated in the reference relationship display request to obtain the target reference relationship corresponding to the service module number and/or the service data number, and displaying the target reference relationship.
It should be noted that, when receiving the presentation request, the target reference relationship may be determined according to the nested hash table, or may be determined by querying the tree storage structure.
According to the technical scheme of the embodiment of the invention, the module information of a plurality of service modules in the service system, the reference relation among the service modules and the reference relation among the service data in the service modules are received; the module information comprises a service module number and a service data number; respectively constructing an internal hash table corresponding to each business module according to the module information, wherein keys of the internal hash table are business module numbers of the business modules, and values of the internal hash table are a set of business data numbers in the business modules; respectively constructing an external hash table corresponding to each service data in each service module according to the reference relationship among the service modules and the reference relationship among the service data in the service modules, and storing the external hash tables; the key of the external hash table is a service data number of the service data, and the value of the external hash table is a technical means of the internal hash table corresponding to the service module having a reference relation with the service data, so that the technical means of the existing method, which is only applicable to the service system having a simple reference relation, is overcome, when the complex coefficient of the reference relation in the service system is increased, the system load is increased, the system response time is prolonged, and the risk of causing the downtime of the service system is existed; when the reference relationship needs to be processed, the required development cost is high, the difficulty coefficient of code maintenance is high, the query difficulty is high, and the time consumption is long, so that the reference relationship in the service system is stored by adopting a nested hash structure consisting of an inner hash table and an outer hash table, the system load is reduced, the system response time is shortened, the method is also suitable for the service system with a more complex reference relationship, and meanwhile, the reference relationship in the service system is favorably and quickly queried and acquired; by uniformly storing the reference relationship in the service system, when the reference relationship needs to be processed, the development cost can be reduced, and the technical effect of the difficulty coefficient of code maintenance is reduced.
FIG. 3 is a schematic diagram of the main modules of a processing apparatus for referencing relationships in a business system provided according to an embodiment of the present invention; as shown in fig. 3, a processing apparatus 300 for referencing relationships in a business system according to an embodiment of the present invention mainly includes:
a receiving module 301, configured to receive module information of multiple service modules in a service system, reference relationships among the multiple service modules, and reference relationships among service data in the multiple service modules; the module information comprises a service module number and a service data number.
Specifically, according to the embodiment of the present invention, the reference relationship between the service modules and the reference relationship between the service data are determined during the construction process of the service system. One service module number corresponds to at least one service data number, and the service data is service data corresponding to a service function executing a corresponding service (implementing a corresponding function).
Further, according to the embodiment of the present invention, after the step of receiving the module information of the plurality of service modules, the reference relationship among the plurality of service modules, and the reference relationship among the plurality of service data in the service modules in the service system, the processing apparatus 300 for reference relationship in the service system further includes a tree-like storage structure constructing module, configured to:
determining at least one basic service module only having a referenced relation according to the referenced relation among the plurality of service modules;
respectively constructing a tree-shaped storage structure corresponding to the basic service module by taking the basic service module as a root node according to the reference relationship among the plurality of service modules; and each node of the tree-shaped storage structure stores the module information of the corresponding service module.
Through the arrangement, the service module only with the referenced relation (namely, other service modules do not need to be referenced, the service module belongs to the basic service module in the service system, and other service modules need to be referenced when executing corresponding services) is used as the root node to construct the tree-shaped storage structure, the service module referencing the basic service module or indirectly referencing the basic service module is used as the middle node of the tree-shaped storage structure, and the module information of the corresponding service module is stored in each node, so that the reference relation among a plurality of service modules in the service system is quickly and comprehensively determined, and the situations of disorder, downtime and the like in the execution process of the service system caused by omission are avoided when a developer writes codes.
And an inner hash table construction module 302, configured to respectively construct an inner hash table corresponding to each service module according to the module information, where a key of the inner hash table is a service module number of the service module, and a value of the inner hash table is a set of service data numbers in the service module.
The quoting among all service modules in the service system quotes different service data in the service modules according to the difference of specific services; for example, if the role module wants to realize the login of the administrator, the role module refers to the account information of the administrator in the account module; and if the role module wants to realize the login of the user, the role module refers to the account information of the corresponding user in the account module. Through the arrangement, the inner hash table corresponding to each service module is constructed, which is beneficial to displaying all service data corresponding to the service module, so that the external hash table based on the service data is constructed in combination with the reference relation between the service data in the follow-up process, and the nested hash tables of the reference relation between the service modules and the service data in the service system are sequentially constructed, so that the embodiment of the invention is suitable for the service system with more complex reference relation, simultaneously, the system load is reduced, the system response time is shortened, and the reference relation in the service system is beneficial to being quickly inquired and obtained.
The storage module 303 is configured to respectively construct an external hash table corresponding to each service data in each service module according to a reference relationship between the plurality of service modules and a reference relationship between the plurality of service data in each service module, and store the external hash table; the key of the external hash table is the service data number of the service data, and the value of the external hash table is the internal hash table corresponding to the service module with reference relation with the service data.
According to the embodiment of the invention, the external hash table constructed according to the service data is characterized in that the number of the referenced service data is used as the key of the external hash table, taking the inner hash table corresponding to the service module (the service module of the reference party) with reference relation with the service data as the value of the outer hash table, according to the above description, it can be known that the construction of the outer hash table not only combines the reference relationship between a plurality of business modules, but also considers the reference relationship between the business data in the business modules, and therefore, it can be understood that, the value of the external hash table (i.e. the internal hash table corresponding to the service module of the citation party) needs to be updated by combining the reference relationship between multiple service data to the service data number set in the internal hash table, and only reserving the service data number of the service data of the quoting party which quotes the quoted service data in the service data number set corresponding to the value of the internal hash table.
According to the embodiment of the invention, the business module of the quoted party is taken as the first module, the business data of the quoted party is taken as the first data, the business module of the quoted party is taken as the second module, and the business data of the quoted party is taken as the second data, so that the business data number set of the second data in the internal hash table corresponding to the second module is in the value of the external hash table corresponding to the first data.
Specifically, according to an embodiment of the present invention, the storage module 303 is further configured to:
aiming at any service data in any service module, the following steps are executed:
determining candidate service modules with reference relations between the service modules corresponding to the service data and internal hash tables corresponding to the candidate service modules according to the reference relations among the plurality of service modules;
determining target business data with reference relation with the business data according to the reference relation among the business data in the plurality of business modules;
updating the candidate service module and the corresponding internal hash table according to the target service data;
constructing an outer hash table corresponding to the service data according to the service data number of the service data, the updated candidate service module and the updated inner hash table; and the number of the values of the external hash table is consistent with the number of the updated candidate service modules.
Preferably, according to the embodiment of the present invention, the processing apparatus 300 for referencing relationships in the business system further includes a hash table updating module, configured to:
and receiving a reference relation updating request, and updating the outer hash table according to the reference relation updating request.
Through the arrangement, after the request for updating the reference relationship is received, the reference relationship in the business system is updated based on the stored external hash table (including the internal hash table, which is the value of the external hash table), and the reference relationship among a plurality of business modules/business data in the business system can be rapidly and comprehensively obtained, so that when a developer writes codes, the situations that the execution process of the business system is disordered and crashed and the like due to the fact that the reference relationship among certain or some business modules of the business data is omitted are effectively avoided.
Illustratively, according to the embodiment of the present invention, if the reference relationship update request is a new reference relationship addition request between service data, the hash table update module is further configured to:
inquiring the stored external hash table according to the service data number of the quoting party and the service data number of the quoted party in the quoting relation adding request;
judging whether a first external hash table exists or not, wherein a key of the first external hash table is a service data number of a quoted party;
if so, judging whether a first internal hash table exists in the values of the first external hash table, wherein the key of the first internal hash table is the number of the business module of the citation party; if so, inserting the service data of the citation party into the value of the first internal hash table; if not, adding a first internal hash table taking the serial number of the functional module of the citation party as a key in the value of the first external hash table;
and if the functional module number does not exist, creating a first internal hash table taking the functional module number of the reference party as a key, and inserting the first internal hash table into the value of the first external hash table.
The embodiment shows that when the reference relationship is newly added, the reference relationship in the recorded service system is directly adjusted in the original nested hash table, so that the consumed storage resource is effectively reduced, developers and users can quickly determine the adjusted reference relationship, and the user experience is improved.
Illustratively, according to an embodiment of the present invention, if the reference relationship update request is a request for deleting a reference relationship between service data, the hash table update module is further configured to:
determining the service data number of the quoting party and the service data number of the quoted party according to the quoting relation deletion request;
determining a second external hash table according to the service data number of the quoted party, and determining a second internal hash table according to the second external hash table and the service data number of the quoted party; the key of the second external hash table is the service data number of the quoted party; the key of the second inner hash table is the number of the business module of the citation party;
and deleting the service data number of the reference party in the value of the second internal hash table.
The above embodiment shows that when deleting a reference relationship, a corresponding second external hash table may be determined by a service data number of a referent, a second internal hash table may be determined by combining the service data number of the referent, and then the service data number of the referent in the second internal hash table may be directly deleted, so that a group of reference relationships to be deleted is deleted in a reference relationship of a service system recorded in a nested hash table composed of the internal hash table and the external hash table.
Illustratively, according to the embodiment of the present invention, if the reference relationship update request indicates to delete the service data in the service module, the hash table update module is further configured to:
judging whether a third external hash table with the service data number indicated to be deleted as a key exists in the stored external hash tables;
if yes, sending prompt information to the user;
and if the reference relation does not exist, the service data in the service module which is indicated to be deleted by the reference relation updating request is deleted.
Through the arrangement, before deleting the service data in a certain service module, whether a third external hash table with the service data number to be deleted as a key exists needs to be judged, if yes, the fact that the existing reference relationship in the service system exists the reference relationship for referring to the service data to be deleted is indicated, and therefore prompt information needs to be sent to a user, wherein the prompt information indicates the service module for referring to the service data to be deleted and the specifically-referenced service data, so that the user can conveniently determine whether to delete the service data, and if the user indicates to delete the service data, the third external hash table with the service data number to be deleted as a key needs to be deleted integrally; meanwhile, it is also necessary to determine whether the service data to be deleted exists in other internal hash tables, and if so, the service data to be deleted also needs to be deleted in the internal hash tables (that is, the reference relationship update request is a case described by a reference relationship deletion request between service data); if the reference relation does not exist, the reference relation for referring the service data to be deleted does not exist in the existing reference relation in the service system, so that the service data in the service module can be directly deleted.
Exemplarily, according to the embodiment of the present invention, the processing apparatus 300 for referencing relationships in the business system further includes a presentation module, configured to:
and receiving a reference relation display request, inquiring the stored external hash table and internal hash table according to the service module number and/or the service data number indicated in the reference relation display request to acquire a target reference relation corresponding to the service module number and/or the service data number, and displaying the target reference relation.
According to a specific implementation manner of the embodiment of the invention, the external hash table and the internal hash table can be queried as well as the tree-shaped storage structure constructed above for the reference relationship display request. The two query modes can quickly query and acquire the reference relation in the service system.
According to the technical scheme of the embodiment of the invention, the module information of a plurality of service modules in the service system, the reference relation among the service modules and the reference relation among the service data in the service modules are received; the module information comprises a service module number and a service data number; respectively constructing an internal hash table corresponding to each business module according to the module information, wherein keys of the internal hash table are business module numbers of the business modules, and values of the internal hash table are a set of business data numbers in the business modules; respectively constructing an external hash table corresponding to each service data in each service module according to the reference relationship among the service modules and the reference relationship among the service data in the service modules, and storing the external hash tables; the key of the external hash table is a service data number of the service data, and the value of the external hash table is a technical means of the internal hash table corresponding to the service module having a reference relation with the service data, so that the technical means of the existing method, which is only applicable to the service system having a simple reference relation, is overcome, when the complex coefficient of the reference relation in the service system is increased, the system load is increased, the system response time is prolonged, and the risk of causing the downtime of the service system is existed; when the reference relationship needs to be processed, the required development cost is high, the difficulty coefficient of code maintenance is high, the query difficulty is high, and the time consumption is long, so that the reference relationship in the service system is stored by adopting a nested hash structure consisting of an inner hash table and an outer hash table, the system load is reduced, the system response time is shortened, the method is also suitable for the service system with a more complex reference relationship, and meanwhile, the reference relationship in the service system is favorably and quickly queried and acquired; by uniformly storing the reference relationship in the service system, when the reference relationship needs to be processed, the development cost can be reduced, and the technical effect of the difficulty coefficient of code maintenance is reduced.
Fig. 4 shows an exemplary system architecture 400 of a processing method of a reference relationship in a business system or a processing apparatus of a reference relationship in a business system to which an embodiment of the present invention can be applied.
As shown in fig. 4, the system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405 (this architecture is merely an example, and the components included in a particular architecture may be adapted according to application specific circumstances). The network 404 serves as a medium for providing communication links between the terminal devices 401, 402, 403 and the server 405. Network 404 may include various types of connections, such as wire, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal devices 401, 402, 403 to interact with a server 405 over a network 404 to receive or send messages or the like. The terminal devices 401, 402, 403 may have installed thereon various communication client applications, such as a business process-type application, a web browser application, a search-type application, an instant messaging tool, a mailbox client, social platform software, etc. (by way of example only).
The terminal devices 401, 402, 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 405 may be a server that provides various services, such as a server (merely an example) that presents/performs update processing/performs deletion processing with respect to users using the terminal apparatuses 401, 402, 403. The server may analyze and perform other processing on the received data such as the module information and the reference relationship, and feed back a processing result (for example, an internal hash table and an external hash table — just an example) to the terminal device.
It should be noted that the processing method of the reference relationship in the business system provided by the embodiment of the present invention is generally executed by the server 405, and accordingly, the processing apparatus of the reference relationship in the business system is generally disposed in the server 405.
It should be understood that the number of terminal devices, networks, and servers in fig. 4 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 5, a block diagram of a computer system 500 suitable for use with a terminal device or server implementing an embodiment of the invention is shown. The terminal device or the server shown in fig. 5 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present invention.
As shown in fig. 5, the computer system 500 includes a Central Processing Unit (CPU)501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data necessary for the operation of the system 500 are also stored. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication processing via a network such as the internet. The driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511. The computer program performs the above-described functions defined in the system of the present invention when executed by the Central Processing Unit (CPU) 501.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a receiving module, an inner hash table construction module, and a storage module. The names of the modules do not form a limitation to the modules themselves in some cases, for example, the receiving module can also be described as a "module for receiving module information of a plurality of business modules in a business system, a reference relationship between the business modules, and a reference relationship between business data in the business modules".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: receiving module information of a plurality of business modules in a business system, reference relations among the business modules and reference relations among business data in the business modules; the module information comprises a service module number and a service data number; respectively constructing an internal hash table corresponding to each business module according to the module information, wherein keys of the internal hash table are business module numbers of the business modules, and values of the internal hash table are a set of business data numbers in the business modules; respectively constructing an external hash table corresponding to each service data in each service module according to the reference relationship among the service modules and the reference relationship among the service data in the service modules, and storing the external hash tables; the key of the external hash table is the service data number of the service data, and the value of the external hash table is the internal hash table corresponding to the service module with reference relation with the service data.
According to the technical scheme of the embodiment of the invention, the module information of a plurality of service modules in the service system, the reference relation among the service modules and the reference relation among the service data in the service modules are received; the module information comprises a service module number and a service data number; respectively constructing an internal hash table corresponding to each business module according to the module information, wherein keys of the internal hash table are business module numbers of the business modules, and values of the internal hash table are a set of business data numbers in the business modules; respectively constructing an external hash table corresponding to each service data in each service module according to the reference relationship among the service modules and the reference relationship among the service data in the service modules, and storing the external hash tables; the key of the external hash table is a service data number of the service data, and the value of the external hash table is a technical means of the internal hash table corresponding to the service module having a reference relation with the service data, so that the technical means of the existing method, which is only applicable to the service system having a simple reference relation, is overcome, when the complex coefficient of the reference relation in the service system is increased, the system load is increased, the system response time is prolonged, and the risk of causing the downtime of the service system is existed; when the reference relationship needs to be processed, the required development cost is high, the difficulty coefficient of code maintenance is high, the query difficulty is high, and the time consumption is long, so that the reference relationship in the service system is stored by adopting a nested hash structure consisting of an inner hash table and an outer hash table, the system load is reduced, the system response time is shortened, the method is also suitable for the service system with a more complex reference relationship, and meanwhile, the reference relationship in the service system is favorably and quickly queried and acquired; by uniformly storing the reference relationship in the service system, when the reference relationship needs to be processed, the development cost can be reduced, and the technical effect of the difficulty coefficient of code maintenance is reduced.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (11)

1. A processing method for reference relationship in a business system is characterized by comprising the following steps:
receiving module information of a plurality of business modules in a business system, reference relations among the business modules and reference relations among business data in the business modules; the module information comprises a service module number and a service data number;
respectively constructing an internal hash table corresponding to each service module according to the module information, wherein keys of the internal hash table are service module numbers of the service modules, and values of the internal hash table are a set of service data numbers in the service modules;
respectively constructing an external hash table corresponding to each service data in each service module according to the reference relationship among the service modules and the reference relationship among the service data in the service modules, and storing the external hash table; and the key of the external hash table is the service data number of the service data, and the value of the external hash table is an internal hash table corresponding to a service module with reference relation with the service data.
2. The method for processing reference relationship in a service system according to claim 1, wherein the step of respectively constructing an external hash table corresponding to each service data in each service module according to the reference relationship among the plurality of service modules and the reference relationship among the service data in the plurality of service modules comprises:
aiming at any service data in any service module, the following steps are executed:
determining candidate business modules with reference relations among the business modules corresponding to the business data and internal hash tables corresponding to the candidate business modules according to the reference relations among the business modules;
determining target business data which has reference relation with the business data according to the reference relation among the business data in the plurality of business modules;
updating the candidate service module and the corresponding inner hash table according to the target service data;
constructing an external hash table corresponding to the service data according to the service data number of the service data, the updated candidate service module and the updated internal hash table; and the number of the values of the external hash table is consistent with the number of the updated candidate service modules.
3. The method for processing reference relationship in business system according to claim 1, further comprising:
and receiving a reference relation updating request, and updating the external hash table according to the reference relation updating request.
4. The method for processing reference relationship in a service system according to claim 3, wherein if the reference relationship update request is a new reference relationship addition request between service data, the receiving a reference relationship update request, and updating the external hash table according to the reference relationship update request includes:
inquiring a stored external hash table according to the service data number of the quoting party and the service data number of the quoted party in the quoting relation newly-adding request;
judging whether a first external hash table exists or not, wherein a key of the first external hash table is a service data number of the quoted party;
if so, judging whether a first internal hash table exists in the values of the first external hash table, wherein the key of the first internal hash table is the service module number of the citation party; if yes, inserting the service data of the citation party into the value of the first internal hash table; if not, adding a first internal hash table taking the functional module number of the citation party as a key in the value of the first external hash table;
and if the functional module number of the citation party does not exist, creating a first internal hash table taking the functional module number of the citation party as a key, and inserting the first internal hash table into the value of the first external hash table.
5. The method for processing reference relationship in a business system according to claim 3, wherein if the reference relationship update request is a reference relationship deletion request between business data, the receiving a reference relationship update request, and updating the external hash table according to the reference relationship update request includes:
determining the service data number of the quoting party and the service data number of the quoted party according to the quoting relation deletion request;
determining a second external hash table according to the service data number of the quoted party, and determining a second internal hash table according to the second external hash table and the service data number of the quoted party; wherein, the key of the second external hash table is the service data number of the quoted party; the key of the second internal hash table is the service module number of the citation party;
and deleting the service data number of the reference party in the value of the second internal hash table.
6. The method for processing reference relationship in a business system according to claim 3, wherein if the reference relationship update request indicates to delete business data in a business module, the receiving a reference relationship update request, and updating the external hash table according to the reference relationship update request includes:
judging whether a third external hash table with the service data number indicated to be deleted as a key exists in the stored external hash tables;
if yes, sending prompt information to the user;
and if the reference relation does not exist, deleting the service data in the service module which is indicated to be deleted by the reference relation updating request.
7. The method for processing reference relationship in business system according to claim 1, further comprising:
receiving a reference relation display request, inquiring the stored external hash table and internal hash table according to the service module number and/or the service data number indicated in the reference relation display request to acquire a target reference relation corresponding to the service module number and/or the service data number, and displaying the target reference relation.
8. The method for processing reference relationship in business system according to claim 1, further comprising, after the step of receiving module information of a plurality of business modules in business system, reference relationship among the plurality of business modules, and reference relationship among business data in the plurality of business modules:
determining at least one basic service module only having a referenced relation according to the referenced relation among the plurality of service modules;
respectively constructing a tree-shaped storage structure corresponding to the basic service module by taking the basic service module as a root node according to the reference relationship among the plurality of service modules; and storing module information of the corresponding service module in each node of the tree-shaped storage structure.
9. A processing apparatus for reference relationships in a business system, comprising:
the system comprises a receiving module, a processing module and a processing module, wherein the receiving module is used for receiving module information of a plurality of business modules in a business system, reference relations among the business modules and reference relations among business data in the business modules; the module information comprises a service module number and a service data number;
the internal hash table construction module is used for respectively constructing an internal hash table corresponding to each service module according to the module information, wherein keys of the internal hash table are service module numbers of the service modules, and values of the internal hash table are a set of service data numbers in the service modules;
the storage module is used for respectively constructing an external hash table corresponding to each service data in each service module according to the reference relations among the plurality of service modules and the reference relations among the service data in the plurality of service modules, and storing the external hash table; and the key of the external hash table is the service data number of the service data, and the value of the external hash table is an internal hash table corresponding to a service module with reference relation with the service data.
10. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-8.
11. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-8.
CN202111005125.XA 2021-08-30 2021-08-30 Method and device for processing reference relationship in business system Pending CN113722548A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111005125.XA CN113722548A (en) 2021-08-30 2021-08-30 Method and device for processing reference relationship in business system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111005125.XA CN113722548A (en) 2021-08-30 2021-08-30 Method and device for processing reference relationship in business system

Publications (1)

Publication Number Publication Date
CN113722548A true CN113722548A (en) 2021-11-30

Family

ID=78679309

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111005125.XA Pending CN113722548A (en) 2021-08-30 2021-08-30 Method and device for processing reference relationship in business system

Country Status (1)

Country Link
CN (1) CN113722548A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106250356A (en) * 2016-08-09 2016-12-21 南京国电南自电网自动化有限公司 The fast resolving method of protective relaying device abstract object based on Hash table
CN106446140A (en) * 2016-09-20 2017-02-22 北京百度网讯科技有限公司 Method and device for data persistence
CN110535938A (en) * 2019-08-29 2019-12-03 腾讯科技(深圳)有限公司 A kind of data processing method based on intelligent contract, equipment and storage medium
CN110990403A (en) * 2019-11-26 2020-04-10 深圳壹账通智能科技有限公司 Business data storage method, system, computer equipment and storage medium
CN111258815A (en) * 2020-01-16 2020-06-09 西安奥卡云数据科技有限公司 Data backup method and device suitable for multi-node backup system based on Hash

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106250356A (en) * 2016-08-09 2016-12-21 南京国电南自电网自动化有限公司 The fast resolving method of protective relaying device abstract object based on Hash table
CN106446140A (en) * 2016-09-20 2017-02-22 北京百度网讯科技有限公司 Method and device for data persistence
CN110535938A (en) * 2019-08-29 2019-12-03 腾讯科技(深圳)有限公司 A kind of data processing method based on intelligent contract, equipment and storage medium
CN110990403A (en) * 2019-11-26 2020-04-10 深圳壹账通智能科技有限公司 Business data storage method, system, computer equipment and storage medium
CN111258815A (en) * 2020-01-16 2020-06-09 西安奥卡云数据科技有限公司 Data backup method and device suitable for multi-node backup system based on Hash

Similar Documents

Publication Publication Date Title
CN110019080B (en) Data access method and device
CN108011949B (en) Method and apparatus for acquiring data
CN111460129A (en) Method and device for generating identification, electronic equipment and storage medium
CN110706093A (en) Accounting processing method and device
CN113535420A (en) Message processing method and device
CN107741970B (en) Method and device for laying out main page
CN113722007B (en) Configuration method, device and system of VPN branch equipment
CN115982148A (en) Database table processing method and device, electronic equipment and storage medium
CN113779412B (en) Message touch method, node and system based on blockchain network
CN113760487B (en) Service processing method and device
CN112073395B (en) File distribution method and device
CN111737218A (en) File sharing method and device
CN113722548A (en) Method and device for processing reference relationship in business system
CN110019671B (en) Method and system for processing real-time message
CN109213815B (en) Method, device, server terminal and readable medium for controlling execution times
CN113760861A (en) Data migration method and device
CN110019026B (en) File cleaning method and device
CN112783914A (en) Statement optimization method and device
CN110866002A (en) Method and device for processing sub-table data
CN110262756B (en) Method and device for caching data
CN113741796B (en) Data persistence method and device for terminal application
CN113760886B (en) Method, apparatus, device and computer readable medium for providing data service
CN117131302A (en) Service page generation method and device
CN115146202A (en) Page form generation method and device
CN113760965A (en) Data query method and device

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
CB03 Change of inventor or designer information

Inventor after: Ye Chen

Inventor after: Liu Lin

Inventor after: Qi Jun

Inventor after: Wang Yi

Inventor before: Ye Chen

Inventor before: Qi Jun

Inventor before: Wang Yi

CB03 Change of inventor or designer information