CN114969581A - Website internal link generation method and device, storage medium and electronic equipment - Google Patents

Website internal link generation method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN114969581A
CN114969581A CN202210246070.XA CN202210246070A CN114969581A CN 114969581 A CN114969581 A CN 114969581A CN 202210246070 A CN202210246070 A CN 202210246070A CN 114969581 A CN114969581 A CN 114969581A
Authority
CN
China
Prior art keywords
data
verified
value
data number
generating
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
CN202210246070.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 Jindi Technology Co Ltd
Original Assignee
Beijing Jindi 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 Jindi Technology Co Ltd filed Critical Beijing Jindi Technology Co Ltd
Priority to CN202210246070.XA priority Critical patent/CN114969581A/en
Publication of CN114969581A publication Critical patent/CN114969581A/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/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9558Details of hyperlinks; Management of linked annotations
    • 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/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking

Landscapes

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

Abstract

The embodiment of the invention discloses a method and a device for generating a website internal link, a storage medium and electronic equipment, wherein the method generates an object to be verified with a data structure as a bit storage structure by extracting N data numbers in N preset data number intervals; when the object to be verified is not repeated with the object which passes the verification in the object storage space, the object to be verified is taken as the object which passes the verification and is stored in the object storage space; and respectively retrieving corresponding data sources in a data source storage space according to the extracted N data numbers, and generating N internal link links displayed in a single website page. The embodiment avoids randomly acquiring data from the data source, and reduces the pressure of a database for storing the data source; the method adapts to the situation of larger data magnitude by simple distribution of the data numbers and verification of the repeatability of the data numbers, improves the generation efficiency of the inner chain, and enhances the expandability of the scheme.

Description

Website internal link generation method and device, storage medium and electronic equipment
Technical Field
The invention relates to the technical field of computer information processing, in particular to a method and a device for generating a website inner chain, a storage medium and electronic equipment.
Background
The internal link is an interlinkage between content pages under the same website domain name, namely, the content of the website is linked to the internal page of the website, which is also called as an intra-site link. The reasonable setting of the internal links of the website can improve the recording and the website weight of a search engine, wherein the fact that the displayed internal links of each page of the website are different is an effective means for optimizing the internal links. However, in the prior art, the problem of high repeatability of the internal links of the web pages exists, the internal links displayed on the pages of the same category are the same, the updating is very little, and even if the updating is carried out, the internal links are mostly manually configured and released. When the magnitude of the data source is small, manual configuration can be realized in order to realize different internal chains of page display, but when the magnitude of the data source is too large, two problems exist in realizing internal chain updating and optimization through manual configuration, firstly, the conventional random acquisition of the data source consumes resources and runs slowly, and other services can be blocked to read the data source; secondly, if the randomly acquired inner chain is repeated with the inner chains of other pages, the process of randomly acquiring the data source needs to be repeatedly executed, which further accelerates the consumption of system resources and reduces the running speed. Therefore, how to effectively optimize the internal links of a website can not only realize that the internal links displayed on the page are not repeated, improve the search weight of a single page, but also improve the efficiency of internal link generation, and becomes a technical problem which needs to be solved urgently.
Disclosure of Invention
The invention provides the method and the device for optimizing the internal link of the same website by manual configuration, and aims to solve the technical problems of low efficiency and slow operation of internal link optimization of the same website when a data source with a large magnitude order is faced.
The embodiment of the invention provides a method and a device for generating an in-website link, a storage medium and electronic equipment.
According to an aspect of the embodiments of the present invention, there is provided a method for generating an internal link of a website, the method including:
randomly extracting 1 data number in each data number interval of N preset data number intervals, and generating a to-be-verified object with a data structure as a bit storage structure according to the extracted N data numbers;
when the object to be verified is not repeated with the object which passes the verification in the object storage space, the object to be verified is taken as the object which passes the verification and is stored in the object storage space;
and respectively retrieving corresponding data sources in a data source storage space according to the extracted N data numbers, and generating N internal link links displayed in a single website page.
Optionally, in each of the method embodiments of the present invention, a generation manner of the data number section includes:
generating N data number intervals according to the number N of the data sources displayed on each page in the website, wherein the number starting values of the data numbers included in the N data number intervals are all 1, the number ending values are all C, and the C is obtained by calculation according to the magnitude T of the displayable data sources of the website and the number N of the data sources displayed on each page; or alternatively
And generating N data number intervals according to the number N of the data sources displayed on each page in the website, wherein when the number initial value of the data number included in the nth data number interval is (N-1) × C +1 and the number ending value is N × C, C is obtained by calculation according to the magnitude T of the data sources which can be displayed on the website and the number N of the data sources displayed on each page, and N is more than or equal to 1 and less than or equal to N.
Optionally, in the foregoing method embodiments of the present invention, randomly extracting 1 data number from each of N preset data number intervals, and generating, according to the extracted N data numbers, an object to be verified whose data structure is a bit storage structure includes:
in a database redis, storing N data number intervals by adopting a key-value structure, wherein when the number starting values of the N data number intervals are all 1 and the number ending values are all C, the key value of each data number interval is the number N of the data number interval, and the value is 1; when the initial value of the nth data numbering interval is (n-1) × C +1 and the numbering ending value is n × C, the key value of the nth data numbering interval is n and the value is (n-1) × C + 1;
randomly extracting 1 data number in each data number interval of N preset data number intervals;
and combining the extracted N data numbers to generate an object with a data structure of a bit storage structure as an object to be verified, and storing the object to be verified in a java object form.
Optionally, in the foregoing method embodiments of the present invention, when the object to be verified is not duplicated with an object in the object storage space that has been verified, saving the object to be verified as a verified object in the object storage space includes:
when the object storage space is a database redis and the object to be verified does not exist through the sismemer, the object to be verified is not repeated with the object which passes the verification in the redis, and the object to be verified is stored in the redis.
Optionally, in each of the method embodiments of the present invention, when the data structure of the object to be verified is a bitset structure, the set structure is adopted to store the object to be verified to the redis.
Optionally, in the foregoing method embodiments of the present invention, respectively retrieving, according to the extracted N data numbers, corresponding data sources in a data source storage space, and generating N internal links displayed in a single website page includes:
determining N primary key ID values according to the extracted N data numbers;
searching N corresponding data sources in the data source storage space according to the ID values of the N primary keys;
and generating N internal chain links according to the N data sources obtained by retrieval.
Optionally, in the foregoing method embodiments of the present invention, the determining N primary key ID values according to the extracted N data numbers includes:
when the number starting value of the data number included in the nth data number interval in the N data number intervals is (N-1) × C +1 and the number ending value is N × C, the value of the N data number is N primary key ID values;
when the number starting values of the data numbers included in the N data number intervals are all 1, and the number ending values are all C, the calculation formula for calculating the nth primary key ID value in the N primary key ID values is as follows:
ID n =(n-1)*C+D n
wherein N is more than or equal to 1 and less than or equal to N, and D is more than or equal to 1 n ≤C,D n For the nth data numbering intervalThe value of the data number taken.
According to another aspect of the embodiments of the present invention, there is provided an apparatus for generating an in-website link, the apparatus including:
the data string module is used for randomly extracting 1 data number in each of N preset data number intervals and generating an object to be verified with a data structure as a bit storage structure according to the extracted N data numbers;
the data verification module is used for saving the object to be verified as the object passing the verification to the object storage space when the object to be verified is not repeated with the object passing the verification in the object storage space;
and the internal link generation module is used for respectively retrieving the corresponding data sources in the data source storage space according to the extracted N data numbers and generating N internal link displayed in a single website page.
Optionally, in each of the above apparatus embodiments of the present invention, the apparatus further includes an interval numbering module, configured to generate N data numbering intervals, where:
generating N data number intervals according to the number N of the data sources displayed on each page in the website, wherein the number starting values of the data numbers included in the N data number intervals are all 1, the number ending values are all C, and the C is obtained by calculation according to the magnitude T of the displayable data sources of the website and the number N of the data sources displayed on each page; or alternatively
And generating N data number intervals according to the number N of the data sources displayed on each page in the website, wherein the number starting value of the data number included in the nth data number interval is (N-1) × C +1, the number ending value is N × C, C is obtained by calculation according to the magnitude T of the data sources which can be displayed on the website and the number N of the data sources displayed on each page, and N is greater than or equal to 1 and less than or equal to N.
Optionally, in the foregoing device embodiments of the present invention, the randomly extracting, by the data string module, 1 data number in each of N preset data number intervals, and generating, according to the extracted N data numbers, an object to be verified with a data structure as a bit storage structure includes:
in a database redis, storing N data number intervals by adopting a key-value structure, wherein when the number starting values of the N data number intervals are all 1 and the number ending values are all C, the key value of each data number interval is the number N of the data number interval, and the value is 1; when the number starting value of the nth data number interval is (n-1) × C +1 and the number ending value is n × C, the key value of the nth data number interval is n and the value is (n-1) × C + 1;
randomly extracting 1 data number in each data number interval of N preset data number intervals;
and combining the extracted N data numbers to generate an object with a data structure of a bit storage structure as an object to be verified, and storing the object to be verified in a java object form.
Optionally, in the foregoing device embodiments of the present invention, when the object to be verified is not duplicated with an object that has been verified in the object storage space, the saving, by the data verification module, the object to be verified as a verified object in the object storage space includes:
when the object storage space is a database redis and the object to be verified does not exist through the sismemer, the object to be verified is not repeated with the object which passes the verification in the redis, and the object to be verified is stored in the redis.
Optionally, in each of the apparatus embodiments of the present invention, when the data structure of the object to be verified in the data string module is a bitset structure, the data verification module stores the object to be verified to the redis by using the set structure.
Optionally, in each apparatus embodiment of the present invention, the inner chain generating module includes:
an ID determination unit for determining N primary key ID values according to the extracted N data numbers;
the data retrieval unit is used for retrieving N corresponding data sources in the data source storage space according to the ID values of the N primary keys;
and the inner chain generating unit is used for generating N inner chain links according to the N data sources obtained by retrieval.
Optionally, in each of the above apparatus embodiments of the present invention, the determining N primary key ID values according to the extracted N data numbers by an ID determining unit includes:
when the number starting value of the data number included in the nth data number interval in the N data number intervals is (N-1) × C +1 and the number ending value is N × C, the value of the N data number is N primary key ID values;
when the number starting values of the data numbers included in the N data number intervals are all 1, and the number ending values are all C, the calculation formula for calculating the nth primary key ID value in the N primary key ID values is as follows:
ID n =(n-1)*C+D n
wherein N is more than or equal to 1 and less than or equal to N, and D is more than or equal to 1 n C is less than or equal to C, n is the key value of the data number interval, D n The data number value extracted from the nth data number interval.
According to yet another aspect of embodiments of the present invention, there is provided a computer-readable storage medium storing a computer program for executing the method according to any one of the above-mentioned embodiments of the present invention.
According to still another aspect of an embodiment of the present invention, there is provided an electronic apparatus including:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the instructions to implement the method according to any of the above embodiments of the present invention.
Based on the website internal link generation method and device, the storage medium and the electronic device provided by the above embodiment of the invention, the method comprises the following steps: when a data source with a large magnitude order faces, randomly extracting 1 data number in each of N preset data number intervals, and generating an object to be verified with a data structure as a bit storage structure according to the extracted N data numbers; when the object to be verified is not repeated with the object which passes the verification in the object storage space, the object to be verified is used as the object which passes the verification and is stored in the object storage space; and respectively retrieving corresponding data sources in a data source storage space according to the extracted N data numbers, and generating N internal link links displayed in a single website page. The technical effects of the method and the device for generating the website internal link, the storage medium and the electronic device in the embodiment include:
1. the data source is prevented from being randomly acquired from the data source, the data number interval is generated firstly, the data number repeatability is verified by extracting the data number in the data number interval, the data source is acquired after the inner chain is generated when the data number is verified not to be repeated, the random display content of each page is different by storing exhaustive results displayed by the pages in a large quantity, the storage space is greatly saved, the pressure of a database for storing the data source is reduced, a high-performance server is not required to be specially selected, and the hardware cost is saved.
2. The method adapts to the situation of larger data magnitude by simple distribution of data numbers and verification of repeatability of the data numbers without regenerating the technical scheme of inner chain optimization, thereby greatly enhancing the expandability of the scheme.
3. When a scheme for distributing the data numbers is designed, a data dividing and controlling strategy is used, the data numbers are divided into a plurality of intervals, and 1 data number is arbitrarily extracted from the plurality of intervals, so that the data quantity to be scanned is reduced, and the efficiency of inner chain generation is improved.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent by describing in more detail embodiments of the present invention with reference to the attached drawings. The accompanying drawings are included to provide a further understanding of the embodiments of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings, like reference numbers generally represent like parts or steps.
Fig. 1 is a flowchart illustrating a method for generating an internal link of a website according to an exemplary embodiment of the present invention;
fig. 2 is a schematic structural diagram of a data number interval according to an exemplary embodiment of the present invention;
fig. 3 is a schematic structural diagram of a data number interval according to another exemplary embodiment of the present invention;
FIG. 4 is a schematic structural diagram of an object to be verified stored in an object storage space according to an exemplary embodiment of the present invention;
fig. 5 is a schematic structural diagram of a website internal link generation apparatus according to an exemplary embodiment of the present invention;
fig. 6 is a structure of an electronic device according to an exemplary embodiment of the present invention.
Detailed Description
Hereinafter, example embodiments according to the present invention will be described in detail with reference to the accompanying drawings. It is to be understood that the described embodiments are merely a subset of embodiments of the invention and not all embodiments of the invention, with the understanding that the invention is not limited to the example embodiments described herein.
It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
It will be understood by those skilled in the art that the terms "first", "second", etc. in the embodiments of the present invention are used only for distinguishing different steps, devices or modules, etc., and do not denote any particular technical meaning or necessarily order therebetween.
It should also be understood that in embodiments of the present invention, "a plurality" may refer to two or more and "at least one" may refer to one, two or more.
It is also to be understood that any reference to any component, data, or structure in the embodiments of the invention may be generally understood as one or more, unless explicitly defined otherwise or stated to the contrary hereinafter.
In addition, the term "and/or" in the present invention is only one kind of association relationship describing the associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In the present invention, the character "/" generally indicates that the preceding and following related objects are in an "or" relationship.
It should also be understood that the description of the embodiments of the present invention emphasizes the differences between the embodiments, and the same or similar parts may be referred to each other, so that the descriptions thereof are omitted for brevity.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
Embodiments of the invention are operational with numerous other general purpose or special purpose computing system environments or configurations, and with numerous other electronic devices, such as terminal devices, computer systems, servers, etc. Examples of well known terminal devices, computing systems, environments, and/or configurations that may be suitable for use with electronic devices, such as terminal devices, computer systems, servers, and the like, include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, networked personal computers, minicomputer systems, mainframe computer systems, distributed cloud computing environments that include any of the above, and the like.
Electronic devices such as terminal devices, computer systems, servers, etc. may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system/server may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
Exemplary method
Fig. 1 is a flowchart illustrating a website inner link generation method according to an exemplary embodiment of the present invention. The embodiment can be applied to an electronic device, and as shown in fig. 1, the method for generating an internal link of a website according to the embodiment includes the following steps:
step 101, randomly extracting 1 data number in each of N preset data number intervals, and generating an object to be verified with a data structure as a bit storage structure according to the extracted N data numbers.
Preferably, the generation method of the data number section includes:
generating N data number intervals according to the number N of the data sources displayed on each page in the website, wherein the number starting values of the data numbers included in the N data number intervals are all 1, the number ending values are all C, and the C is obtained by calculation according to the magnitude T of the displayable data sources of the website and the number N of the data sources displayed on each page; or
And generating N data number intervals according to the number N of the data sources displayed on each page in the website, wherein when the number initial value of the data number included in the nth data number interval is (N-1) × C +1 and the number ending value is N × C, C is obtained by calculation according to the magnitude T of the data sources which can be displayed on the website and the number N of the data sources displayed on each page, and N is more than or equal to 1 and less than or equal to N.
In one embodiment, assuming that the data source to be displayed on a web site page is company information, which is on the order of millions, and the number of companies that can be displayed per page, N, is 20, the data source storage space will be divided into 20 buckets, and the 20 buckets will be numbered from 1 to 20. The data source storage space may be a MySQL database. In the database, when millions of data sources are stored according to the bucket sequence, the primary key ID value of each data source is automatically generated, and the value range of the primary key ID value is 1-1000000.
Further, according to 100 ten thousand/20-5 ten thousand, the value of c is 50000, that is, 100 ten thousand data sources are stored in 20 buckets, and each bucket can store 5 ten thousand data sources. Therefore, there are two ways to generate the data number section: one is that the initial value of the number of the data number included in each of the 20 data number intervals is 1, and the end value of the number is 50000, and the other is that in each of the 20 data number intervals, the initial value of the number of the data number included in the nth data number interval is (n-1) × C +1, and the end value of the number is n × C, that is, the 20 data number intervals are (1, 50000), (50001, 100000), … … (950001, 1000000) in this order.
Preferably, randomly extracting 1 data number in each of N preset data number intervals, and generating an object to be verified with a data structure as a bit storage structure according to the extracted N data numbers includes:
in a database redis, storing N data number intervals by adopting a key-value structure, wherein when the number starting values of data numbers included in the N data number intervals are all 1, and the number ending values are all C, the key value of each data number interval is the number N of the data number interval, and the value is 1; when the number starting value of the data number included in the nth data number interval is (n-1) × C +1 and the number ending value is n × C, the key value of the nth data number interval is n and the value is (n-1) × C + 1;
randomly extracting 1 data number in each data number interval of N preset data number intervals;
and combining the extracted N data numbers to generate an object with a data structure of a bit storage structure as an object to be verified, and storing the object to be verified in a java object form.
Fig. 2 is a schematic structural diagram of a data number interval according to an exemplary embodiment of the present invention. As shown in fig. 2, in one embodiment, 20 data number intervals are sequentially (1, 50000), (50001, 100000), … … (950001, 1000000), so when 20 data number intervals are stored in the database redis in a key-value structure, the key values of the data number intervals are sequentially bucket numbers 1 to 20, and the value corresponding to each data number interval is sequentially 1,50001, … …, 950001. The data number is stored by adopting a key-value structure, and the range of the data number in each data number interval can be determined only by storing the number of each storage interval and the data number of the data source with the position number of 1 in each storage interval, so that the storage space is greatly saved, and the data processing efficiency is improved. In addition, the data structure of the object to be verified is a bit storage structure, so that more data can be stored in the same storage space, and the effects of saving the storage space and improving the data processing efficiency are achieved.
Fig. 3 is a schematic structural diagram of a data number interval according to another exemplary embodiment of the present invention. As shown in fig. 3, in another embodiment, 20 data number intervals are all (1, 50000), and then when the 20 data number intervals are stored in the database redis in a key-value structure, the key values of the data number intervals are still bucket numbers 1 to 20 in sequence, and the value values corresponding to each data number interval are all 1. Compared with the embodiment of fig. 2, in this embodiment, 20 data number intervals are completely the same, and are the same as the 1 st data number interval in the embodiment of fig. 2, and the numerical value of the data number included in the data number interval is the smallest compared with the numerical value of the data number included in other data number intervals, so that the data storage space can be saved more. Moreover, when the data structure of the object to be verified is a bit storage structure, since the value of the data number is small, the data storage space occupied by the combination of the data numbers is also smaller, so that it can be further ensured that more data are stored in the same data storage space, and the data storage space is better saved compared with the embodiment of fig. 2.
And 102, when the object to be verified is not repeated with the object which passes the verification in the object storage space, saving the object to be verified as the object which passes the verification in the object storage space.
Preferably, when the object to be verified is not duplicated with an object that has been verified in the object storage space, saving the object to be verified as a verified object to the object storage space includes:
when the object storage space is a database redis and the object to be verified does not exist through the sismemer, the object to be verified is not repeated with the object which passes the verification in the redis, and the object to be verified is stored in the redis.
Preferably, when the data structure of the object to be verified is a bitset structure, the object to be verified is stored to redis by adopting the set structure.
Those skilled in the art should understand that there are many ways to verify whether a data object is duplicated, for example, bloomfilter may be used, and this example only provides one of the possibilities.
Fig. 4 is a schematic structural diagram of storing an object to be verified in an object storage space according to an exemplary embodiment of the present invention. As shown in fig. 4, in the above embodiment, when the data structure of the object to be verified obtained by combining the data numbers arbitrarily extracted from the 20 data number intervals is a bitset structure, and it is determined by sismemer that the object to be verified does not exist in the rediss, the object to be verified stored in the bitset structure is stored in the rediss in the set structure because there is no duplication in the data stored in the set structure. When the existence of the object to be verified is determined through the sismemer, the object to be verified is repeated with the object in the object storage space, and after 1 data number is required to be extracted from 20 data number intervals to generate a new object to be verified, whether the new object to be verified exists is determined through the sismemer in the redis. After exhaustive enumeration according to this embodiment, the last non-repeating verified object is bitsetn.
And 103, respectively retrieving corresponding data sources in the data source storage space according to the extracted N data numbers, and generating N internal link links displayed in a single website page.
Preferably, the step of respectively retrieving corresponding data sources in the data source storage space according to the extracted N data numbers and generating N internal links displayed in a single website page includes:
generating N primary key ID values according to the extracted N data numbers;
searching N corresponding data sources in the data source storage space according to the ID values of the N primary keys;
and generating N internal chain links according to the N data sources obtained by retrieval.
Preferably, in the foregoing method embodiments of the present invention, determining N primary key ID values according to the extracted N data numbers includes:
when the number starting value of the data number included in the nth data number interval in the N data number intervals is B [(n-1)*c+1] The end-of-numbering value is B nC Then, the values of the N data numbers are the ID values of the N main keys;
when the number starting values of the data numbers included in the N data number intervals are all 1, and the number ending values are all C, the calculation formula for calculating the nth primary key ID value in the N primary key ID values is as follows:
ID n =(n-1)*C+D n
wherein N is more than or equal to 1 and less than or equal to N, and D is more than or equal to 1 n C is less than or equal to C, n is the key value of the data number interval, D n The value of the data number extracted in the nth data number interval.
In an embodiment, for an object passing verification, the stream in the bitset structure corresponding to the object passes through, that is, 20 data numbers are obtained, when the 20 data numbers are all in the interval of (1, 50000), the primary key ID value is obtained through calculation of the key value of the data number and the data number interval, and the data source corresponding to the data number is retrieved in 20 storage intervals, such as select _ company _ ID, company _ name _ from _ database where _ ID in (1,50001,100001 …,950001), assuming that the data number values in the 20 storage intervals are 1,50001,100001 …, and 950001, the stored company information can be invoked to generate 20 inlinks of a single page and texts corresponding to the inlinks according to the instruction, examples of the inlinks are as follows:
<a href=”http://tianyancha.com/company/xxx”>xxx</a>
the website domain name capable of displaying the company information is http:// tianyancha.
It can be seen from the above embodiments that the invocation of the data source is separated from the generation of the data source internal chain, the data number interval is generated according to the number N of the data sources displayable on a single page of the website and the magnitude of the data sources, then the generation of the unrepeated website internal chain is converted into the verification of whether the data numbers of the data sources displayed on the single page are repeated, and only when the data numbers are not repeated, the stored data sources are invoked to generate the internal chain and the corresponding text, so that the pressure on the database caused by reading a large number of repeated data sources is avoided, the hardware cost is saved, and for the data sources with different magnitudes, the technical scheme can be updated only by conveniently modifying the magnitude of the data sources in the application, the number of the data sources displayed on the single page, and other parameters, so that the application has excellent expansibility.
Exemplary devices
Fig. 5 is a schematic structural diagram of a website internal link generation apparatus according to an exemplary embodiment of the present invention. As shown in fig. 5, the website internal link generating apparatus according to this embodiment includes:
the data string module 501 is configured to randomly extract 1 data number in each of N preset data number intervals, and generate an object to be verified with a data structure as a bit storage structure according to the extracted N data numbers.
And the data verification module 502 is configured to, when the object to be verified is not duplicated with an object that has already been verified in the object storage space, store the object to be verified as a verified object in the object storage space.
The internal link generating module 503 is configured to retrieve the corresponding data sources in the data source storage space for the extracted N data numbers, and generate N internal link links displayed in a single website page.
Preferably, the apparatus further comprises an interval numbering module, configured to generate N data numbering intervals, where:
generating N data number intervals according to the number N of the data sources displayed on each page in the website, wherein the number starting values of the data numbers included in the N data number intervals are all 1, the number ending values are all C, and the C is obtained by calculation according to the magnitude T of the displayable data sources of the website and the number N of the data sources displayed on each page; or
And generating N data number intervals according to the number N of the data sources displayed on each page in the website, wherein the number starting value of the data number included in the nth data number interval is (N-1) × C +1, the number ending value is N × C, C is obtained by calculation according to the magnitude T of the data sources displayable by the website and the number N of the data sources displayed on each page, and N is more than or equal to 1 and less than or equal to N.
Preferably, the randomly extracting, by the data string module, 1 data number in each of N preset data number intervals, and generating, according to the extracted N data numbers, the object to be verified with the data structure as a bit storage structure includes:
in a database redis, storing N data number intervals by adopting a key-value structure, wherein when the number starting values of the N data number intervals are all 1 and the number ending values are all C, the key value of each data number interval is the number N of the data number interval, and the value is 1; when the number starting value of the nth data number interval is (n-1) × C +1 and the number ending value is n × C, the key value of the nth data number interval is the number n of the data number interval, and the value is (n-1) × C + 1;
randomly extracting 1 data number in each data number interval of N preset data number intervals;
and combining the extracted N data numbers to generate an object with a data structure of a bit storage structure as the object to be verified, and storing the object to be verified in a java object form.
Preferably, when the object to be verified is not duplicated with an object in the object storage space that has been verified, the saving the object to be verified as the verified object to the object storage space includes:
when the object storage space is a database redis and the object to be verified does not exist through the sismemer, the object to be verified is not repeated with the object which passes the verification in the redis, and the object to be verified is stored in the redis.
Preferably, when the data structure of the object to be verified in the data string module is a bitset structure, the data verification module stores the object to be verified to the redis by using the set structure.
Preferably, the inner chain generating module 503 comprises:
an ID determination unit for determining N primary key ID values according to the extracted N data numbers;
the data retrieval unit is used for retrieving corresponding N data sources in the data source storage space according to the N primary key ID values;
and the inner chain generating unit is used for generating N inner chain links according to the N data sources obtained by retrieval.
Preferably, the ID determining unit determining N primary key ID values from the extracted N data numbers includes:
when the number starting value of the data number included in the nth data number interval in the N data number intervals is (N-1) × C +1 and the number ending value is N × C, the value of the N data number is N primary key ID values;
when the number starting values of the data numbers included in the N data number intervals are all 1, and the number ending values are all C, the calculation formula for calculating the nth primary key ID value in the N primary key ID values is as follows:
ID n =(n-1)*C+D n
wherein N is more than or equal to 1 and less than or equal to N, and D is more than or equal to 1 n C is less than or equal to C, n is the key value of the data number interval, D n The data number value extracted from the nth data number interval.
The website inner chain generation device provided in this embodiment generates a data number interval for the magnitude of a data source and the number of displayable data sources on a single webpage, extracts a data number from the data number interval to combine to generate an object to be verified, and verifies whether the object to be verified is repeated, so that when the object to be verified is not repeated, the steps of generating an inner chain and a text of the data source according to the object passing verification are the same as those adopted by the website inner chain generation method provided in this embodiment, the achieved technical effects are the same, and details are not repeated here.
Exemplary electronic device
Fig. 6 is a structure of an electronic device according to an exemplary embodiment of the present invention. The electronic device may be either or both of the first device and the second device, or a stand-alone device separate from them, which stand-alone device may communicate with the first device and the second device to receive the acquired input signals therefrom. FIG. 6 illustrates a block diagram of an electronic device in accordance with an embodiment of the disclosure. As shown in fig. 6, the electronic device includes one or more processors 601 and memory 602.
The processor 601 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
Memory 602 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium and executed by the processor 601 to implement the method for mining information of historical change records of the software program of the disclosed embodiments described above and/or other desired functions. In one example, the electronic device may further include: an input device 603 and an output device 604, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
The input device 603 may also include, for example, a keyboard, a mouse, and the like. The output device 604 can output various information to the outside. The output devices 604 may include, for example, a display, speakers, a printer, and a communication network and remote output devices connected thereto, among others.
Of course, for simplicity, only some of the components of the electronic device relevant to the present disclosure are shown in fig. 6, omitting components such as buses, input/output interfaces, and the like. In addition, the electronic device may include any other suitable components, depending on the particular application.
Exemplary computer program product and computer-readable storage Medium
In addition to the above-described methods and apparatus, embodiments of the present disclosure may also be a computer program product comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps in the method for website in-chain generation according to various embodiments of the present disclosure described in the "exemplary methods" section of this specification above.
The computer program product may write program code for carrying out operations for embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present disclosure may also be a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, cause the processor to perform the steps in the website in-chain generation method according to various embodiments of the present disclosure described in the "exemplary methods" section above in this specification.
The computer-readable storage medium may take any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, 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.
The basic principles of the present disclosure have been described above in connection with specific embodiments, but it should be noted that advantages, effects, and the like, mentioned in the present disclosure are only examples and not limitations, and should not be considered essential to the various embodiments of the present disclosure. Furthermore, the foregoing disclosure of specific details is for the purpose of illustration and description and is not intended to be limiting, since the disclosure is not intended to be limited to the specific details so described.
In the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts in the embodiments are referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The block diagrams of devices, apparatuses, systems referred to in this disclosure are only given as illustrative examples and are not intended to require or imply that the connections, arrangements, configurations, etc. must be made in the manner shown in the block diagrams. These devices, apparatuses, devices, systems may be connected, arranged, configured in any manner, as will be appreciated by those skilled in the art. Words such as "including," "comprising," "having," and the like are open-ended words that mean "including, but not limited to," and are used interchangeably herein. The words "or" and "as used herein mean, and are used interchangeably with, the word" and/or, "unless the context clearly dictates otherwise. The word "such as" is used herein to mean, and is used interchangeably with, the phrase "such as but not limited to".
The method and apparatus of the present disclosure may be implemented in a number of ways. For example, the methods and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above unless specifically stated otherwise. Further, in some embodiments, the present disclosure may also be embodied as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
It is also noted that in the devices, apparatuses, and methods of the present disclosure, each component or step can be decomposed and/or recombined. These decompositions and/or recombinations are to be considered equivalents of the present disclosure. The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, the description is not intended to limit embodiments of the disclosure to the form disclosed herein. While a number of example aspects and embodiments have been discussed above, those of skill in the art will recognize certain variations, modifications, alterations, additions and sub-combinations thereof.

Claims (10)

1. A method for generating an inner chain of a website, which is characterized by comprising the following steps:
randomly extracting 1 data number in each data number interval of N preset data number intervals, and generating a to-be-verified object with a data structure as a bit storage structure according to the extracted N data numbers;
when the object to be verified is not repeated with the object which passes the verification in the object storage space, the object to be verified is used as the object which passes the verification and is stored in the object storage space;
and respectively retrieving corresponding data sources in a data source storage space according to the extracted N data numbers, and generating N internal link links displayed in a single website page.
2. The method according to claim 1, wherein the manner of generating the data number interval comprises:
generating N data number intervals according to the number N of the data sources displayed on each page in the website, wherein the number starting values of the data numbers included in the N data number intervals are all 1, the number ending values are all C, and the C is obtained by calculation according to the magnitude T of the displayable data sources of the website and the number N of the data sources displayed on each page; or
And generating N data number intervals according to the number N of the data sources displayed on each page in the website, wherein the number starting value of the data number included in the nth data number interval is (N-1) × C +1, the number ending value is N × C, C is obtained by calculation according to the magnitude T of the data sources displayable by the website and the number N of the data sources displayed on each page, and N is more than or equal to 1 and less than or equal to N.
3. The method of claim 2, wherein randomly extracting 1 data number from each of N preset data number intervals, and generating an object to be verified with a data structure as a bit storage structure according to the extracted N data numbers comprises:
in a database redis, storing N data number intervals by adopting a key-value structure, wherein when the number starting values of data numbers included in the N data number intervals are all 1, and the number ending values are all C, the key value of each data number interval is the number N of the data number interval, and the value is 1; when the number starting value of the data number included in the nth data number interval is (n-1) × C +1 and the number ending value is n × C, the key value of the nth data number interval is n and the value is (n-1) × C + 1;
randomly extracting 1 data number in each data number interval of N preset data number intervals;
and combining the extracted N data numbers to generate an object with a data structure of a bit storage structure as the object to be verified, and storing the object to be verified in a java object form.
4. The method of claim 1, wherein when the object to be verified is not duplicated with an object in the object storage space that has been verified, saving the object to be verified as a verified object to the object storage space comprises:
when the object storage space is a database redis and the object to be verified does not exist through the sismemer, the object to be verified is not repeated with the object which passes the verification in the redis, and the object to be verified is stored in the redis.
5. The method according to claim 4, characterized in that when the data structure of the object to be verified is a bitset structure, the object to be verified is stored to redis using the set structure.
6. The method of claim 2, wherein retrieving the corresponding data sources in the data source storage space according to the extracted N data numbers, respectively, and generating N inlined links displayed in a single website page comprises:
determining N primary key ID values according to the extracted N data numbers;
searching N corresponding data sources in the data source storage space according to the ID values of the N primary keys;
and generating N internal chain links according to the N data sources obtained by retrieval.
7. The method according to claim 6, wherein said determining N primary key ID values from the extracted N data numbers comprises:
when the number starting value of the data number included in the nth data number interval in the N data number intervals is (N-1) × C +1 and the number ending value is N × C, the value of the N data number is N primary key ID values;
when the number starting values of the data numbers included in the N data number intervals are all 1, and the number ending values are all C, the calculation formula for calculating the nth primary key ID value in the N primary key ID values is as follows:
ID n =(n-1)*C+D n
wherein N is more than or equal to 1 and less than or equal to N, and D is more than or equal to 1 n ≤C,D n The value of the data number extracted in the nth data number interval.
8. An apparatus for generating an in-website link, the apparatus comprising:
the data string module is used for randomly extracting 1 data number in each of N preset data number intervals and generating an object to be verified with a data structure as a bit storage structure according to the extracted N data numbers;
the data verification module is used for saving the object to be verified as the object passing the verification to the object storage space when the object to be verified is not repeated with the object passing the verification in the object storage space;
and the internal link generation module is used for respectively retrieving the corresponding data sources in the data source storage space according to the extracted N data numbers and generating N internal link displayed in a single website page.
9. A computer-readable storage medium, characterized in that the storage medium stores a computer program for performing the method of any of the preceding claims 1-7.
10. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the instructions to implement the method of any one of claims 1-7.
CN202210246070.XA 2022-03-14 2022-03-14 Website internal link generation method and device, storage medium and electronic equipment Pending CN114969581A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210246070.XA CN114969581A (en) 2022-03-14 2022-03-14 Website internal link generation method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210246070.XA CN114969581A (en) 2022-03-14 2022-03-14 Website internal link generation method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN114969581A true CN114969581A (en) 2022-08-30

Family

ID=82976555

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210246070.XA Pending CN114969581A (en) 2022-03-14 2022-03-14 Website internal link generation method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114969581A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116910392A (en) * 2023-09-04 2023-10-20 杭州阿里巴巴海外网络科技有限公司 Inner chain generation method, data processing method, search method and computing device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116910392A (en) * 2023-09-04 2023-10-20 杭州阿里巴巴海外网络科技有限公司 Inner chain generation method, data processing method, search method and computing device
CN116910392B (en) * 2023-09-04 2024-01-09 杭州阿里巴巴海外网络科技有限公司 Inner chain generation method, data processing method, search method and computing device

Similar Documents

Publication Publication Date Title
JP4848317B2 (en) Database indexing system, method and program
US20170322930A1 (en) Document based query and information retrieval systems and methods
JP5138046B2 (en) Search system, search method and program
US7890503B2 (en) Method and system for performing secondary search actions based on primary search result attributes
US20100121883A1 (en) Reporting language filtering and mapping to dimensional concepts
US20150077419A1 (en) Visualization of data related to unstructured text
US10067977B2 (en) Webpage content search
CN112052138A (en) Service data quality detection method and device, computer equipment and storage medium
CN111814024B (en) Distributed data acquisition method, system and storage medium
CN111241496B (en) Method and device for determining small program feature vector and electronic equipment
CN114969581A (en) Website internal link generation method and device, storage medium and electronic equipment
US20220121665A1 (en) Computerized Methods and Systems for Selecting a View of Query Results
CN113204593A (en) ETL job development system and computer equipment based on big data calculation engine
CN112395517A (en) House resource searching and displaying method and device and computer readable storage medium
US9667741B1 (en) System and method to anonymize data transmitted to a destination computing device
KR20200103133A (en) Method and apparatus for performing extract-transfrom-load procedures in a hadoop-based big data processing system
WO2016147219A1 (en) Text visualization system, text visualization method, and recording medium
CN115080154A (en) Page display method and device, storage medium and electronic equipment
Chang et al. Secondary Index to Big Data NoSQL Database¡ V Incorporating Solr to HBase Approach.
US20150324333A1 (en) Systems and methods for automatically generating hyperlinks
CN111625605A (en) Information synchronization method and device, storage medium and electronic equipment
CN111324707A (en) User interaction method and device, computer-readable storage medium and electronic equipment
Xu The universal design solution for Ajax-based three-tier architecture
Becker et al. Streamlined and accelerated cyber analyst workflows with clx and rapids
JP2018181121A (en) Analyzer, analysis program, and analysis method

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