Project starting method and device, computer equipment and storage medium
By intelligently extracting dependency data from local cache, Redis cache or remote services in the equity system, the problem of long-term startup time of equity system projects is solved and rapid project startup is achieved.
Patent Information
- Application Number
- CN202411076388.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-12-27
- Estimated Expiration
- 2044-08-07
AI Technical Summary
In the prior art, the project startup time of the equity system is long and the startup speed is low, mainly due to the complex equity package dependency loading, the database query takes too long.
A project startup method is adopted to intelligently extract dependency data from local cache, Redis cache or remote service after judging user requests and verifying permissions, avoid duplicate loading of dependency codes, and quickly obtaining required data using the cache level.
It greatly reduces the project startup time and improves the startup speed. By intelligently using the cache hierarchy to obtain dependency data, the process of repeated loading of code is avoided.
Smart Images

Figure CN119201240A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the fields of big data technology and financial technology, and in particular to project initiation methods, devices, computer equipment and storage media. Background Art
[0002] In the financial insurance sector, in order to improve business marketing effectiveness, the construction and maintenance of the rights and interests system has become a crucial link. The rights and interests system provides users with a flexible and varied rights and interests experience by defining and managing various rights and interests packages (usually including services, resources or privileges that users can enjoy). However, with the expansion of business scale and the increase in the number of rights and interests, the dependencies between rights and interests packages have become increasingly complex, forming a huge and intertwined rights and interests package dependency.
[0003] In the prior art, in order to efficiently handle these complex dependencies when the equity system is running, the dependency loading code is usually pre-executed when the local project of the equity system is started to load the equity package dependencies into the local memory. However, since the number of equity packages involved in the equity package dependencies is very large, when running the dependency loading code, it is necessary to start the analysis from the root node first, and then query the database for the information of the dependent equity packages in turn. Since the database query operation is extremely time-consuming, it leads to a long startup time for the local project and a low startup speed of the local project. Summary of the invention
[0004] The purpose of the embodiments of the present application is to propose a project startup method, device, computer equipment and storage medium to solve the technical problems that the existing local project startup method has a long startup time and a low local project startup speed.
[0005] In order to solve the above technical problems, the present application embodiment provides a project startup method, which adopts the following technical solution:
[0006] Determine whether a start request for a target project triggered by a user is received; wherein the start request carries user information of the user;
[0007] If yes, extract the user information from the start request, and perform permission verification on the user based on the user information and a preset permission level model;
[0008] If the user passes the authority verification, determining whether first dependency relationship data of a specified version corresponding to the target project is stored in a preset local cache;
[0009] If the first dependency relationship data is not stored in the local cache, determining whether the second dependency relationship data of a specified version corresponding to the target project is stored in the preset Redis cache;
[0010] If the second dependency relationship data is not stored in the Redis cache, determining whether the third dependency relationship data of a specified version corresponding to the target project is stored in a preset remote service;
[0011] If the third dependency relationship data is stored in the remote service, obtaining the third dependency relationship data from the remote service;
[0012] The target project is started based on the third dependency relationship data.
[0013] Further, after the step of determining whether the third dependency relationship data of the specified version corresponding to the target project is stored in the preset remote service, the method further includes:
[0014] If the third dependency data is not stored in the remote service, obtaining a dependency loading code corresponding to the target project;
[0015] Executing the dependency loading code to load fourth dependency data corresponding to the specified version from a preset data source;
[0016] Performing data verification on the fourth dependency relationship data;
[0017] If the fourth dependency relationship data passes the data verification, the target project is started based on the fourth dependency relationship data.
[0018] Furthermore, the step of performing data verification on the fourth dependency relationship data specifically includes:
[0019] Performing integrity check on the fourth dependency relationship data;
[0020] If the fourth dependency relationship data passes the integrity check, performing a consistency check on the fourth dependency relationship data;
[0021] If the fourth dependency data passes the consistency check, it is determined that the fourth dependency data passes the data verification; otherwise, it is determined that the fourth dependency data fails the data verification.
[0022] Furthermore, after the step of starting the target project based on the fourth dependency relationship data, the method further includes:
[0023] Performing format encapsulation processing on the fourth dependency relationship data to obtain target dependency relationship data;
[0024] Pushing the target dependency data to the remote service;
[0025] Performing a first cache update process on the Redis cache based on the fourth dependency relationship data, and setting a first cache expiration time corresponding to the fourth dependency relationship data in the Redis cache;
[0026] A second cache update process is performed on the local cache based on the fourth dependency relationship data, and a second cache expiration time corresponding to the fourth dependency relationship data is set in the local cache.
[0027] Furthermore, the step of performing a first cache update process on the Redis cache based on the fourth dependency relationship data specifically includes:
[0028] Determine whether expired dependency data corresponding to the target project is stored in the Redis cache;
[0029] If the expired dependency relationship data is not stored in the Redis cache, determining a target data structure corresponding to the fourth dependency relationship data;
[0030] Storing the fourth dependency relationship data in the Redis cache based on the target data structure;
[0031] If the expired dependency data is stored in the Redis cache, the fourth dependency data is used to perform data replacement processing on the expired dependency data.
[0032] Furthermore, the step of verifying the user's authority based on the user information and the preset authority level model specifically includes:
[0033] Calling the permission level model and obtaining a preset business operation permission table;
[0034] Acquire a target authority level corresponding to the user information based on the authority level model;
[0035] Query the specified permission level range corresponding to the business operation initiated by the local project from the business operation permission table;
[0036] Determining whether the target permission level is within the specified permission level range;
[0037] If so, it is determined that the user has passed the authority verification; otherwise, it is determined that the user has not passed the authority verification.
[0038] Further, after the step of determining whether the first dependency relationship data of the specified version corresponding to the target project is stored in the preset local cache, the method further includes:
[0039] If the first dependency relationship data is stored in the local cache, obtaining the first dependency relationship data from the local cache;
[0040] The target project is started based on the first dependency data.
[0041] In order to solve the above technical problems, the embodiment of the present application further provides a project starting device, which adopts the following technical solution:
[0042] A first judgment module is used to judge whether a start request for a target project triggered by a user is received; wherein the start request carries user information of the user;
[0043] A first verification module, configured to extract the user information from the startup request and perform authority verification on the user based on the user information and a preset authority level model;
[0044] A second judgment module is used to judge whether the first dependency relationship data of a specified version corresponding to the target project is stored in a preset local cache if the user passes the authority verification;
[0045] A third judgment module is used to judge whether a specified version of second dependency data corresponding to the target project is stored in a preset Redis cache if the first dependency data is not stored in the local cache;
[0046] a fourth determination module, configured to determine whether a third dependency relationship data of a specified version corresponding to the target project is stored in a preset remote service if the second dependency relationship data is not stored in the Redis cache;
[0047] A first acquisition module, configured to acquire the third dependency relationship data from the remote service if the third dependency relationship data is stored in the remote service;
[0048] The first startup module is used to start the target project based on the third dependency data.
[0049] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:
[0050] Determine whether a start request for a target project triggered by a user is received; wherein the start request carries user information of the user;
[0051] If yes, extract the user information from the start request, and perform permission verification on the user based on the user information and a preset permission level model;
[0052] If the user passes the authority verification, determining whether first dependency relationship data of a specified version corresponding to the target project is stored in a preset local cache;
[0053] If the first dependency relationship data is not stored in the local cache, determining whether the second dependency relationship data of a specified version corresponding to the target project is stored in the preset Redis cache;
[0054] If the second dependency relationship data is not stored in the Redis cache, determining whether the third dependency relationship data of a specified version corresponding to the target project is stored in a preset remote service;
[0055] If the third dependency relationship data is stored in the remote service, obtaining the third dependency relationship data from the remote service;
[0056] The target project is started based on the third dependency relationship data.
[0057] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:
[0058] Determine whether a start request for a target project triggered by a user is received; wherein the start request carries user information of the user;
[0059] If yes, extract the user information from the start request, and perform permission verification on the user based on the user information and a preset permission level model;
[0060] If the user passes the authority verification, determining whether first dependency relationship data of a specified version corresponding to the target project is stored in a preset local cache;
[0061] If the first dependency relationship data is not stored in the local cache, determining whether the second dependency relationship data of a specified version corresponding to the target project is stored in the preset Redis cache;
[0062] If the second dependency relationship data is not stored in the Redis cache, determining whether the third dependency relationship data of a specified version corresponding to the target project is stored in a preset remote service;
[0063] If the third dependency relationship data is stored in the remote service, obtaining the third dependency relationship data from the remote service;
[0064] The target project is started based on the third dependency relationship data.
[0065] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0066] The present application first determines whether a startup request for a target project triggered by a user is received; wherein the startup request carries user information of the user; if so, the user information is extracted from the startup request, and the user is authenticated based on the user information and a preset permission level model; if the user passes the permission verification, it is determined whether a first dependency data of a specified version corresponding to the target project is stored in a preset local cache; if the first dependency data is not stored in the local cache, it is determined whether a second dependency data of a specified version corresponding to the target project is stored in a preset Redis cache; if the second dependency data is not stored in the Redis cache, it is determined whether a third dependency data of a specified version corresponding to the target project is stored in a preset remote service; if the third dependency data is stored in the remote service, the third dependency data is obtained from the remote service; finally, the target project is activated based on the third dependency data. After receiving a user-triggered request to start a target project and passing the user's permission verification based on user information and a preset permission level model, the present application intelligently extracts dependency data from the local cache, the cache level corresponding to the local cache or the remote service to obtain the dependency data for starting the target project, so that there is no need to execute the dependency loading code again when the target project is started, and the time spent on extracting dependency data from the cache level is extremely short, which can greatly reduce the startup time of the target project and effectively improve the startup speed of the target project. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0068] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0069] Figure 2 A flowchart of an embodiment of a project initiation method according to the present application;
[0070] Figure 3 is a structural schematic diagram of an embodiment of a project starting device according to the present application;
[0071] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0072] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.
[0073] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0074] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.
[0075] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0076] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0077] Terminal devices 101, 102, 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV), laptop computers, desktop computers, etc.
[0078] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .
[0079] It should be noted that the project startup method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the project startup device is generally set in the server / terminal device.
[0080] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.
[0081] Continue to refer Figure 2 , shows a flowchart of an embodiment of the project initiation method according to the present application. According to different requirements, the order of the steps in the flowchart can be changed, and some steps can be omitted. The project initiation method provided in the embodiment of the present application can be applied to any scenario where a project initiation is required, and the project initiation method can be applied to products in these scenarios, for example, the initiation of a project related to an equity package in the financial insurance field. The project initiation method comprises the following steps:
[0082] Step S201, determining whether a start request for a target project triggered by a user is received; wherein the start request carries user information of the user.
[0083] In this embodiment, the electronic device (eg, Figure 1The server / terminal device shown in the figure) can obtain the startup request through a wired connection or a wireless connection. It should be noted that the above-mentioned wireless connection methods may include but are not limited to 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or developed in the future. The present application can be specifically applied to the startup scenario of the local project of the rights and interests system developed by the insurance company. The above-mentioned users may be operation and maintenance personnel related to the authority system. The above-mentioned rights and interests system includes a large number of rights and interests packages. The rights and interests package is a marketing method, which is mainly a preferential package built for the sale of a certain product or service. In addition, it also involves the definition of privileges and discounts enjoyed by customers after purchase. The above-mentioned target project may refer to a local project in the rights and interests system. The above-mentioned user information refers to the user's name information.
[0084] Step S202: If yes, extract the user information from the start request, and perform permission verification on the user based on the user information and a preset permission level model.
[0085] In this embodiment, the user information can be extracted from the startup request by parsing the startup request. The specific implementation process of the above-mentioned user authority verification based on the user information and the preset authority level model will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated here.
[0086] Step S203: If the user passes the authority verification, it is determined whether the first dependency relationship data of the specified version corresponding to the target project is stored in the preset local cache.
[0087] In this embodiment, the local cache refers to the local cache set in the electronic device. The local cache is the fastest but has limited capacity, and is suitable for scenarios with frequent access and small data volume. The dependency data refers to the dependency of the equity package corresponding to the target project. The specified version refers to the latest version. The project name of the target project can be obtained, and the project name and the specified version can be used to match the local cache. If there is a first data result matching the project name and the specified version in the local cache, it is determined that the first dependency data is stored in the local cache, and the first data result is used as the first dependency data. If there is no first data result matching the project name and the specified version in the local cache, it is determined that the first dependency data is not stored in the local cache. Among them, if the first dependency data of the specified version corresponding to the target project is not stored in the local cache, the dependency data stored in the local cache may be out of date. Or, the dependency or equity package information of the dependency data has changed, but it has not been updated accordingly in the local cache. There is version information in the equity package information, and the new and old versions can be used to determine whether the equity package information has been updated.
[0088] Step S204: If the first dependency data is not stored in the local cache, determine whether the second dependency data of a specified version corresponding to the target project is stored in the preset Redis cache.
[0089] In this embodiment, the above-mentioned Redis cache refers to the Redis cache set in the electronic device. Redis cache is an open source log-type, Key-Value database written in ANSI C language, supporting the network, and can be based on memory and can be persistent, and provides APIs in multiple languages. As an intermediate layer, Redis cache has the advantages of high-speed access and distributed storage, and is suitable for scenarios with large data volumes and requiring shared access. The project name of the target project can be obtained, and the project name and the above-mentioned specified version can be used to match the Redis cache data. If there is a second data result matching the project name and the specified version in the Redis cache, it is determined that the second dependency data is stored in the Redis cache, and the second data result is used as the above-mentioned second dependency data. If there is no second data result matching the project name and the specified version in the Redis cache, it is determined that the second dependency data is not stored in the Redis cache. Among them, if the second dependency data of the specified version corresponding to the target project is not stored in the Redis cache, the dependency data stored in the Redis cache may be out of date. Or, the dependency or equity package information of the dependency data has changed, but it has not been updated accordingly in the Redis cache.
[0090] Step S205: If the second dependency relationship data is not stored in the Redis cache, it is determined whether the third dependency relationship data of a specified version corresponding to the target project is stored in the preset remote service.
[0091] In this embodiment, the above-mentioned remote service is the data source of the dependency data of the target project, which is used to handle data updates and storage, but has the slowest access speed. The project name of the target project can be obtained, and the project name can be used to match the remote service with the above-mentioned specified version. If there is a third data result that matches the project name and the specified version in the remote service, it is determined that the third dependency data is stored in the remote service, and the third data result is used as the above-mentioned third dependency data. If there is no third data result that matches the project name and the specified version in the remote service, it is determined that the third dependency data is not stored in the remote service. Among them, if the third dependency data of the specified version corresponding to the target project is not stored in the remote service, it may be that the dependency data stored in the remote service is out of date. Or, the dependency or equity package information of the dependency data has changed, but the corresponding update has not been made in a timely manner in the remote service.
[0092] Step S206: If the third dependency relationship data is stored in the remote service, the third dependency relationship data is obtained from the remote service.
[0093] In this embodiment, after detecting that the third dependency relationship data is stored in the remote service, the third dependency relationship data is directly extracted from the remote service.
[0094] Step S207: Start the target project based on the third dependency relationship data.
[0095] In this embodiment, the target project is started by directly using the third dependency data obtained from the remote service, thereby eliminating the need to execute the dependency loading code again, and the time spent on extracting the third dependency data from the remote service is extremely short and negligible, thereby greatly speeding up the startup of the target project.
[0096] After receiving a user-triggered request to start a target project and passing the user's permission verification based on user information and a preset permission level model, the present application intelligently extracts dependency data from the local cache, the cache level corresponding to the local cache or the remote service to obtain the dependency data for starting the target project, so that there is no need to execute the dependency loading code again when the target project is started, and the time spent on extracting dependency data from the cache level is extremely short, which can greatly reduce the startup time of the target project and effectively improve the startup speed of the target project.
[0097] In some optional implementations, in some optional implementations of this embodiment, after step S205, the electronic device may further perform the following steps:
[0098] If the third dependency data is not stored in the remote service, a dependency loading code corresponding to the target project is obtained.
[0099] In this embodiment, the above-mentioned dependency loading code is a pre-written code for reading the latest version of the dependency data of the target project from the database. Among them, the construction process of the dependency loading code includes: pre-determining the storage location of the dependency data of the target project, that is, the database. The dependency data of the target project may be stored in a relational database (such as MySQL, Postgr eSQL database), or it may be stored in a non-relational database (such as MongoDB database). Then design a suitable data model according to the data source corresponding to the dependency data of the target project. If the data is stored in the database, it is necessary to define the database table structure, field type and index. Subsequently, write the code for accessing the data source, that is, the dependency loading code. The code content includes a database access layer (DAO). Database access: Use JDBC, ORM framework (such as Hibernate, MyBatis) or other database access technologies to query the dependency data corresponding to the target project in the database.
[0100] The dependency loading code is executed to load fourth dependency data corresponding to the specified version from a preset data source.
[0101] In this embodiment, the preset data source is specifically a database. By executing the dependency loading code, an SQL query statement is executed, and dependency data corresponding to the target project is obtained from the database, and mapped into a Java object to obtain the fourth dependency data.
[0102] The fourth dependency relationship data is subjected to data verification.
[0103] In this embodiment, after the fourth dependency data corresponding to the specified version is loaded from the preset data source, the fourth dependency data is also intelligently verified to ensure the integrity and consistency of the fourth dependency data. The specific implementation process of the data verification of the fourth dependency data will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated on here.
[0104] If the fourth dependency relationship data passes the data verification, the target project is started based on the fourth dependency relationship data.
[0105] In this embodiment, when it is detected that the third dependency data is not stored in the remote service, the dependency loading code corresponding to the target project will be intelligently executed to load the fourth dependency data corresponding to the specified version from the preset data source, and then the target project will be started based on the fourth dependency data, thereby ensuring the smooth startup of the target project.
[0106] When the present application detects that the third dependency data of the specified version corresponding to the target project is not stored in the remote service, the dependency loading code corresponding to the target project is obtained; then the dependency loading code is executed to load the fourth dependency data corresponding to the specified version from the preset data source; the fourth dependency data is subsequently verified; if the fourth dependency data passes the data verification, the target project is started based on the fourth dependency data. When the present application detects that the first dependency data of the specified version corresponding to the target project is not stored in the local cache, and the second dependency data of the specified version corresponding to the target project is not stored in the Redis cache, and the third dependency data of the specified version corresponding to the target project is not stored in the remote service, the dependency loading code corresponding to the target project will be intelligently executed to load the fourth dependency data corresponding to the specified version from the preset data source, and then the target project will be started based on the fourth dependency data, so as to effectively ensure the smooth startup of the target project and improve the startup intelligence and stability of the target project.
[0107] In some optional implementations, the performing data verification on the fourth dependency relationship data comprises the following steps:
[0108] Perform an integrity check on the fourth dependency data.
[0109] In this embodiment, the above-mentioned integrity check refers to detecting whether the fourth dependency data contains all the necessary fields and records. Among them, the settings of the above-mentioned necessary fields and records can be set according to the actual dependency verification requirements. Exemplarily, it can be ensured that each equity package has a unique identifier, and each dependency clearly indicates the dependent equity package. In addition, if the fourth dependency data contains all the necessary fields and records, it is determined that the fourth dependency data passes the integrity check. If the fourth dependency data does not contain all the necessary fields and records, it is determined that the fourth dependency data has not passed the integrity check, and then it is determined that the fourth dependency data has not passed the data verification.
[0110] If the fourth dependency relationship data passes the integrity check, a consistency check is performed on the fourth dependency relationship data.
[0111] In this embodiment, the consistency check refers to detecting whether there are any logical contradictions or inconsistencies within the fourth dependency data. Specifically, it can be done by detecting whether the dependency forms a circular dependency, checking whether the version number of the equity package conforms to the expected order, etc. If there are no logical contradictions or inconsistencies within the fourth dependency data, it is determined that the fourth dependency data passes the consistency check, otherwise it is determined that the fourth dependency data fails the consistency check.
[0112] If the fourth dependency data passes the consistency check, it is determined that the fourth dependency data passes the data verification; otherwise, it is determined that the fourth dependency data fails the data verification.
[0113] In this embodiment, only if it is detected that the fourth dependency data has passed both the integrity check and the consistency check, is it determined that the fourth dependency data has passed the data verification; otherwise, it is determined that the fourth dependency data has not passed the data verification.
[0114] The present application performs integrity check and consistency check on the fourth dependency data. Only when it is detected that the fourth dependency data has passed both the integrity check and the consistency check, will it be determined that the fourth dependency data has passed the data verification. Otherwise, it will be determined that the fourth dependency data has not passed the data verification. This effectively improves the processing accuracy of the data verification of the fourth dependency data and ensures the accuracy of the generated data verification result.
[0115] In some optional implementations of this embodiment, after the step of performing data verification on the fourth dependency relationship data, the electronic device may further perform the following steps:
[0116] The fourth dependency relationship data is formatted and packaged to obtain target dependency relationship data.
[0117] In this embodiment, the above-mentioned format encapsulation processing may specifically include encapsulating the fourth dependency relationship data into a format such as JSON or XML.
[0118] The target dependency data is pushed to the remote service.
[0119] In this embodiment, the target dependency data can be pushed to the remote service by using HTTP (Hypertext Transfer Protocol). After receiving the target dependency data, the remote service will perform corresponding verification and processing on the target dependency data, and then store it in a corresponding database.
[0120] A first cache update process is performed on the Redis cache based on the fourth dependency relationship data, and a first cache expiration time corresponding to the fourth dependency relationship data is set in the Redis cache.
[0121] In this embodiment, the value of the first cache expiration time can be set according to the actual business processing requirements. By setting the first cache expiration time corresponding to the fourth dependency data in the Redis cache, it is possible to avoid the expired data from being cached for a long time, thereby improving the cache intelligence of the dependency data in the Redis cache. Among them, the specific implementation process of the first cache update processing of the Redis cache based on the fourth dependency data will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated on here.
[0122] A second cache update process is performed on the local cache based on the fourth dependency relationship data, and a second cache expiration time corresponding to the fourth dependency relationship data is set in the local cache.
[0123] In this embodiment, the process of performing the second cache update processing on the local cache based on the fourth dependency data includes: determining whether the specified expired dependency data corresponding to the target project is stored in the local cache; if the specified expired dependency data is not stored in the local cache, storing the fourth dependency data in the local cache; and if the specified expired dependency data is stored in the local cache, using the fourth dependency data to perform data replacement processing on the specified expired dependency data. Among them, data replacement processing refers to replacing the specified expired dependency data in the local cache with the fourth dependency data. In addition, the selection of the value of the second cache expiration time can be set according to actual business processing requirements. By setting the second cache expiration time corresponding to the fourth dependency data in the local cache, it is possible to avoid caching expired data for a long time, thereby improving the cache intelligence of the dependency data in the local cache.
[0124] After detecting that the fourth dependency data has passed data verification, the present application will further perform format encapsulation processing on the fourth dependency data to obtain target dependency data, and push the target dependency data to the remote service; and perform a first cache update processing on the Redis cache based on the fourth dependency data, and set a first cache expiration time corresponding to the fourth dependency data in the Redis cache; and perform a second cache update processing on the local cache based on the fourth dependency data, and set a second cache expiration time corresponding to the fourth dependency data in the local cache. In this way, the updated fourth dependency data obtained based on the execution of the dependency loading code can be synchronously updated to all cache levels, namely the remote service, Redis cache and local cache, effectively ensuring the data consistency of the dependency data in each cache level. In addition, when a startup request for the target project is received subsequently, the fourth dependency data can be directly extracted from various cache levels and used to start the target project, so that there is no need to execute the dependency loading code again, and the time spent on extracting the fourth dependency data from the cache level is extremely short and can be ignored, which can greatly reduce the startup time of the target project and effectively improve the startup speed of the target project.
[0125] In some optional implementations, performing a first cache update process on the Redis cache based on the fourth dependency relationship data includes the following steps:
[0126] Determine whether expired dependency data corresponding to the target project is stored in the Redis cache.
[0127] In this embodiment, the project name of the target project can be obtained, and the Redis cache can be matched with the project name. If there is a data result matching the project name in the Redis cache, it is determined that the Redis cache stores the expired dependency data, and the data result matching the project name is the expired dependency data. If there is no data result matching the project name in the Redis cache, it is determined that the Redis cache does not store the expired dependency data.
[0128] If the expired dependency data is not stored in the Redis cache, a target data structure corresponding to the fourth dependency data is determined.
[0129] In this embodiment, the target data structure may be any one of data structures such as Hashes, Sets, and Sorted Sets.
[0130] The fourth dependency data is stored in the Redis cache based on the target data structure.
[0131] In this embodiment, the fourth dependency data is stored in the Redis cache by using the target data structure for fast query and update.
[0132] If the expired dependency data is stored in the Redis cache, the fourth dependency data is used to perform data replacement processing on the expired dependency data.
[0133] In this embodiment, the data replacement process refers to replacing the expired dependency data in the Redis cache with the fourth dependency data.
[0134] The present application determines whether the expired dependency data corresponding to the target project is stored in the Redis cache; if the expired dependency data is not stored in the Redis cache, the target data structure corresponding to the fourth dependency data is determined; then the fourth dependency data is stored in the Redis cache based on the target data structure; and if the expired dependency data is stored in the Redis cache, the expired dependency data is replaced using the fourth dependency data. When the present application detects that the expired dependency data is not stored in the Redis cache, the target data structure corresponding to the fourth dependency data is intelligently used to store the fourth dependency data in the Redis cache, thereby completing the first cache update process for the Redis cache. In addition, when the expired dependency data is detected to be stored in the Redis cache, the fourth dependency data is intelligently used to replace the expired dependency data to complete the first cache update process for the Redis cache, effectively improving the processing adaptability and processing intelligence of using the fourth dependency data to perform the first cache update process on the Redis cache.
[0135] In some optional implementations of this embodiment, the step S202 of verifying the user's authority based on the user information and the preset authority level model includes the following steps:
[0136] The permission level model is called and a preset business operation permission table is obtained.
[0137] In this embodiment, the permission level model is a pre-built big data model that stores a one-to-one mapping relationship between the name information of enterprise employees and the permission level. The business operation permission table is a pre-built data table that stores multiple business operation identifiers and permission level ranges that correspond to various business operation identifiers. Among them, the business operation identifier is unique, and one business operation corresponds to one business operation identifier.
[0138] A target authority level corresponding to the user information is acquired based on the authority level model.
[0139] In this embodiment, the permission level model may be queried using the user information to obtain a target permission level corresponding to the user information.
[0140] The designated permission level range corresponding to the business operation initiated by the local project is queried from the business operation permission table.
[0141] In this embodiment, the designated business operation identifier corresponding to the business operation initiated by the local project can be obtained, and then the business operation permission table can be queried using the designated business operation identifier to obtain the designated permission level range corresponding to the business operation initiated by the local project.
[0142] Determine whether the target permission level is within the specified permission level range.
[0143] In this embodiment, the target permission level can be compared with the two endpoint values included in the above-mentioned specified permission level range to obtain a corresponding numerical comparison result, and based on the numerical comparison result, it can be identified whether the target permission level is within the specified permission level range.
[0144] If so, it is determined that the user has passed the authority verification; otherwise, it is determined that the user has not passed the authority verification.
[0145] In this embodiment, if the target permission level is within the specified permission level range, it indicates that the user has the business operation permission to start the local project, and the user is determined to have passed the permission verification. If the target permission level is not within the specified permission level range, it indicates that the user does not have the business operation permission to start the local project, and the user is determined to have failed the permission verification.
[0146] This application calls the permission level model and obtains the preset business operation permission table; then obtains the target permission level corresponding to the user information based on the permission level model; and queries the specified permission level range corresponding to the business operation started by the local project from the business operation permission table; and then determines whether the target permission level is within the specified permission level range. Only when it is detected that the target permission level is within the specified permission level range, it indicates that the user has the business operation permission to start the local project, and thus determines that the user has passed the permission verification, which effectively improves the processing intelligence and processing accuracy of the user's permission verification, and ensures the accuracy of the obtained user's permission verification result. In addition, only after it is determined that the user has passed the permission verification, will the response processing for the user-triggered start request for the target project be executed later, which effectively improves the intelligent processing and standardized processing of the start request for the target project, and ensures the response security of the start request for the target project.
[0147] In some optional implementations of this embodiment, after step S203, the electronic device may further perform the following steps:
[0148] If the first dependency relationship data is stored in the local cache, the first dependency relationship data is obtained from the local cache.
[0149] In this embodiment, if the first dependency relationship data of a specified version corresponding to the target project is stored in the local cache, the first dependency relationship data is directly extracted from the local cache.
[0150] The target project is started based on the first dependency data.
[0151] In this embodiment, the target project is started by directly using the first dependency data obtained from the local cache, thereby eliminating the need to execute the dependency loading code again, and the time spent on extracting the first dependency data from the local cache is extremely short and negligible, thereby greatly speeding up the startup of the target project.
[0152] When receiving a user-triggered startup request for a target project, and after determining that the user has passed the permission verification, the present application will intelligently determine whether the first dependency data of a specified version corresponding to the target project is stored in the preset local cache. If it is detected that the first dependency data of a specified version corresponding to the target project is stored in the local cache, the first dependency data will be directly extracted from the local cache and used to start the target project, so that there is no need to execute the dependency loading code again, and the time spent on extracting the first dependency data from the local cache is extremely short and can be ignored, which can greatly reduce the startup time of the target project and effectively improve the startup speed of the target project.
[0153] In some optional implementations of this embodiment, if the first dependency data is not stored in the local cache, it will be further intelligently determined whether the second dependency data of the specified version corresponding to the target project is stored in the preset Redis cache. If it is detected that the second dependency data is stored in the Redis cache, the second dependency data will be automatically extracted from the Redis cache and used to start the target project, so that there is no need to execute the dependency loading code again, and the time spent on extracting the second dependency data from the Redis cache is very short and can be ignored, which can greatly reduce the startup time of the target project and effectively improve the startup speed of the target project.
[0154] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0155] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned third dependency data, the above-mentioned third dependency data can also be stored in a node of a blockchain.
[0156] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.
[0157] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.
[0158] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0159] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0160] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.
[0161] Further references Figure 3 , as a response to the above Figure 2 In order to realize the method shown in the figure, the present application provides an embodiment of a project startup device, and the device embodiment is Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0162] like Figure 3 As shown, the project initiation device 300 described in this embodiment includes:
[0163] The first judgment module 301 is used to judge whether a start request for a target project triggered by a user is received; wherein the start request carries user information of the user;
[0164] A first verification module 302 is used to extract the user information from the start request and perform permission verification on the user based on the user information and a preset permission level model;
[0165] The second judgment module 303 is used to judge whether the first dependency relationship data of the specified version corresponding to the target project is stored in the preset local cache if the user passes the authority verification;
[0166] The third judgment module 304 is used to judge whether the second dependency data of the specified version corresponding to the target project is stored in the preset Redis cache if the first dependency data is not stored in the local cache;
[0167] The fourth determination module 305 is used to determine whether the third dependency relationship data of the specified version corresponding to the target project is stored in the preset remote service if the second dependency relationship data is not stored in the Redis cache;
[0168] A first acquisition module 306, configured to acquire the third dependency data from the remote service if the third dependency data is stored in the remote service;
[0169] The first starting module 307 is used to start the target project based on the third dependency relationship data.
[0170] In some optional implementations of this embodiment, the project initiation device further includes:
[0171] A second acquisition module, configured to acquire a dependency loading code corresponding to the target project if the third dependency data is not stored in the remote service;
[0172] A loading module, configured to execute the dependency loading code to load fourth dependency data corresponding to the specified version from a preset data source;
[0173] A second verification module, used for performing data verification on the fourth dependency relationship data;
[0174] The second starting module is used to start the target project based on the fourth dependency data if the fourth dependency data passes the data verification.
[0175] In some optional implementations of this embodiment, the second verification module includes:
[0176] A first check submodule, configured to perform integrity check on the fourth dependency relationship data;
[0177] A second check submodule, configured to perform a consistency check on the fourth dependency data if the fourth dependency data passes the integrity check;
[0178] The first determination submodule is configured to determine that the fourth dependency data has passed data verification if the fourth dependency data has passed consistency verification, and determine that the fourth dependency data has not passed data verification otherwise.
[0179] In some optional implementations of this embodiment, the project initiation device further includes:
[0180] An encapsulation module, used for performing format encapsulation processing on the fourth dependency relationship data to obtain target dependency relationship data;
[0181] A push module, used for pushing the target dependency data to the remote service;
[0182] A first update module, configured to perform a first cache update process on the Redis cache based on the fourth dependency relationship data, and set a first cache expiration time corresponding to the fourth dependency relationship data in the Redis cache;
[0183] The second updating module is used to perform a second cache update process on the local cache based on the fourth dependency relationship data, and set a second cache expiration time corresponding to the fourth dependency relationship data in the local cache.
[0184] In some optional implementations of this embodiment, the first updating module includes:
[0185] A first judgment submodule is used to judge whether expired dependency data corresponding to the target project is stored in the Redis cache;
[0186] A determination submodule, configured to determine a target data structure corresponding to the fourth dependency relationship data if the expired dependency relationship data is not stored in the Redis cache;
[0187] A storage submodule, configured to store the fourth dependency relationship data in the Redis cache based on the target data structure;
[0188] The replacement submodule is used to use the fourth dependency data to perform data replacement processing on the expired dependency data if the expired dependency data is stored in the Redis cache.
[0189] In some optional implementations of this embodiment, the first verification module 303 includes:
[0190] A calling submodule, used to call the permission level model and obtain a preset business operation permission table;
[0191] An acquisition submodule, used for acquiring a target authority level corresponding to the user information based on the authority level model;
[0192] A query submodule, used to query the business operation permission table to find out the specified permission level range corresponding to the business operation initiated by the local project;
[0193] A second judgment submodule is used to judge whether the target permission level is within the specified permission level range;
[0194] The second determination submodule is used to determine that if yes, the user has passed the authority verification; otherwise, determine that the user has not passed the authority verification.
[0195] In some optional implementations of this embodiment, the project initiation device further includes:
[0196] a third acquisition module, configured to acquire the first dependency data from the local cache if the first dependency data is stored in the local cache;
[0197] A third starting module is used to start the target project based on the first dependency data.
[0198] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.
[0199] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.
[0200] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.
[0201] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk equipped on the computer device 4, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the project startup method, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.
[0202] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for running the project startup method.
[0203] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.
[0204] The present application also provides another embodiment, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the project startup method as described above.
[0205] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.
[0206] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.
Claims
1. A project initiation method, characterized in that: The steps include: Determine whether a start request for a target project triggered by a user is received; wherein the start request carries user information of the user; If yes, extract the user information from the start request, and perform permission verification on the user based on the user information and a preset permission level model; If the user passes the authority verification, determining whether first dependency relationship data of a specified version corresponding to the target project is stored in a preset local cache; If the first dependency relationship data is not stored in the local cache, determining whether the second dependency relationship data of a specified version corresponding to the target project is stored in the preset local cache; If the second dependency relationship data is not stored in the Redis cache, determining whether a third dependency relationship data of a specified version corresponding to the target project is stored in a preset remote service; If the third dependency relationship data is stored in the remote service, obtaining the third dependency relationship data from the remote service; The target project is started based on the third dependency relationship data.
2. The project initiation method according to claim 1, characterized in that: After the step of determining whether the third dependency relationship data of the specified version corresponding to the target project is stored in the preset remote service, the method further includes: If the third dependency data is not stored in the remote service, obtaining a dependency loading code corresponding to the target project; Executing the dependency loading code to load fourth dependency data corresponding to the specified version from a preset data source; Performing data verification on the fourth dependency relationship data; If the fourth dependency relationship data passes the data verification, the target project is started based on the fourth dependency relationship data.
3. The project initiation method according to claim 2, characterized in that: The step of performing data verification on the fourth dependency relationship data specifically includes: Performing integrity check on the fourth dependency relationship data; If the fourth dependency relationship data passes the integrity check, performing a consistency check on the fourth dependency relationship data; If the fourth dependency data passes the consistency check, it is determined that the fourth dependency data passes the data verification; otherwise, it is determined that the fourth dependency data fails the data verification.
4. The project initiation method according to claim 2, characterized in that: After the step of starting the target project based on the fourth dependency relationship data, the method further includes: Performing format encapsulation processing on the fourth dependency relationship data to obtain target dependency relationship data; Pushing the target dependency data to the remote service; Performing a first cache update process on the Redis cache based on the fourth dependency relationship data, and setting a first cache expiration time corresponding to the fourth dependency relationship data in the Redis cache; A second cache update process is performed on the local cache based on the fourth dependency relationship data, and a second cache expiration time corresponding to the fourth dependency relationship data is set in the local cache.
5. The project initiation method according to claim 4, characterized in that: The step of performing a first cache update process on the Redis cache based on the fourth dependency relationship data specifically includes: Determining whether expired dependency data corresponding to the target project is stored in the Redis cache; If the expired dependency relationship data is not stored in the Redis cache, determining a target data structure corresponding to the fourth dependency relationship data; storing the fourth dependency data in the Redis cache based on the target data structure; If the expired dependency relationship data is stored in the Redis cache, the fourth dependency relationship data is used to perform data replacement processing on the expired dependency relationship data.
6. The project initiation method according to claim 1, characterized in that: The step of verifying the user's authority based on the user information and the preset authority level model specifically includes: Calling the permission level model and obtaining a preset business operation permission table; Acquire a target authority level corresponding to the user information based on the authority level model; Query the specified permission level range corresponding to the business operation initiated by the local project from the business operation permission table; Determining whether the target permission level is within the specified permission level range; If so, it is determined that the user has passed the authority verification; otherwise, it is determined that the user has not passed the authority verification.
7. The project initiation method according to claim 1, characterized in that: After the step of determining whether the first dependency relationship data of the specified version corresponding to the target project is stored in the preset local cache, the method further includes: If the first dependency relationship data is stored in the local cache, obtaining the first dependency relationship data from the local cache; The target project is started based on the first dependency data.
8. A project startup device, characterized in that: include: A first judgment module is used to judge whether a start request for a target project triggered by a user is received; wherein the start request carries user information of the user; A first verification module, configured to extract the user information from the startup request and perform authority verification on the user based on the user information and a preset authority level model; A second judgment module is used to judge whether the first dependency relationship data of a specified version corresponding to the target project is stored in a preset local cache if the user passes the authority verification; a third determination module, configured to determine whether a specified version of second dependency data corresponding to the target project is stored in a preset Redis cache if the first dependency data is not stored in the local cache; a fourth determination module, configured to determine whether third dependency data of a specified version corresponding to the target project is stored in a preset remote service if the second dependency data is not stored in the Redis cache; A first acquisition module, configured to acquire the third dependency relationship data from the remote service if the third dependency relationship data is stored in the remote service; The first startup module is used to start the target project based on the third dependency data.
9. A computer device, comprising a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the project startup method according to any one of claims 1 to 7 when executing the computer-readable instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, which, when executed by a processor, implement the steps of the project startup method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Multi-application dependency tree generation method and device, electronic equipment and computer medium
CN112416306A
Item starting method and device, electronic equipment and storage medium
CN113608800A
Dependent version management method of software project and related equipment
CN114968341A
Remote remote bid evaluation method and system
CN115150128A
Double-cache authentication method and device, computer equipment and readable storage medium
CN116484359A